
(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 (if (<= z -1.32e+39) (+ (* a (* 27.0 b)) (* z (* -9.0 (* y t)))) (+ (- (* x 2.0) (* t (* 9.0 (* y z)))) (* b (* a 27.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 <= -1.32e+39) {
tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.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 <= (-1.32d+39)) then
tmp = (a * (27.0d0 * b)) + (z * ((-9.0d0) * (y * t)))
else
tmp = ((x * 2.0d0) - (t * (9.0d0 * (y * z)))) + (b * (a * 27.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 <= -1.32e+39) {
tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.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 <= -1.32e+39: tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t))) else: tmp = ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.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 <= -1.32e+39) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(z * Float64(-9.0 * Float64(y * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(y * z)))) + Float64(b * Float64(a * 27.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 <= -1.32e+39)
tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
else
tmp = ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.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, -1.32e+39], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $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}\;z \leq -1.32 \cdot 10^{+39}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(9 \cdot \left(y \cdot z\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -1.32e39Initial program 94.1%
sub-neg94.1%
sub-neg94.1%
associate-*l*86.7%
associate-*l*86.6%
Simplified86.6%
Taylor expanded in x around 0 72.9%
associate-*r*72.9%
*-commutative72.9%
*-commutative72.9%
associate-*l*73.0%
sub-neg73.0%
+-commutative73.0%
associate-*l*72.9%
*-commutative72.9%
distribute-lft-neg-in72.9%
associate-*r*74.6%
associate-*r*74.6%
metadata-eval74.6%
*-commutative74.6%
associate-*l*74.6%
Applied egg-rr74.6%
if -1.32e39 < z Initial program 98.4%
Taylor expanded in y around 0 98.4%
Final simplification93.7%
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 (fma a (* 27.0 b) (fma x 2.0 (* y (* t (* -9.0 z))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
return fma(a, (27.0 * b), fma(x, 2.0, (y * (t * (-9.0 * z)))));
}
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) return fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(t * Float64(-9.0 * z))))) 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[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(t * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(t \cdot \left(-9 \cdot z\right)\right)\right)\right)
\end{array}
Initial program 97.6%
Simplified95.8%
Final simplification95.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) (* 9.0 (* t (* y z)))))
(t_2 (+ (* a (* 27.0 b)) (* z (* -9.0 (* y t))))))
(if (<= z -1.75e+36)
t_2
(if (<= z -7.5e-20)
t_1
(if (<= z -2.8e-45)
t_2
(if (<= z 1.55e-43) (+ (* x 2.0) (* 27.0 (* a b))) 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) - (9.0 * (t * (y * z)));
double t_2 = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
double tmp;
if (z <= -1.75e+36) {
tmp = t_2;
} else if (z <= -7.5e-20) {
tmp = t_1;
} else if (z <= -2.8e-45) {
tmp = t_2;
} else if (z <= 1.55e-43) {
tmp = (x * 2.0) + (27.0 * (a * b));
} 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) :: tmp
t_1 = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
t_2 = (a * (27.0d0 * b)) + (z * ((-9.0d0) * (y * t)))
if (z <= (-1.75d+36)) then
tmp = t_2
else if (z <= (-7.5d-20)) then
tmp = t_1
else if (z <= (-2.8d-45)) then
tmp = t_2
else if (z <= 1.55d-43) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
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) - (9.0 * (t * (y * z)));
double t_2 = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
double tmp;
if (z <= -1.75e+36) {
tmp = t_2;
} else if (z <= -7.5e-20) {
tmp = t_1;
} else if (z <= -2.8e-45) {
tmp = t_2;
} else if (z <= 1.55e-43) {
tmp = (x * 2.0) + (27.0 * (a * b));
} 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) - (9.0 * (t * (y * z))) t_2 = (a * (27.0 * b)) + (z * (-9.0 * (y * t))) tmp = 0 if z <= -1.75e+36: tmp = t_2 elif z <= -7.5e-20: tmp = t_1 elif z <= -2.8e-45: tmp = t_2 elif z <= 1.55e-43: tmp = (x * 2.0) + (27.0 * (a * b)) 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(9.0 * Float64(t * Float64(y * z)))) t_2 = Float64(Float64(a * Float64(27.0 * b)) + Float64(z * Float64(-9.0 * Float64(y * t)))) tmp = 0.0 if (z <= -1.75e+36) tmp = t_2; elseif (z <= -7.5e-20) tmp = t_1; elseif (z <= -2.8e-45) tmp = t_2; elseif (z <= 1.55e-43) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); 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) - (9.0 * (t * (y * z)));
t_2 = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
tmp = 0.0;
if (z <= -1.75e+36)
tmp = t_2;
elseif (z <= -7.5e-20)
tmp = t_1;
elseif (z <= -2.8e-45)
tmp = t_2;
elseif (z <= 1.55e-43)
tmp = (x * 2.0) + (27.0 * (a * b));
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[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+36], t$95$2, If[LessEqual[z, -7.5e-20], t$95$1, If[LessEqual[z, -2.8e-45], t$95$2, If[LessEqual[z, 1.55e-43], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $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 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_2 := a \cdot \left(27 \cdot b\right) + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+36}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-45}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-43}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.7499999999999999e36 or -7.49999999999999981e-20 < z < -2.8000000000000001e-45Initial program 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*88.1%
associate-*l*88.0%
Simplified88.0%
Taylor expanded in x around 0 70.5%
associate-*r*70.6%
*-commutative70.6%
*-commutative70.6%
associate-*l*70.6%
sub-neg70.6%
+-commutative70.6%
associate-*l*70.6%
*-commutative70.6%
distribute-lft-neg-in70.6%
associate-*r*72.0%
associate-*r*72.1%
metadata-eval72.1%
*-commutative72.1%
associate-*l*72.0%
Applied egg-rr72.0%
if -1.7499999999999999e36 < z < -7.49999999999999981e-20 or 1.55e-43 < z Initial program 96.6%
sub-neg96.6%
sub-neg96.6%
associate-*l*94.3%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in a around 0 75.1%
if -2.8000000000000001e-45 < z < 1.55e-43Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 84.4%
Final simplification78.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 (* 27.0 (* a b)))
(t_2 (* 9.0 (* t (* y z))))
(t_3 (- (* x 2.0) t_2)))
(if (<= z -2.4e+39)
(+ (* a (* 27.0 b)) (* z (* -9.0 (* y t))))
(if (<= z -8.6e-50)
t_3
(if (<= z -5.8e-91)
(- t_1 t_2)
(if (<= z 6.5e-44) (+ (* x 2.0) t_1) t_3))))))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 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double t_3 = (x * 2.0) - t_2;
double tmp;
if (z <= -2.4e+39) {
tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
} else if (z <= -8.6e-50) {
tmp = t_3;
} else if (z <= -5.8e-91) {
tmp = t_1 - t_2;
} else if (z <= 6.5e-44) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_3;
}
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 = 27.0d0 * (a * b)
t_2 = 9.0d0 * (t * (y * z))
t_3 = (x * 2.0d0) - t_2
if (z <= (-2.4d+39)) then
tmp = (a * (27.0d0 * b)) + (z * ((-9.0d0) * (y * t)))
else if (z <= (-8.6d-50)) then
tmp = t_3
else if (z <= (-5.8d-91)) then
tmp = t_1 - t_2
else if (z <= 6.5d-44) then
tmp = (x * 2.0d0) + t_1
else
tmp = t_3
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 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double t_3 = (x * 2.0) - t_2;
double tmp;
if (z <= -2.4e+39) {
tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
} else if (z <= -8.6e-50) {
tmp = t_3;
} else if (z <= -5.8e-91) {
tmp = t_1 - t_2;
} else if (z <= 6.5e-44) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_3;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = 9.0 * (t * (y * z)) t_3 = (x * 2.0) - t_2 tmp = 0 if z <= -2.4e+39: tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t))) elif z <= -8.6e-50: tmp = t_3 elif z <= -5.8e-91: tmp = t_1 - t_2 elif z <= 6.5e-44: tmp = (x * 2.0) + t_1 else: tmp = t_3 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(27.0 * Float64(a * b)) t_2 = Float64(9.0 * Float64(t * Float64(y * z))) t_3 = Float64(Float64(x * 2.0) - t_2) tmp = 0.0 if (z <= -2.4e+39) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(z * Float64(-9.0 * Float64(y * t)))); elseif (z <= -8.6e-50) tmp = t_3; elseif (z <= -5.8e-91) tmp = Float64(t_1 - t_2); elseif (z <= 6.5e-44) tmp = Float64(Float64(x * 2.0) + t_1); else tmp = t_3; 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 = 27.0 * (a * b);
t_2 = 9.0 * (t * (y * z));
t_3 = (x * 2.0) - t_2;
tmp = 0.0;
if (z <= -2.4e+39)
tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
elseif (z <= -8.6e-50)
tmp = t_3;
elseif (z <= -5.8e-91)
tmp = t_1 - t_2;
elseif (z <= 6.5e-44)
tmp = (x * 2.0) + t_1;
else
tmp = t_3;
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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[z, -2.4e+39], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.6e-50], t$95$3, If[LessEqual[z, -5.8e-91], N[(t$95$1 - t$95$2), $MachinePrecision], If[LessEqual[z, 6.5e-44], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_3 := x \cdot 2 - t_2\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+39}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -8.6 \cdot 10^{-50}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-91}:\\
\;\;\;\;t_1 - t_2\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-44}:\\
\;\;\;\;x \cdot 2 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -2.4000000000000001e39Initial program 94.1%
sub-neg94.1%
sub-neg94.1%
associate-*l*86.7%
associate-*l*86.6%
Simplified86.6%
Taylor expanded in x around 0 72.9%
associate-*r*72.9%
*-commutative72.9%
*-commutative72.9%
associate-*l*73.0%
sub-neg73.0%
+-commutative73.0%
associate-*l*72.9%
*-commutative72.9%
distribute-lft-neg-in72.9%
associate-*r*74.6%
associate-*r*74.6%
metadata-eval74.6%
*-commutative74.6%
associate-*l*74.6%
Applied egg-rr74.6%
if -2.4000000000000001e39 < z < -8.59999999999999995e-50 or 6.5e-44 < z Initial program 96.8%
sub-neg96.8%
sub-neg96.8%
associate-*l*94.7%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in a around 0 75.9%
if -8.59999999999999995e-50 < z < -5.8000000000000001e-91Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.6%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around 0 74.2%
if -5.8000000000000001e-91 < z < 6.5e-44Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 83.2%
Final simplification78.6%
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) (* (* y 9.0) (* t z))) (* a (* 27.0 b))))
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) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
}
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) - ((y * 9.0d0) * (t * z))) + (a * (27.0d0 * b))
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 * 9.0) * (t * z))) + (a * (27.0 * b));
}
[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 * 9.0) * (t * z))) + (a * (27.0 * b))
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(t * z))) + Float64(a * Float64(27.0 * b))) 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) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
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[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 97.6%
sub-neg97.6%
sub-neg97.6%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Final simplification95.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
(let* ((t_1 (* a (* 27.0 b))))
(if (<= x -2.6e+99)
(* x 2.0)
(if (<= x -1.25e-23)
(* z (* -9.0 (* y t)))
(if (<= x -3.1e-44)
t_1
(if (<= x 3.65e-225)
(* (* y z) (* t -9.0))
(if (<= x 3.8e+105) t_1 (* 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 = a * (27.0 * b);
double tmp;
if (x <= -2.6e+99) {
tmp = x * 2.0;
} else if (x <= -1.25e-23) {
tmp = z * (-9.0 * (y * t));
} else if (x <= -3.1e-44) {
tmp = t_1;
} else if (x <= 3.65e-225) {
tmp = (y * z) * (t * -9.0);
} else if (x <= 3.8e+105) {
tmp = t_1;
} 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 = a * (27.0d0 * b)
if (x <= (-2.6d+99)) then
tmp = x * 2.0d0
else if (x <= (-1.25d-23)) then
tmp = z * ((-9.0d0) * (y * t))
else if (x <= (-3.1d-44)) then
tmp = t_1
else if (x <= 3.65d-225) then
tmp = (y * z) * (t * (-9.0d0))
else if (x <= 3.8d+105) then
tmp = t_1
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 = a * (27.0 * b);
double tmp;
if (x <= -2.6e+99) {
tmp = x * 2.0;
} else if (x <= -1.25e-23) {
tmp = z * (-9.0 * (y * t));
} else if (x <= -3.1e-44) {
tmp = t_1;
} else if (x <= 3.65e-225) {
tmp = (y * z) * (t * -9.0);
} else if (x <= 3.8e+105) {
tmp = t_1;
} 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 = a * (27.0 * b) tmp = 0 if x <= -2.6e+99: tmp = x * 2.0 elif x <= -1.25e-23: tmp = z * (-9.0 * (y * t)) elif x <= -3.1e-44: tmp = t_1 elif x <= 3.65e-225: tmp = (y * z) * (t * -9.0) elif x <= 3.8e+105: tmp = t_1 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(a * Float64(27.0 * b)) tmp = 0.0 if (x <= -2.6e+99) tmp = Float64(x * 2.0); elseif (x <= -1.25e-23) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (x <= -3.1e-44) tmp = t_1; elseif (x <= 3.65e-225) tmp = Float64(Float64(y * z) * Float64(t * -9.0)); elseif (x <= 3.8e+105) tmp = t_1; 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 = a * (27.0 * b);
tmp = 0.0;
if (x <= -2.6e+99)
tmp = x * 2.0;
elseif (x <= -1.25e-23)
tmp = z * (-9.0 * (y * t));
elseif (x <= -3.1e-44)
tmp = t_1;
elseif (x <= 3.65e-225)
tmp = (y * z) * (t * -9.0);
elseif (x <= 3.8e+105)
tmp = t_1;
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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.6e+99], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -1.25e-23], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.1e-44], t$95$1, If[LessEqual[x, 3.65e-225], N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e+105], t$95$1, 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 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+99}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-23}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;x \leq -3.1 \cdot 10^{-44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.65 \cdot 10^{-225}:\\
\;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right)\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+105}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -2.6e99 or 3.8e105 < x Initial program 99.0%
sub-neg99.0%
sub-neg99.0%
associate-*l*99.0%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in x around inf 72.8%
if -2.6e99 < x < -1.2500000000000001e-23Initial program 99.7%
Taylor expanded in y around 0 99.7%
Taylor expanded in y around inf 44.2%
*-commutative44.2%
associate-*r*44.2%
*-commutative44.2%
associate-*l*44.3%
*-commutative44.3%
Simplified44.3%
Taylor expanded in t around 0 44.2%
*-commutative44.2%
associate-*r*44.2%
associate-*r*44.3%
*-commutative44.3%
associate-*r*44.2%
Simplified44.2%
if -1.2500000000000001e-23 < x < -3.09999999999999984e-44 or 3.64999999999999998e-225 < x < 3.8e105Initial program 95.9%
sub-neg95.9%
sub-neg95.9%
associate-*l*94.6%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around inf 49.7%
associate-*r*49.7%
*-commutative49.7%
associate-*r*49.8%
Simplified49.8%
if -3.09999999999999984e-44 < x < 3.64999999999999998e-225Initial program 96.7%
Taylor expanded in y around 0 96.7%
Taylor expanded in y around inf 53.8%
*-commutative53.8%
associate-*r*46.8%
*-commutative46.8%
associate-*l*46.8%
*-commutative46.8%
Simplified46.8%
Taylor expanded in t around 0 53.8%
*-commutative53.8%
associate-*r*46.8%
associate-*r*46.8%
*-commutative46.8%
associate-*r*46.8%
Simplified46.8%
Taylor expanded in z around 0 53.8%
associate-*r*53.8%
Simplified53.8%
Final simplification59.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.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* 27.0 b))))
(if (<= x -3.5e+99)
(* x 2.0)
(if (<= x -4.4e-28)
(* (* y t) (* -9.0 z))
(if (<= x -7e-45)
t_1
(if (<= x 1.65e-227)
(* (* y z) (* t -9.0))
(if (<= x 7e+101) t_1 (* 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 = a * (27.0 * b);
double tmp;
if (x <= -3.5e+99) {
tmp = x * 2.0;
} else if (x <= -4.4e-28) {
tmp = (y * t) * (-9.0 * z);
} else if (x <= -7e-45) {
tmp = t_1;
} else if (x <= 1.65e-227) {
tmp = (y * z) * (t * -9.0);
} else if (x <= 7e+101) {
tmp = t_1;
} 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 = a * (27.0d0 * b)
if (x <= (-3.5d+99)) then
tmp = x * 2.0d0
else if (x <= (-4.4d-28)) then
tmp = (y * t) * ((-9.0d0) * z)
else if (x <= (-7d-45)) then
tmp = t_1
else if (x <= 1.65d-227) then
tmp = (y * z) * (t * (-9.0d0))
else if (x <= 7d+101) then
tmp = t_1
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 = a * (27.0 * b);
double tmp;
if (x <= -3.5e+99) {
tmp = x * 2.0;
} else if (x <= -4.4e-28) {
tmp = (y * t) * (-9.0 * z);
} else if (x <= -7e-45) {
tmp = t_1;
} else if (x <= 1.65e-227) {
tmp = (y * z) * (t * -9.0);
} else if (x <= 7e+101) {
tmp = t_1;
} 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 = a * (27.0 * b) tmp = 0 if x <= -3.5e+99: tmp = x * 2.0 elif x <= -4.4e-28: tmp = (y * t) * (-9.0 * z) elif x <= -7e-45: tmp = t_1 elif x <= 1.65e-227: tmp = (y * z) * (t * -9.0) elif x <= 7e+101: tmp = t_1 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(a * Float64(27.0 * b)) tmp = 0.0 if (x <= -3.5e+99) tmp = Float64(x * 2.0); elseif (x <= -4.4e-28) tmp = Float64(Float64(y * t) * Float64(-9.0 * z)); elseif (x <= -7e-45) tmp = t_1; elseif (x <= 1.65e-227) tmp = Float64(Float64(y * z) * Float64(t * -9.0)); elseif (x <= 7e+101) tmp = t_1; 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 = a * (27.0 * b);
tmp = 0.0;
if (x <= -3.5e+99)
tmp = x * 2.0;
elseif (x <= -4.4e-28)
tmp = (y * t) * (-9.0 * z);
elseif (x <= -7e-45)
tmp = t_1;
elseif (x <= 1.65e-227)
tmp = (y * z) * (t * -9.0);
elseif (x <= 7e+101)
tmp = t_1;
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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.5e+99], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -4.4e-28], N[(N[(y * t), $MachinePrecision] * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7e-45], t$95$1, If[LessEqual[x, 1.65e-227], N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7e+101], t$95$1, 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 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+99}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -4.4 \cdot 10^{-28}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(-9 \cdot z\right)\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-227}:\\
\;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right)\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+101}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -3.4999999999999998e99 or 7.00000000000000046e101 < x Initial program 99.0%
sub-neg99.0%
sub-neg99.0%
associate-*l*99.0%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in x around inf 72.8%
if -3.4999999999999998e99 < x < -4.39999999999999992e-28Initial program 99.7%
Taylor expanded in y around 0 99.7%
Taylor expanded in y around inf 44.2%
*-commutative44.2%
associate-*r*44.2%
*-commutative44.2%
associate-*l*44.3%
*-commutative44.3%
Simplified44.3%
if -4.39999999999999992e-28 < x < -7e-45 or 1.65e-227 < x < 7.00000000000000046e101Initial program 95.9%
sub-neg95.9%
sub-neg95.9%
associate-*l*94.6%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around inf 49.7%
associate-*r*49.7%
*-commutative49.7%
associate-*r*49.8%
Simplified49.8%
if -7e-45 < x < 1.65e-227Initial program 96.7%
Taylor expanded in y around 0 96.7%
Taylor expanded in y around inf 53.8%
*-commutative53.8%
associate-*r*46.8%
*-commutative46.8%
associate-*l*46.8%
*-commutative46.8%
Simplified46.8%
Taylor expanded in t around 0 53.8%
*-commutative53.8%
associate-*r*46.8%
associate-*r*46.8%
*-commutative46.8%
associate-*r*46.8%
Simplified46.8%
Taylor expanded in z around 0 53.8%
associate-*r*53.8%
Simplified53.8%
Final simplification59.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. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.35e+82) (not (<= a 0.0082))) (+ (* x 2.0) (* 27.0 (* a b))) (- (* x 2.0) (* 9.0 (* t (* y z))))))
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 ((a <= -2.35e+82) || !(a <= 0.0082)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
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 ((a <= (-2.35d+82)) .or. (.not. (a <= 0.0082d0))) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
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 ((a <= -2.35e+82) || !(a <= 0.0082)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
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 (a <= -2.35e+82) or not (a <= 0.0082): tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) 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 ((a <= -2.35e+82) || !(a <= 0.0082)) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); 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 ((a <= -2.35e+82) || ~((a <= 0.0082)))
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
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[a, -2.35e+82], N[Not[LessEqual[a, 0.0082]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $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}\;a \leq -2.35 \cdot 10^{+82} \lor \neg \left(a \leq 0.0082\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if a < -2.35e82 or 0.00820000000000000069 < a Initial program 96.9%
sub-neg96.9%
sub-neg96.9%
associate-*l*94.0%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in y around 0 78.8%
if -2.35e82 < a < 0.00820000000000000069Initial program 98.0%
sub-neg98.0%
sub-neg98.0%
associate-*l*96.2%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in a around 0 85.0%
Final simplification82.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 (* a (* 27.0 b))))
(if (<= x -2.1e+126)
(* x 2.0)
(if (<= x -2.3e-257)
t_1
(if (<= x 2.7e-226)
(* -9.0 (* t (* y z)))
(if (<= x 1.75e+103) t_1 (* 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 = a * (27.0 * b);
double tmp;
if (x <= -2.1e+126) {
tmp = x * 2.0;
} else if (x <= -2.3e-257) {
tmp = t_1;
} else if (x <= 2.7e-226) {
tmp = -9.0 * (t * (y * z));
} else if (x <= 1.75e+103) {
tmp = t_1;
} 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 = a * (27.0d0 * b)
if (x <= (-2.1d+126)) then
tmp = x * 2.0d0
else if (x <= (-2.3d-257)) then
tmp = t_1
else if (x <= 2.7d-226) then
tmp = (-9.0d0) * (t * (y * z))
else if (x <= 1.75d+103) then
tmp = t_1
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 = a * (27.0 * b);
double tmp;
if (x <= -2.1e+126) {
tmp = x * 2.0;
} else if (x <= -2.3e-257) {
tmp = t_1;
} else if (x <= 2.7e-226) {
tmp = -9.0 * (t * (y * z));
} else if (x <= 1.75e+103) {
tmp = t_1;
} 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 = a * (27.0 * b) tmp = 0 if x <= -2.1e+126: tmp = x * 2.0 elif x <= -2.3e-257: tmp = t_1 elif x <= 2.7e-226: tmp = -9.0 * (t * (y * z)) elif x <= 1.75e+103: tmp = t_1 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(a * Float64(27.0 * b)) tmp = 0.0 if (x <= -2.1e+126) tmp = Float64(x * 2.0); elseif (x <= -2.3e-257) tmp = t_1; elseif (x <= 2.7e-226) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); elseif (x <= 1.75e+103) tmp = t_1; 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 = a * (27.0 * b);
tmp = 0.0;
if (x <= -2.1e+126)
tmp = x * 2.0;
elseif (x <= -2.3e-257)
tmp = t_1;
elseif (x <= 2.7e-226)
tmp = -9.0 * (t * (y * z));
elseif (x <= 1.75e+103)
tmp = t_1;
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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+126], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -2.3e-257], t$95$1, If[LessEqual[x, 2.7e-226], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.75e+103], t$95$1, 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 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+126}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-257}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-226}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{+103}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -2.0999999999999999e126 or 1.75e103 < x Initial program 98.9%
sub-neg98.9%
sub-neg98.9%
associate-*l*98.9%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in x around inf 75.3%
if -2.0999999999999999e126 < x < -2.3e-257 or 2.70000000000000014e-226 < x < 1.75e103Initial program 96.3%
sub-neg96.3%
sub-neg96.3%
associate-*l*93.0%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in a around inf 47.3%
associate-*r*47.3%
*-commutative47.3%
associate-*r*47.4%
Simplified47.4%
if -2.3e-257 < x < 2.70000000000000014e-226Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*96.0%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in y around inf 68.6%
Final simplification59.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 (<= y -3.4e+185) (* -9.0 (* t (* y z))) (if (<= y 2.1e-131) (+ (* x 2.0) (* 27.0 (* a b))) (* (* y t) (* -9.0 z)))))
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 <= -3.4e+185) {
tmp = -9.0 * (t * (y * z));
} else if (y <= 2.1e-131) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (y * t) * (-9.0 * z);
}
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 <= (-3.4d+185)) then
tmp = (-9.0d0) * (t * (y * z))
else if (y <= 2.1d-131) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (y * t) * ((-9.0d0) * z)
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 <= -3.4e+185) {
tmp = -9.0 * (t * (y * z));
} else if (y <= 2.1e-131) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (y * t) * (-9.0 * z);
}
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 <= -3.4e+185: tmp = -9.0 * (t * (y * z)) elif y <= 2.1e-131: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (y * t) * (-9.0 * z) 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 <= -3.4e+185) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); elseif (y <= 2.1e-131) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(y * t) * Float64(-9.0 * z)); 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 <= -3.4e+185)
tmp = -9.0 * (t * (y * z));
elseif (y <= 2.1e-131)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (y * t) * (-9.0 * z);
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[y, -3.4e+185], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-131], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * t), $MachinePrecision] * N[(-9.0 * z), $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 -3.4 \cdot 10^{+185}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-131}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(-9 \cdot z\right)\\
\end{array}
\end{array}
if y < -3.40000000000000017e185Initial program 79.7%
sub-neg79.7%
sub-neg79.7%
associate-*l*94.4%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in y around inf 54.0%
if -3.40000000000000017e185 < y < 2.09999999999999997e-131Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*94.8%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in y around 0 81.4%
if 2.09999999999999997e-131 < y Initial program 97.6%
Taylor expanded in y around 0 97.6%
Taylor expanded in y around inf 48.9%
*-commutative48.9%
associate-*r*43.5%
*-commutative43.5%
associate-*l*43.5%
*-commutative43.5%
Simplified43.5%
Final simplification66.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 (<= x -5.2e+128) (not (<= x 5.5e+102))) (* 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 ((x <= -5.2e+128) || !(x <= 5.5e+102)) {
tmp = x * 2.0;
} else {
tmp = 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 ((x <= (-5.2d+128)) .or. (.not. (x <= 5.5d+102))) then
tmp = x * 2.0d0
else
tmp = 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 ((x <= -5.2e+128) || !(x <= 5.5e+102)) {
tmp = x * 2.0;
} else {
tmp = 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 (x <= -5.2e+128) or not (x <= 5.5e+102): tmp = x * 2.0 else: tmp = 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 ((x <= -5.2e+128) || !(x <= 5.5e+102)) tmp = Float64(x * 2.0); else tmp = 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 ((x <= -5.2e+128) || ~((x <= 5.5e+102)))
tmp = x * 2.0;
else
tmp = 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[x, -5.2e+128], N[Not[LessEqual[x, 5.5e+102]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $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 -5.2 \cdot 10^{+128} \lor \neg \left(x \leq 5.5 \cdot 10^{+102}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if x < -5.2e128 or 5.49999999999999981e102 < x Initial program 98.9%
sub-neg98.9%
sub-neg98.9%
associate-*l*98.9%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in x around inf 75.3%
if -5.2e128 < x < 5.49999999999999981e102Initial program 96.8%
sub-neg96.8%
sub-neg96.8%
associate-*l*93.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in a around inf 45.1%
Final simplification55.6%
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 (<= x -3.3e+127) (not (<= x 9e+108))) (* x 2.0) (* a (* 27.0 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 ((x <= -3.3e+127) || !(x <= 9e+108)) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * 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 ((x <= (-3.3d+127)) .or. (.not. (x <= 9d+108))) then
tmp = x * 2.0d0
else
tmp = a * (27.0d0 * 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 ((x <= -3.3e+127) || !(x <= 9e+108)) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * 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 (x <= -3.3e+127) or not (x <= 9e+108): tmp = x * 2.0 else: tmp = a * (27.0 * 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 ((x <= -3.3e+127) || !(x <= 9e+108)) tmp = Float64(x * 2.0); else tmp = Float64(a * Float64(27.0 * 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 ((x <= -3.3e+127) || ~((x <= 9e+108)))
tmp = x * 2.0;
else
tmp = a * (27.0 * 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[x, -3.3e+127], N[Not[LessEqual[x, 9e+108]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision]), $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 -3.3 \cdot 10^{+127} \lor \neg \left(x \leq 9 \cdot 10^{+108}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if x < -3.29999999999999977e127 or 9e108 < x Initial program 98.9%
sub-neg98.9%
sub-neg98.9%
associate-*l*98.9%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in x around inf 75.3%
if -3.29999999999999977e127 < x < 9e108Initial program 96.8%
sub-neg96.8%
sub-neg96.8%
associate-*l*93.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in a around inf 45.1%
associate-*r*45.1%
*-commutative45.1%
associate-*r*45.1%
Simplified45.1%
Final simplification55.6%
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 97.6%
sub-neg97.6%
sub-neg97.6%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in x around inf 36.4%
Final simplification36.4%
(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 2023320
(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)))