
(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 16 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: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 2e-218) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (+ (- (* x 2.0) (* t (* y (* z 9.0)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e-218) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = ((x * 2.0) - (t * (y * (z * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2e-218) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(z * 9.0)))) + Float64(b * Float64(a * 27.0))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2e-218], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{-218}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 2.0000000000000001e-218Initial program 97.0%
+-commutative97.0%
associate-+r-97.0%
*-commutative97.0%
cancel-sign-sub-inv97.0%
associate-*r*93.3%
distribute-lft-neg-in93.3%
*-commutative93.3%
cancel-sign-sub-inv93.3%
associate-+r-93.3%
associate-*l*93.3%
fma-def94.0%
fma-neg94.0%
associate-*l*97.7%
distribute-rgt-neg-in97.7%
*-commutative97.7%
associate-*l*97.7%
*-commutative97.7%
distribute-lft-neg-in97.7%
associate-*r*97.7%
Simplified97.7%
if 2.0000000000000001e-218 < z Initial program 98.2%
Taylor expanded in y around 0 98.3%
associate-*r*98.2%
*-commutative98.2%
associate-*r*98.2%
Simplified98.2%
Final simplification97.9%
NOTE: x, y, z, t, 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))))
(if (<= b -4.2e-158)
(+ t_1 (* x 2.0))
(if (<= b 2.5e+96)
(- (* x 2.0) (* 9.0 (* z (* y t))))
(if (or (<= b 5.2e+130) (not (<= b 1.35e+160)))
(- t_1 (* 9.0 (* t (* z y))))
(+ (* x 2.0) (* b (* a 27.0))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (b <= -4.2e-158) {
tmp = t_1 + (x * 2.0);
} else if (b <= 2.5e+96) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else if ((b <= 5.2e+130) || !(b <= 1.35e+160)) {
tmp = t_1 - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, 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 = 27.0d0 * (a * b)
if (b <= (-4.2d-158)) then
tmp = t_1 + (x * 2.0d0)
else if (b <= 2.5d+96) then
tmp = (x * 2.0d0) - (9.0d0 * (z * (y * t)))
else if ((b <= 5.2d+130) .or. (.not. (b <= 1.35d+160))) then
tmp = t_1 - (9.0d0 * (t * (z * y)))
else
tmp = (x * 2.0d0) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && 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 tmp;
if (b <= -4.2e-158) {
tmp = t_1 + (x * 2.0);
} else if (b <= 2.5e+96) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else if ((b <= 5.2e+130) || !(b <= 1.35e+160)) {
tmp = t_1 - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if b <= -4.2e-158: tmp = t_1 + (x * 2.0) elif b <= 2.5e+96: tmp = (x * 2.0) - (9.0 * (z * (y * t))) elif (b <= 5.2e+130) or not (b <= 1.35e+160): tmp = t_1 - (9.0 * (t * (z * y))) else: tmp = (x * 2.0) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (b <= -4.2e-158) tmp = Float64(t_1 + Float64(x * 2.0)); elseif (b <= 2.5e+96) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))); elseif ((b <= 5.2e+130) || !(b <= 1.35e+160)) tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(z * y)))); else tmp = Float64(Float64(x * 2.0) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (b <= -4.2e-158)
tmp = t_1 + (x * 2.0);
elseif (b <= 2.5e+96)
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
elseif ((b <= 5.2e+130) || ~((b <= 1.35e+160)))
tmp = t_1 - (9.0 * (t * (z * y)));
else
tmp = (x * 2.0) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, 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]}, If[LessEqual[b, -4.2e-158], N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.5e+96], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, 5.2e+130], N[Not[LessEqual[b, 1.35e+160]], $MachinePrecision]], N[(t$95$1 - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -4.2 \cdot 10^{-158}:\\
\;\;\;\;t_1 + x \cdot 2\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{+96}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{+130} \lor \neg \left(b \leq 1.35 \cdot 10^{+160}\right):\\
\;\;\;\;t_1 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if b < -4.19999999999999983e-158Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*97.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in y around 0 61.9%
if -4.19999999999999983e-158 < b < 2.5000000000000002e96Initial program 98.9%
sub-neg98.9%
sub-neg98.9%
associate-*l*98.8%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in a around 0 84.0%
expm1-log1p-u44.3%
expm1-udef36.9%
*-commutative36.9%
*-commutative36.9%
associate-*l*37.7%
Applied egg-rr57.0%
expm1-def43.3%
expm1-log1p59.1%
*-commutative59.1%
Simplified79.4%
if 2.5000000000000002e96 < b < 5.1999999999999996e130 or 1.35e160 < b Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*95.3%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in x around 0 88.9%
if 5.1999999999999996e130 < b < 1.35e160Initial program 100.0%
+-commutative100.0%
associate-+r-100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
associate-*r*100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
associate-+r-100.0%
associate-*l*99.7%
fma-def99.7%
cancel-sign-sub-inv99.7%
fma-def99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
distribute-lft-neg-out99.7%
associate-*r*99.7%
associate-*l*99.7%
Simplified99.7%
Applied egg-rr99.7%
Taylor expanded in t around 0 99.7%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Final simplification74.2%
NOTE: x, y, z, t, 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))))
(if (<= z -5.5e+83)
(- t_1 (* 9.0 (* z (* y t))))
(+ (+ (* (* t -9.0) (* z y)) t_1) (* x 2.0)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -5.5e+83) {
tmp = t_1 - (9.0 * (z * (y * t)));
} else {
tmp = (((t * -9.0) * (z * y)) + t_1) + (x * 2.0);
}
return tmp;
}
NOTE: x, y, z, t, 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 = 27.0d0 * (a * b)
if (z <= (-5.5d+83)) then
tmp = t_1 - (9.0d0 * (z * (y * t)))
else
tmp = (((t * (-9.0d0)) * (z * y)) + t_1) + (x * 2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && 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 tmp;
if (z <= -5.5e+83) {
tmp = t_1 - (9.0 * (z * (y * t)));
} else {
tmp = (((t * -9.0) * (z * y)) + t_1) + (x * 2.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -5.5e+83: tmp = t_1 - (9.0 * (z * (y * t))) else: tmp = (((t * -9.0) * (z * y)) + t_1) + (x * 2.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -5.5e+83) tmp = Float64(t_1 - Float64(9.0 * Float64(z * Float64(y * t)))); else tmp = Float64(Float64(Float64(Float64(t * -9.0) * Float64(z * y)) + t_1) + Float64(x * 2.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -5.5e+83)
tmp = t_1 - (9.0 * (z * (y * t)));
else
tmp = (((t * -9.0) * (z * y)) + t_1) + (x * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, 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]}, If[LessEqual[z, -5.5e+83], N[(t$95$1 - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * -9.0), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+83}:\\
\;\;\;\;t_1 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t \cdot -9\right) \cdot \left(z \cdot y\right) + t_1\right) + x \cdot 2\\
\end{array}
\end{array}
if z < -5.4999999999999996e83Initial program 90.2%
sub-neg90.2%
sub-neg90.2%
associate-*l*90.2%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in x around 0 73.7%
expm1-log1p-u57.9%
expm1-udef54.4%
*-commutative54.4%
*-commutative54.4%
associate-*l*57.6%
Applied egg-rr57.6%
expm1-def59.9%
expm1-log1p78.3%
*-commutative78.3%
Simplified78.3%
if -5.4999999999999996e83 < z Initial program 98.9%
+-commutative98.9%
associate-+r-98.9%
*-commutative98.9%
cancel-sign-sub-inv98.9%
associate-*r*94.0%
distribute-lft-neg-in94.0%
*-commutative94.0%
cancel-sign-sub-inv94.0%
associate-+r-94.0%
associate-*l*93.1%
fma-def93.1%
cancel-sign-sub-inv93.1%
fma-def93.1%
*-commutative93.1%
distribute-rgt-neg-in93.1%
distribute-lft-neg-out93.1%
associate-*r*98.0%
associate-*l*98.0%
Simplified98.0%
Applied egg-rr98.9%
Final simplification95.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 2e-201) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (+ (+ (* (* t -9.0) (* z y)) (* 27.0 (* a b))) (* x 2.0))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e-201) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = (((t * -9.0) * (z * y)) + (27.0 * (a * b))) + (x * 2.0);
}
return tmp;
}
NOTE: x, y, z, t, 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 <= 2d-201) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = (((t * (-9.0d0)) * (z * y)) + (27.0d0 * (a * b))) + (x * 2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e-201) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = (((t * -9.0) * (z * y)) + (27.0 * (a * b))) + (x * 2.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 2e-201: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = (((t * -9.0) * (z * y)) + (27.0 * (a * b))) + (x * 2.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2e-201) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(Float64(t * -9.0) * Float64(z * y)) + Float64(27.0 * Float64(a * b))) + Float64(x * 2.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 2e-201)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = (((t * -9.0) * (z * y)) + (27.0 * (a * b))) + (x * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2e-201], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * -9.0), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{-201}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t \cdot -9\right) \cdot \left(z \cdot y\right) + 27 \cdot \left(a \cdot b\right)\right) + x \cdot 2\\
\end{array}
\end{array}
if z < 1.99999999999999989e-201Initial program 97.0%
sub-neg97.0%
sub-neg97.0%
associate-*l*97.0%
associate-*l*97.0%
Simplified97.0%
if 1.99999999999999989e-201 < z Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-*r*95.5%
distribute-lft-neg-in95.5%
*-commutative95.5%
cancel-sign-sub-inv95.5%
associate-+r-95.5%
associate-*l*93.8%
fma-def93.8%
cancel-sign-sub-inv93.8%
fma-def93.8%
*-commutative93.8%
distribute-rgt-neg-in93.8%
distribute-lft-neg-out93.8%
associate-*r*96.5%
associate-*l*96.5%
Simplified96.5%
Applied egg-rr98.2%
Final simplification97.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 2e-219) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* y (* z 9.0)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e-219) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (y * (z * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, 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 <= 2d-219) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * (y * (z * 9.0d0)))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e-219) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (y * (z * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 2e-219: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * (y * (z * 9.0)))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2e-219) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(z * 9.0)))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 2e-219)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * (y * (z * 9.0)))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2e-219], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{-219}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 2.0000000000000001e-219Initial program 97.0%
sub-neg97.0%
sub-neg97.0%
associate-*l*96.9%
associate-*l*97.0%
Simplified97.0%
if 2.0000000000000001e-219 < z Initial program 98.2%
Taylor expanded in y around 0 98.3%
associate-*r*98.2%
*-commutative98.2%
associate-*r*98.2%
Simplified98.2%
Final simplification97.6%
NOTE: x, y, z, t, 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 (* -9.0 (* t (* z y)))))
(if (<= z -2.02e-106)
t_1
(if (<= z -6.8e-307)
(* x 2.0)
(if (<= z 1.7e-89)
(* b (* a 27.0))
(if (<= z 1.82e-53)
(* x 2.0)
(if (<= z 1.7e-38) (* a (* 27.0 b)) t_1)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (z <= -2.02e-106) {
tmp = t_1;
} else if (z <= -6.8e-307) {
tmp = x * 2.0;
} else if (z <= 1.7e-89) {
tmp = b * (a * 27.0);
} else if (z <= 1.82e-53) {
tmp = x * 2.0;
} else if (z <= 1.7e-38) {
tmp = a * (27.0 * b);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, 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 = (-9.0d0) * (t * (z * y))
if (z <= (-2.02d-106)) then
tmp = t_1
else if (z <= (-6.8d-307)) then
tmp = x * 2.0d0
else if (z <= 1.7d-89) then
tmp = b * (a * 27.0d0)
else if (z <= 1.82d-53) then
tmp = x * 2.0d0
else if (z <= 1.7d-38) then
tmp = a * (27.0d0 * b)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (z <= -2.02e-106) {
tmp = t_1;
} else if (z <= -6.8e-307) {
tmp = x * 2.0;
} else if (z <= 1.7e-89) {
tmp = b * (a * 27.0);
} else if (z <= 1.82e-53) {
tmp = x * 2.0;
} else if (z <= 1.7e-38) {
tmp = a * (27.0 * b);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (z * y)) tmp = 0 if z <= -2.02e-106: tmp = t_1 elif z <= -6.8e-307: tmp = x * 2.0 elif z <= 1.7e-89: tmp = b * (a * 27.0) elif z <= 1.82e-53: tmp = x * 2.0 elif z <= 1.7e-38: tmp = a * (27.0 * b) else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (z <= -2.02e-106) tmp = t_1; elseif (z <= -6.8e-307) tmp = Float64(x * 2.0); elseif (z <= 1.7e-89) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= 1.82e-53) tmp = Float64(x * 2.0); elseif (z <= 1.7e-38) tmp = Float64(a * Float64(27.0 * b)); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (z * y));
tmp = 0.0;
if (z <= -2.02e-106)
tmp = t_1;
elseif (z <= -6.8e-307)
tmp = x * 2.0;
elseif (z <= 1.7e-89)
tmp = b * (a * 27.0);
elseif (z <= 1.82e-53)
tmp = x * 2.0;
elseif (z <= 1.7e-38)
tmp = a * (27.0 * b);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, 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[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.02e-106], t$95$1, If[LessEqual[z, -6.8e-307], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.7e-89], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.82e-53], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.7e-38], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq -2.02 \cdot 10^{-106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-307}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-89}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 1.82 \cdot 10^{-53}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-38}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.02000000000000011e-106 or 1.7000000000000001e-38 < z Initial program 96.3%
sub-neg96.3%
sub-neg96.3%
associate-*l*96.8%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in y around inf 49.1%
if -2.02000000000000011e-106 < z < -6.79999999999999978e-307 or 1.7e-89 < z < 1.8199999999999999e-53Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.6%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in x around inf 30.7%
if -6.79999999999999978e-307 < z < 1.7e-89Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*99.9%
associate-*l*98.1%
Simplified98.1%
+-commutative98.1%
associate-+r-98.1%
associate-*r*99.9%
*-commutative99.9%
associate-*l*99.7%
associate-*l*99.7%
associate-*r*99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 46.1%
add-cube-cbrt45.5%
pow345.5%
Applied egg-rr45.5%
rem-cube-cbrt46.1%
associate-*r*46.2%
Applied egg-rr46.2%
if 1.8199999999999999e-53 < z < 1.7000000000000001e-38Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
+-commutative100.0%
associate-+r-100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
associate-*l*100.0%
associate-*r*100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 3.9%
add-cube-cbrt3.9%
pow33.9%
Applied egg-rr3.9%
rem-cube-cbrt3.9%
*-commutative3.9%
associate-*r*3.9%
Applied egg-rr3.9%
Final simplification45.5%
NOTE: x, y, z, t, 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 (* -9.0 (* z (* y t)))))
(if (<= z -4.5e-107)
t_1
(if (<= z -6.2e-307)
(* x 2.0)
(if (<= z 6e-90)
(* b (* a 27.0))
(if (<= z 1.8e-55)
(* x 2.0)
(if (<= z 9.5e-39) (* a (* 27.0 b)) t_1)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (z * (y * t));
double tmp;
if (z <= -4.5e-107) {
tmp = t_1;
} else if (z <= -6.2e-307) {
tmp = x * 2.0;
} else if (z <= 6e-90) {
tmp = b * (a * 27.0);
} else if (z <= 1.8e-55) {
tmp = x * 2.0;
} else if (z <= 9.5e-39) {
tmp = a * (27.0 * b);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, 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 = (-9.0d0) * (z * (y * t))
if (z <= (-4.5d-107)) then
tmp = t_1
else if (z <= (-6.2d-307)) then
tmp = x * 2.0d0
else if (z <= 6d-90) then
tmp = b * (a * 27.0d0)
else if (z <= 1.8d-55) then
tmp = x * 2.0d0
else if (z <= 9.5d-39) then
tmp = a * (27.0d0 * b)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (z * (y * t));
double tmp;
if (z <= -4.5e-107) {
tmp = t_1;
} else if (z <= -6.2e-307) {
tmp = x * 2.0;
} else if (z <= 6e-90) {
tmp = b * (a * 27.0);
} else if (z <= 1.8e-55) {
tmp = x * 2.0;
} else if (z <= 9.5e-39) {
tmp = a * (27.0 * b);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (z * (y * t)) tmp = 0 if z <= -4.5e-107: tmp = t_1 elif z <= -6.2e-307: tmp = x * 2.0 elif z <= 6e-90: tmp = b * (a * 27.0) elif z <= 1.8e-55: tmp = x * 2.0 elif z <= 9.5e-39: tmp = a * (27.0 * b) else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(z * Float64(y * t))) tmp = 0.0 if (z <= -4.5e-107) tmp = t_1; elseif (z <= -6.2e-307) tmp = Float64(x * 2.0); elseif (z <= 6e-90) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= 1.8e-55) tmp = Float64(x * 2.0); elseif (z <= 9.5e-39) tmp = Float64(a * Float64(27.0 * b)); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (z * (y * t));
tmp = 0.0;
if (z <= -4.5e-107)
tmp = t_1;
elseif (z <= -6.2e-307)
tmp = x * 2.0;
elseif (z <= 6e-90)
tmp = b * (a * 27.0);
elseif (z <= 1.8e-55)
tmp = x * 2.0;
elseif (z <= 9.5e-39)
tmp = a * (27.0 * b);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, 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[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e-107], t$95$1, If[LessEqual[z, -6.2e-307], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 6e-90], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-55], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 9.5e-39], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-307}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-90}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-55}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-39}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.50000000000000016e-107 or 9.4999999999999999e-39 < z Initial program 96.3%
sub-neg96.3%
sub-neg96.3%
associate-*l*96.8%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in x around 0 74.5%
expm1-log1p-u51.8%
expm1-udef46.8%
*-commutative46.8%
*-commutative46.8%
associate-*l*48.1%
Applied egg-rr48.1%
expm1-def51.9%
expm1-log1p75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in a around 0 49.1%
associate-*r*49.9%
*-commutative49.9%
Simplified49.9%
if -4.50000000000000016e-107 < z < -6.1999999999999996e-307 or 6.00000000000000041e-90 < z < 1.8e-55Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.6%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in x around inf 32.5%
if -6.1999999999999996e-307 < z < 6.00000000000000041e-90Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*99.9%
associate-*l*98.1%
Simplified98.1%
+-commutative98.1%
associate-+r-98.1%
associate-*r*99.9%
*-commutative99.9%
associate-*l*99.7%
associate-*l*99.7%
associate-*r*99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 46.9%
add-cube-cbrt46.3%
pow346.3%
Applied egg-rr46.3%
rem-cube-cbrt46.9%
associate-*r*47.0%
Applied egg-rr47.0%
if 1.8e-55 < z < 9.4999999999999999e-39Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
+-commutative100.0%
associate-+r-100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
associate-*l*100.0%
associate-*r*100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 3.9%
add-cube-cbrt3.9%
pow33.9%
Applied egg-rr3.9%
rem-cube-cbrt3.9%
*-commutative3.9%
associate-*r*3.9%
Applied egg-rr3.9%
Final simplification46.4%
NOTE: x, y, z, t, 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)) (* x 2.0))) (t_2 (* -9.0 (* z (* y t)))))
(if (<= z -6.8e-100)
t_2
(if (<= z 2.1e-38)
t_1
(if (<= z 1.8e-22)
(* y (* -9.0 (* z t)))
(if (<= z 1.9e+27) t_1 t_2))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (27.0 * (a * b)) + (x * 2.0);
double t_2 = -9.0 * (z * (y * t));
double tmp;
if (z <= -6.8e-100) {
tmp = t_2;
} else if (z <= 2.1e-38) {
tmp = t_1;
} else if (z <= 1.8e-22) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 1.9e+27) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, 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 = (27.0d0 * (a * b)) + (x * 2.0d0)
t_2 = (-9.0d0) * (z * (y * t))
if (z <= (-6.8d-100)) then
tmp = t_2
else if (z <= 2.1d-38) then
tmp = t_1
else if (z <= 1.8d-22) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 1.9d+27) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && 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)) + (x * 2.0);
double t_2 = -9.0 * (z * (y * t));
double tmp;
if (z <= -6.8e-100) {
tmp = t_2;
} else if (z <= 2.1e-38) {
tmp = t_1;
} else if (z <= 1.8e-22) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 1.9e+27) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (27.0 * (a * b)) + (x * 2.0) t_2 = -9.0 * (z * (y * t)) tmp = 0 if z <= -6.8e-100: tmp = t_2 elif z <= 2.1e-38: tmp = t_1 elif z <= 1.8e-22: tmp = y * (-9.0 * (z * t)) elif z <= 1.9e+27: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)) t_2 = Float64(-9.0 * Float64(z * Float64(y * t))) tmp = 0.0 if (z <= -6.8e-100) tmp = t_2; elseif (z <= 2.1e-38) tmp = t_1; elseif (z <= 1.8e-22) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 1.9e+27) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (27.0 * (a * b)) + (x * 2.0);
t_2 = -9.0 * (z * (y * t));
tmp = 0.0;
if (z <= -6.8e-100)
tmp = t_2;
elseif (z <= 2.1e-38)
tmp = t_1;
elseif (z <= 1.8e-22)
tmp = y * (-9.0 * (z * t));
elseif (z <= 1.9e+27)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, 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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e-100], t$95$2, If[LessEqual[z, 2.1e-38], t$95$1, If[LessEqual[z, 1.8e-22], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+27], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right) + x \cdot 2\\
t_2 := -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{-100}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-22}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -6.79999999999999953e-100 or 1.90000000000000011e27 < z Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*96.4%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around 0 74.8%
expm1-log1p-u53.7%
expm1-udef48.0%
*-commutative48.0%
*-commutative48.0%
associate-*l*49.5%
Applied egg-rr49.5%
expm1-def53.9%
expm1-log1p75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in a around 0 51.7%
associate-*r*52.6%
*-commutative52.6%
Simplified52.6%
if -6.79999999999999953e-100 < z < 2.10000000000000013e-38 or 1.7999999999999999e-22 < z < 1.90000000000000011e27Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in y around 0 75.2%
if 2.10000000000000013e-38 < z < 1.7999999999999999e-22Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*99.2%
associate-*l*99.2%
Simplified99.2%
+-commutative99.2%
associate-+r-99.2%
associate-*r*99.2%
*-commutative99.2%
associate-*l*99.2%
associate-*l*100.0%
associate-*r*100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 11.9%
*-commutative11.9%
associate-*r*11.9%
*-commutative11.9%
associate-*l*11.9%
metadata-eval11.9%
distribute-lft-neg-in11.9%
*-commutative11.9%
*-commutative11.9%
associate-*r*11.9%
distribute-lft-neg-in11.9%
*-commutative11.9%
distribute-rgt-neg-in11.9%
metadata-eval11.9%
Simplified11.9%
Taylor expanded in t around 0 11.9%
Final simplification62.2%
NOTE: x, y, z, t, 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 (* -9.0 (* z (* y t)))))
(if (<= z -7.2e-100)
t_1
(if (<= z 2.4e-38)
(+ (* 27.0 (* a b)) (* x 2.0))
(if (<= z 1.1e-22)
(* y (* -9.0 (* z t)))
(if (<= z 9.5e+26) (+ (* a (* 27.0 b)) (* x 2.0)) t_1))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (z * (y * t));
double tmp;
if (z <= -7.2e-100) {
tmp = t_1;
} else if (z <= 2.4e-38) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else if (z <= 1.1e-22) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 9.5e+26) {
tmp = (a * (27.0 * b)) + (x * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, 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 = (-9.0d0) * (z * (y * t))
if (z <= (-7.2d-100)) then
tmp = t_1
else if (z <= 2.4d-38) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else if (z <= 1.1d-22) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 9.5d+26) then
tmp = (a * (27.0d0 * b)) + (x * 2.0d0)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (z * (y * t));
double tmp;
if (z <= -7.2e-100) {
tmp = t_1;
} else if (z <= 2.4e-38) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else if (z <= 1.1e-22) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 9.5e+26) {
tmp = (a * (27.0 * b)) + (x * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (z * (y * t)) tmp = 0 if z <= -7.2e-100: tmp = t_1 elif z <= 2.4e-38: tmp = (27.0 * (a * b)) + (x * 2.0) elif z <= 1.1e-22: tmp = y * (-9.0 * (z * t)) elif z <= 9.5e+26: tmp = (a * (27.0 * b)) + (x * 2.0) else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(z * Float64(y * t))) tmp = 0.0 if (z <= -7.2e-100) tmp = t_1; elseif (z <= 2.4e-38) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); elseif (z <= 1.1e-22) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 9.5e+26) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(x * 2.0)); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (z * (y * t));
tmp = 0.0;
if (z <= -7.2e-100)
tmp = t_1;
elseif (z <= 2.4e-38)
tmp = (27.0 * (a * b)) + (x * 2.0);
elseif (z <= 1.1e-22)
tmp = y * (-9.0 * (z * t));
elseif (z <= 9.5e+26)
tmp = (a * (27.0 * b)) + (x * 2.0);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, 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[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e-100], t$95$1, If[LessEqual[z, 2.4e-38], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-22], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+26], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{-100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-38}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-22}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+26}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -7.1999999999999997e-100 or 9.50000000000000054e26 < z Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*96.4%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around 0 74.8%
expm1-log1p-u53.7%
expm1-udef48.0%
*-commutative48.0%
*-commutative48.0%
associate-*l*49.5%
Applied egg-rr49.5%
expm1-def53.9%
expm1-log1p75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in a around 0 51.7%
associate-*r*52.6%
*-commutative52.6%
Simplified52.6%
if -7.1999999999999997e-100 < z < 2.40000000000000022e-38Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in y around 0 77.2%
if 2.40000000000000022e-38 < z < 1.1e-22Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*99.2%
associate-*l*99.2%
Simplified99.2%
+-commutative99.2%
associate-+r-99.2%
associate-*r*99.2%
*-commutative99.2%
associate-*l*99.2%
associate-*l*100.0%
associate-*r*100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 11.9%
*-commutative11.9%
associate-*r*11.9%
*-commutative11.9%
associate-*l*11.9%
metadata-eval11.9%
distribute-lft-neg-in11.9%
*-commutative11.9%
*-commutative11.9%
associate-*r*11.9%
distribute-lft-neg-in11.9%
*-commutative11.9%
distribute-rgt-neg-in11.9%
metadata-eval11.9%
Simplified11.9%
Taylor expanded in t around 0 11.9%
if 1.1e-22 < z < 9.50000000000000054e26Initial program 99.7%
+-commutative99.7%
associate-+r-99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
associate-*r*99.7%
distribute-lft-neg-in99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
associate-+r-99.7%
associate-*l*99.8%
fma-def99.8%
cancel-sign-sub-inv99.8%
fma-def99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
distribute-lft-neg-out99.8%
associate-*r*99.8%
associate-*l*99.7%
Simplified99.7%
Applied egg-rr99.7%
Taylor expanded in t around 0 63.0%
associate-*r*63.0%
*-commutative63.0%
associate-*l*63.1%
Simplified63.1%
Final simplification62.2%
NOTE: x, y, z, t, 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 (* -9.0 (* z (* y t)))))
(if (<= z -7.2e-100)
t_1
(if (<= z 2.5e-38)
(+ (* x 2.0) (* b (* a 27.0)))
(if (<= z 3.8e-22)
(* y (* -9.0 (* z t)))
(if (<= z 8e+27) (+ (* a (* 27.0 b)) (* x 2.0)) t_1))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (z * (y * t));
double tmp;
if (z <= -7.2e-100) {
tmp = t_1;
} else if (z <= 2.5e-38) {
tmp = (x * 2.0) + (b * (a * 27.0));
} else if (z <= 3.8e-22) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 8e+27) {
tmp = (a * (27.0 * b)) + (x * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, 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 = (-9.0d0) * (z * (y * t))
if (z <= (-7.2d-100)) then
tmp = t_1
else if (z <= 2.5d-38) then
tmp = (x * 2.0d0) + (b * (a * 27.0d0))
else if (z <= 3.8d-22) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 8d+27) then
tmp = (a * (27.0d0 * b)) + (x * 2.0d0)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (z * (y * t));
double tmp;
if (z <= -7.2e-100) {
tmp = t_1;
} else if (z <= 2.5e-38) {
tmp = (x * 2.0) + (b * (a * 27.0));
} else if (z <= 3.8e-22) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 8e+27) {
tmp = (a * (27.0 * b)) + (x * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (z * (y * t)) tmp = 0 if z <= -7.2e-100: tmp = t_1 elif z <= 2.5e-38: tmp = (x * 2.0) + (b * (a * 27.0)) elif z <= 3.8e-22: tmp = y * (-9.0 * (z * t)) elif z <= 8e+27: tmp = (a * (27.0 * b)) + (x * 2.0) else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(z * Float64(y * t))) tmp = 0.0 if (z <= -7.2e-100) tmp = t_1; elseif (z <= 2.5e-38) tmp = Float64(Float64(x * 2.0) + Float64(b * Float64(a * 27.0))); elseif (z <= 3.8e-22) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 8e+27) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(x * 2.0)); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (z * (y * t));
tmp = 0.0;
if (z <= -7.2e-100)
tmp = t_1;
elseif (z <= 2.5e-38)
tmp = (x * 2.0) + (b * (a * 27.0));
elseif (z <= 3.8e-22)
tmp = y * (-9.0 * (z * t));
elseif (z <= 8e+27)
tmp = (a * (27.0 * b)) + (x * 2.0);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, 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[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e-100], t$95$1, If[LessEqual[z, 2.5e-38], N[(N[(x * 2.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-22], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+27], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{-100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-38}:\\
\;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-22}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+27}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -7.1999999999999997e-100 or 8.0000000000000001e27 < z Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*96.4%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around 0 74.8%
expm1-log1p-u53.7%
expm1-udef48.0%
*-commutative48.0%
*-commutative48.0%
associate-*l*49.5%
Applied egg-rr49.5%
expm1-def53.9%
expm1-log1p75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in a around 0 51.7%
associate-*r*52.6%
*-commutative52.6%
Simplified52.6%
if -7.1999999999999997e-100 < z < 2.50000000000000017e-38Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*89.2%
distribute-lft-neg-in89.2%
*-commutative89.2%
cancel-sign-sub-inv89.2%
associate-+r-89.2%
associate-*l*88.1%
fma-def88.2%
cancel-sign-sub-inv88.2%
fma-def88.2%
*-commutative88.2%
distribute-rgt-neg-in88.2%
distribute-lft-neg-out88.2%
associate-*r*98.8%
associate-*l*98.8%
Simplified98.8%
Applied egg-rr99.7%
Taylor expanded in t around 0 77.2%
associate-*r*77.3%
*-commutative77.3%
Simplified77.3%
if 2.50000000000000017e-38 < z < 3.80000000000000023e-22Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*99.2%
associate-*l*99.2%
Simplified99.2%
+-commutative99.2%
associate-+r-99.2%
associate-*r*99.2%
*-commutative99.2%
associate-*l*99.2%
associate-*l*100.0%
associate-*r*100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 11.9%
*-commutative11.9%
associate-*r*11.9%
*-commutative11.9%
associate-*l*11.9%
metadata-eval11.9%
distribute-lft-neg-in11.9%
*-commutative11.9%
*-commutative11.9%
associate-*r*11.9%
distribute-lft-neg-in11.9%
*-commutative11.9%
distribute-rgt-neg-in11.9%
metadata-eval11.9%
Simplified11.9%
Taylor expanded in t around 0 11.9%
if 3.80000000000000023e-22 < z < 8.0000000000000001e27Initial program 99.7%
+-commutative99.7%
associate-+r-99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
associate-*r*99.7%
distribute-lft-neg-in99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
associate-+r-99.7%
associate-*l*99.8%
fma-def99.8%
cancel-sign-sub-inv99.8%
fma-def99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
distribute-lft-neg-out99.8%
associate-*r*99.8%
associate-*l*99.7%
Simplified99.7%
Applied egg-rr99.7%
Taylor expanded in t around 0 63.0%
associate-*r*63.0%
*-commutative63.0%
associate-*l*63.1%
Simplified63.1%
Final simplification62.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -7.8e+81)
(* -9.0 (* z (* y t)))
(if (or (<= z -2.15e-100) (not (<= z 5.2e-39)))
(- (* x 2.0) (* 9.0 (* t (* z y))))
(+ (* x 2.0) (* b (* a 27.0))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.8e+81) {
tmp = -9.0 * (z * (y * t));
} else if ((z <= -2.15e-100) || !(z <= 5.2e-39)) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, 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 <= (-7.8d+81)) then
tmp = (-9.0d0) * (z * (y * t))
else if ((z <= (-2.15d-100)) .or. (.not. (z <= 5.2d-39))) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
else
tmp = (x * 2.0d0) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.8e+81) {
tmp = -9.0 * (z * (y * t));
} else if ((z <= -2.15e-100) || !(z <= 5.2e-39)) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -7.8e+81: tmp = -9.0 * (z * (y * t)) elif (z <= -2.15e-100) or not (z <= 5.2e-39): tmp = (x * 2.0) - (9.0 * (t * (z * y))) else: tmp = (x * 2.0) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7.8e+81) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif ((z <= -2.15e-100) || !(z <= 5.2e-39)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); else tmp = Float64(Float64(x * 2.0) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -7.8e+81)
tmp = -9.0 * (z * (y * t));
elseif ((z <= -2.15e-100) || ~((z <= 5.2e-39)))
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
else
tmp = (x * 2.0) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.8e+81], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.15e-100], N[Not[LessEqual[z, 5.2e-39]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+81}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-100} \lor \neg \left(z \leq 5.2 \cdot 10^{-39}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -7.8000000000000002e81Initial program 90.2%
sub-neg90.2%
sub-neg90.2%
associate-*l*90.2%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in x around 0 73.7%
expm1-log1p-u57.9%
expm1-udef54.4%
*-commutative54.4%
*-commutative54.4%
associate-*l*57.6%
Applied egg-rr57.6%
expm1-def59.9%
expm1-log1p78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in a around 0 47.1%
associate-*r*51.7%
*-commutative51.7%
Simplified51.7%
if -7.8000000000000002e81 < z < -2.14999999999999999e-100 or 5.2e-39 < z Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*99.0%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in a around 0 73.1%
if -2.14999999999999999e-100 < z < 5.2e-39Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*89.2%
distribute-lft-neg-in89.2%
*-commutative89.2%
cancel-sign-sub-inv89.2%
associate-+r-89.2%
associate-*l*88.1%
fma-def88.2%
cancel-sign-sub-inv88.2%
fma-def88.2%
*-commutative88.2%
distribute-rgt-neg-in88.2%
distribute-lft-neg-out88.2%
associate-*r*98.8%
associate-*l*98.8%
Simplified98.8%
Applied egg-rr99.7%
Taylor expanded in t around 0 77.2%
associate-*r*77.3%
*-commutative77.3%
Simplified77.3%
Final simplification71.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.5e-100) (not (<= z 1.75e-38))) (- (* x 2.0) (* 9.0 (* z (* y t)))) (+ (* x 2.0) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.5e-100) || !(z <= 1.75e-38)) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else {
tmp = (x * 2.0) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, 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 <= (-2.5d-100)) .or. (.not. (z <= 1.75d-38))) then
tmp = (x * 2.0d0) - (9.0d0 * (z * (y * t)))
else
tmp = (x * 2.0d0) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.5e-100) || !(z <= 1.75e-38)) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else {
tmp = (x * 2.0) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.5e-100) or not (z <= 1.75e-38): tmp = (x * 2.0) - (9.0 * (z * (y * t))) else: tmp = (x * 2.0) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.5e-100) || !(z <= 1.75e-38)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))); else tmp = Float64(Float64(x * 2.0) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z <= -2.5e-100) || ~((z <= 1.75e-38)))
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
else
tmp = (x * 2.0) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.5e-100], N[Not[LessEqual[z, 1.75e-38]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-100} \lor \neg \left(z \leq 1.75 \cdot 10^{-38}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -2.5e-100 or 1.7500000000000001e-38 < z Initial program 96.2%
sub-neg96.2%
sub-neg96.2%
associate-*l*96.8%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in a around 0 70.0%
expm1-log1p-u51.8%
expm1-udef46.8%
*-commutative46.8%
*-commutative46.8%
associate-*l*48.1%
Applied egg-rr46.1%
expm1-def51.9%
expm1-log1p75.7%
*-commutative75.7%
Simplified71.0%
if -2.5e-100 < z < 1.7500000000000001e-38Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*89.2%
distribute-lft-neg-in89.2%
*-commutative89.2%
cancel-sign-sub-inv89.2%
associate-+r-89.2%
associate-*l*88.1%
fma-def88.2%
cancel-sign-sub-inv88.2%
fma-def88.2%
*-commutative88.2%
distribute-rgt-neg-in88.2%
distribute-lft-neg-out88.2%
associate-*r*98.8%
associate-*l*98.8%
Simplified98.8%
Applied egg-rr99.7%
Taylor expanded in t around 0 77.2%
associate-*r*77.3%
*-commutative77.3%
Simplified77.3%
Final simplification73.4%
NOTE: x, y, z, t, 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 (* 9.0 (* z (* y t)))))
(if (<= z -2.55e-105)
(- (* 27.0 (* a b)) t_1)
(if (<= z 3.4e-39) (+ (* x 2.0) (* b (* a 27.0))) (- (* x 2.0) t_1)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 9.0 * (z * (y * t));
double tmp;
if (z <= -2.55e-105) {
tmp = (27.0 * (a * b)) - t_1;
} else if (z <= 3.4e-39) {
tmp = (x * 2.0) + (b * (a * 27.0));
} else {
tmp = (x * 2.0) - t_1;
}
return tmp;
}
NOTE: x, y, z, t, 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 = 9.0d0 * (z * (y * t))
if (z <= (-2.55d-105)) then
tmp = (27.0d0 * (a * b)) - t_1
else if (z <= 3.4d-39) then
tmp = (x * 2.0d0) + (b * (a * 27.0d0))
else
tmp = (x * 2.0d0) - t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 9.0 * (z * (y * t));
double tmp;
if (z <= -2.55e-105) {
tmp = (27.0 * (a * b)) - t_1;
} else if (z <= 3.4e-39) {
tmp = (x * 2.0) + (b * (a * 27.0));
} else {
tmp = (x * 2.0) - t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 9.0 * (z * (y * t)) tmp = 0 if z <= -2.55e-105: tmp = (27.0 * (a * b)) - t_1 elif z <= 3.4e-39: tmp = (x * 2.0) + (b * (a * 27.0)) else: tmp = (x * 2.0) - t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(9.0 * Float64(z * Float64(y * t))) tmp = 0.0 if (z <= -2.55e-105) tmp = Float64(Float64(27.0 * Float64(a * b)) - t_1); elseif (z <= 3.4e-39) tmp = Float64(Float64(x * 2.0) + Float64(b * Float64(a * 27.0))); else tmp = Float64(Float64(x * 2.0) - t_1); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 9.0 * (z * (y * t));
tmp = 0.0;
if (z <= -2.55e-105)
tmp = (27.0 * (a * b)) - t_1;
elseif (z <= 3.4e-39)
tmp = (x * 2.0) + (b * (a * 27.0));
else
tmp = (x * 2.0) - t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, 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[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.55e-105], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, 3.4e-39], N[(N[(x * 2.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;z \leq -2.55 \cdot 10^{-105}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t_1\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-39}:\\
\;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t_1\\
\end{array}
\end{array}
if z < -2.55000000000000004e-105Initial program 95.4%
sub-neg95.4%
sub-neg95.4%
associate-*l*95.3%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in x around 0 72.2%
expm1-log1p-u55.4%
expm1-udef50.5%
*-commutative50.5%
*-commutative50.5%
associate-*l*52.0%
Applied egg-rr52.0%
expm1-def56.3%
expm1-log1p73.2%
*-commutative73.2%
Simplified73.2%
if -2.55000000000000004e-105 < z < 3.3999999999999999e-39Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*89.0%
distribute-lft-neg-in89.0%
*-commutative89.0%
cancel-sign-sub-inv89.0%
associate-+r-89.0%
associate-*l*88.0%
fma-def88.0%
cancel-sign-sub-inv88.0%
fma-def88.0%
*-commutative88.0%
distribute-rgt-neg-in88.0%
distribute-lft-neg-out88.0%
associate-*r*98.8%
associate-*l*98.8%
Simplified98.8%
Applied egg-rr99.7%
Taylor expanded in t around 0 77.0%
associate-*r*77.1%
*-commutative77.1%
Simplified77.1%
if 3.3999999999999999e-39 < z Initial program 97.3%
sub-neg97.3%
sub-neg97.3%
associate-*l*98.5%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in a around 0 74.4%
expm1-log1p-u46.9%
expm1-udef41.7%
*-commutative41.7%
*-commutative41.7%
associate-*l*42.9%
Applied egg-rr43.8%
expm1-def46.2%
expm1-log1p77.6%
*-commutative77.6%
Simplified75.1%
Final simplification75.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.8e-40) (not (<= b 1.62e+90))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.8e-40) || !(b <= 1.62e+90)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, 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 ((b <= (-2.8d-40)) .or. (.not. (b <= 1.62d+90))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.8e-40) || !(b <= 1.62e+90)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.8e-40) or not (b <= 1.62e+90): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.8e-40) || !(b <= 1.62e+90)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -2.8e-40) || ~((b <= 1.62e+90)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.8e-40], N[Not[LessEqual[b, 1.62e+90]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.8 \cdot 10^{-40} \lor \neg \left(b \leq 1.62 \cdot 10^{+90}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -2.8e-40 or 1.62e90 < b Initial program 96.7%
sub-neg96.7%
sub-neg96.7%
associate-*l*96.7%
associate-*l*95.2%
Simplified95.2%
+-commutative95.2%
associate-+r-95.2%
associate-*r*96.7%
*-commutative96.7%
associate-*l*96.8%
associate-*l*96.7%
associate-*r*96.8%
Applied egg-rr96.8%
Taylor expanded in a around inf 51.8%
if -2.8e-40 < b < 1.62e90Initial program 98.4%
sub-neg98.4%
sub-neg98.4%
associate-*l*99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around inf 34.5%
Final simplification43.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.14e-39) (not (<= b 3.5e+90))) (* b (* a 27.0)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.14e-39) || !(b <= 3.5e+90)) {
tmp = b * (a * 27.0);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, 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 ((b <= (-1.14d-39)) .or. (.not. (b <= 3.5d+90))) then
tmp = b * (a * 27.0d0)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.14e-39) || !(b <= 3.5e+90)) {
tmp = b * (a * 27.0);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.14e-39) or not (b <= 3.5e+90): tmp = b * (a * 27.0) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.14e-39) || !(b <= 3.5e+90)) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -1.14e-39) || ~((b <= 3.5e+90)))
tmp = b * (a * 27.0);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.14e-39], N[Not[LessEqual[b, 3.5e+90]], $MachinePrecision]], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.14 \cdot 10^{-39} \lor \neg \left(b \leq 3.5 \cdot 10^{+90}\right):\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -1.13999999999999997e-39 or 3.4999999999999998e90 < b Initial program 96.7%
sub-neg96.7%
sub-neg96.7%
associate-*l*96.7%
associate-*l*95.2%
Simplified95.2%
+-commutative95.2%
associate-+r-95.2%
associate-*r*96.7%
*-commutative96.7%
associate-*l*96.8%
associate-*l*96.7%
associate-*r*96.8%
Applied egg-rr96.8%
Taylor expanded in a around inf 51.8%
add-cube-cbrt51.2%
pow351.3%
Applied egg-rr51.3%
rem-cube-cbrt51.8%
associate-*r*51.7%
Applied egg-rr51.7%
if -1.13999999999999997e-39 < b < 3.4999999999999998e90Initial program 98.4%
sub-neg98.4%
sub-neg98.4%
associate-*l*99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around inf 34.5%
Final simplification43.1%
NOTE: x, y, z, t, 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(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, 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 x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, 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}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 97.6%
sub-neg97.6%
sub-neg97.6%
associate-*l*97.9%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in x around inf 28.6%
Final simplification28.6%
(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 2023332
(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)))