
(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 14 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.
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 (* (* y 9.0) z)))
(if (<= t_1 1e+308)
(+ (- (* x 2.0) (* t_1 t)) (* (* a 27.0) b))
(fma (* 27.0 b) a (* z (* t (* y -9.0)))))))assert(x < y && y < z && z < t && t < a && a < b);
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 = (y * 9.0) * z;
double tmp;
if (t_1 <= 1e+308) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = fma((27.0 * b), a, (z * (t * (y * -9.0))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(y * 9.0) * z) tmp = 0.0 if (t_1 <= 1e+308) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t_1 * t)) + Float64(Float64(a * 27.0) * b)); else tmp = fma(Float64(27.0 * b), a, Float64(z * Float64(t * Float64(y * -9.0)))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+308], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * b), $MachinePrecision] * a + N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t\_1 \leq 10^{+308}:\\
\;\;\;\;\left(x \cdot 2 - t\_1 \cdot t\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(27 \cdot b, a, z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 1e308Initial program 96.8%
if 1e308 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 84.1%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6484.1%
Simplified84.1%
+-rgt-identityN/A
+-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6484.1%
Applied egg-rr84.1%
+-rgt-identityN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
Final simplification96.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 (* (* a 27.0) b)))
(if (<= t_1 -4e+100)
(* 27.0 (* a b))
(if (<= t_1 2e-222)
(* t (* z (* y -9.0)))
(if (<= t_1 2e+111) (* x 2.0) t_1)))))assert(x < y && y < z && z < t && t < a && a < b);
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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -4e+100) {
tmp = 27.0 * (a * b);
} else if (t_1 <= 2e-222) {
tmp = t * (z * (y * -9.0));
} else if (t_1 <= 2e+111) {
tmp = 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.
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 = (a * 27.0d0) * b
if (t_1 <= (-4d+100)) then
tmp = 27.0d0 * (a * b)
else if (t_1 <= 2d-222) then
tmp = t * (z * (y * (-9.0d0)))
else if (t_1 <= 2d+111) then
tmp = x * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -4e+100) {
tmp = 27.0 * (a * b);
} else if (t_1 <= 2e-222) {
tmp = t * (z * (y * -9.0));
} else if (t_1 <= 2e+111) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (a * 27.0) * b tmp = 0 if t_1 <= -4e+100: tmp = 27.0 * (a * b) elif t_1 <= 2e-222: tmp = t * (z * (y * -9.0)) elif t_1 <= 2e+111: tmp = x * 2.0 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(a * 27.0) * b) tmp = 0.0 if (t_1 <= -4e+100) tmp = Float64(27.0 * Float64(a * b)); elseif (t_1 <= 2e-222) tmp = Float64(t * Float64(z * Float64(y * -9.0))); elseif (t_1 <= 2e+111) tmp = 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])){:}
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 = (a * 27.0) * b;
tmp = 0.0;
if (t_1 <= -4e+100)
tmp = 27.0 * (a * b);
elseif (t_1 <= 2e-222)
tmp = t * (z * (y * -9.0));
elseif (t_1 <= 2e+111)
tmp = 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.
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[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+100], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-222], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+111], N[(x * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+100}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-222}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+111}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -4.00000000000000006e100Initial program 97.4%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.4%
Applied egg-rr97.4%
Taylor expanded in a around inf
*-lowering-*.f64N/A
*-lowering-*.f6485.4%
Simplified85.4%
if -4.00000000000000006e100 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 2.0000000000000001e-222Initial program 97.1%
Taylor expanded in y around inf
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6452.0%
Simplified52.0%
+-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
+-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6448.8%
Applied egg-rr48.8%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6452.1%
Applied egg-rr52.1%
if 2.0000000000000001e-222 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 1.99999999999999991e111Initial program 98.1%
Taylor expanded in x around inf
+-rgt-identityN/A
accelerator-lowering-fma.f6452.9%
Simplified52.9%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6452.9%
Applied egg-rr52.9%
if 1.99999999999999991e111 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 88.1%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6488.0%
Applied egg-rr88.0%
Taylor expanded in a around inf
*-lowering-*.f64N/A
*-lowering-*.f6464.8%
Simplified64.8%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6464.7%
Applied egg-rr64.7%
Final simplification59.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 (* (* a 27.0) b)))
(if (<= t_1 -4e+100)
(* 27.0 (* a b))
(if (<= t_1 2e-222)
(* -9.0 (* t (* y z)))
(if (<= t_1 2e+111) (* x 2.0) t_1)))))assert(x < y && y < z && z < t && t < a && a < b);
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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -4e+100) {
tmp = 27.0 * (a * b);
} else if (t_1 <= 2e-222) {
tmp = -9.0 * (t * (y * z));
} else if (t_1 <= 2e+111) {
tmp = 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.
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 = (a * 27.0d0) * b
if (t_1 <= (-4d+100)) then
tmp = 27.0d0 * (a * b)
else if (t_1 <= 2d-222) then
tmp = (-9.0d0) * (t * (y * z))
else if (t_1 <= 2d+111) then
tmp = x * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -4e+100) {
tmp = 27.0 * (a * b);
} else if (t_1 <= 2e-222) {
tmp = -9.0 * (t * (y * z));
} else if (t_1 <= 2e+111) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (a * 27.0) * b tmp = 0 if t_1 <= -4e+100: tmp = 27.0 * (a * b) elif t_1 <= 2e-222: tmp = -9.0 * (t * (y * z)) elif t_1 <= 2e+111: tmp = x * 2.0 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(a * 27.0) * b) tmp = 0.0 if (t_1 <= -4e+100) tmp = Float64(27.0 * Float64(a * b)); elseif (t_1 <= 2e-222) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); elseif (t_1 <= 2e+111) tmp = 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])){:}
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 = (a * 27.0) * b;
tmp = 0.0;
if (t_1 <= -4e+100)
tmp = 27.0 * (a * b);
elseif (t_1 <= 2e-222)
tmp = -9.0 * (t * (y * z));
elseif (t_1 <= 2e+111)
tmp = 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.
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[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+100], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-222], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+111], N[(x * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+100}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-222}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+111}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -4.00000000000000006e100Initial program 97.4%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.4%
Applied egg-rr97.4%
Taylor expanded in a around inf
*-lowering-*.f64N/A
*-lowering-*.f6485.4%
Simplified85.4%
if -4.00000000000000006e100 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 2.0000000000000001e-222Initial program 97.1%
Taylor expanded in y around inf
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6452.0%
Simplified52.0%
+-rgt-identityN/A
mul0-rgtN/A
distribute-lft-inN/A
+-rgt-identityN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6452.0%
Applied egg-rr52.0%
if 2.0000000000000001e-222 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 1.99999999999999991e111Initial program 98.1%
Taylor expanded in x around inf
+-rgt-identityN/A
accelerator-lowering-fma.f6452.9%
Simplified52.9%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6452.9%
Applied egg-rr52.9%
if 1.99999999999999991e111 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 88.1%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6488.0%
Applied egg-rr88.0%
Taylor expanded in a around inf
*-lowering-*.f64N/A
*-lowering-*.f6464.8%
Simplified64.8%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6464.7%
Applied egg-rr64.7%
Final simplification58.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 (* (* a 27.0) b)))
(if (<= t_1 -1e+41)
(fma (* z (* t -9.0)) y (fma 27.0 (* a b) 0.0))
(if (<= t_1 2e+89)
(fma (* y (* z -9.0)) t (* x 2.0))
(fma (* 27.0 b) a (* z (* t (* y -9.0))))))))assert(x < y && y < z && z < t && t < a && a < b);
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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -1e+41) {
tmp = fma((z * (t * -9.0)), y, fma(27.0, (a * b), 0.0));
} else if (t_1 <= 2e+89) {
tmp = fma((y * (z * -9.0)), t, (x * 2.0));
} else {
tmp = fma((27.0 * b), a, (z * (t * (y * -9.0))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(a * 27.0) * b) tmp = 0.0 if (t_1 <= -1e+41) tmp = fma(Float64(z * Float64(t * -9.0)), y, fma(27.0, Float64(a * b), 0.0)); elseif (t_1 <= 2e+89) tmp = fma(Float64(y * Float64(z * -9.0)), t, Float64(x * 2.0)); else tmp = fma(Float64(27.0 * b), a, Float64(z * Float64(t * Float64(y * -9.0)))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+41], N[(N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision] * y + N[(27.0 * N[(a * b), $MachinePrecision] + 0.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+89], N[(N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision] * t + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * b), $MachinePrecision] * a + N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+41}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot \left(t \cdot -9\right), y, \mathsf{fma}\left(27, a \cdot b, 0\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+89}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(z \cdot -9\right), t, x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(27 \cdot b, a, z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -1.00000000000000001e41Initial program 96.3%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6484.5%
Simplified84.5%
+-rgt-identityN/A
*-commutativeN/A
+-rgt-identityN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6487.9%
Applied egg-rr87.9%
if -1.00000000000000001e41 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 1.99999999999999999e89Initial program 97.7%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.7%
Applied egg-rr97.7%
Taylor expanded in a around 0
*-lowering-*.f6490.7%
Simplified90.7%
if 1.99999999999999999e89 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 89.3%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6480.6%
Simplified80.6%
+-rgt-identityN/A
+-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6486.0%
Applied egg-rr86.0%
+-rgt-identityN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.5%
Applied egg-rr83.5%
Final simplification89.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 (* (* a 27.0) b)))
(if (<= t_1 -1e+41)
(fma (* z t) (* y -9.0) (* 27.0 (* a b)))
(if (<= t_1 2e+89)
(fma (* y (* z -9.0)) t (* x 2.0))
(fma (* 27.0 b) a (* z (* t (* y -9.0))))))))assert(x < y && y < z && z < t && t < a && a < b);
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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -1e+41) {
tmp = fma((z * t), (y * -9.0), (27.0 * (a * b)));
} else if (t_1 <= 2e+89) {
tmp = fma((y * (z * -9.0)), t, (x * 2.0));
} else {
tmp = fma((27.0 * b), a, (z * (t * (y * -9.0))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(a * 27.0) * b) tmp = 0.0 if (t_1 <= -1e+41) tmp = fma(Float64(z * t), Float64(y * -9.0), Float64(27.0 * Float64(a * b))); elseif (t_1 <= 2e+89) tmp = fma(Float64(y * Float64(z * -9.0)), t, Float64(x * 2.0)); else tmp = fma(Float64(27.0 * b), a, Float64(z * Float64(t * Float64(y * -9.0)))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+41], N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+89], N[(N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision] * t + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * b), $MachinePrecision] * a + N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+41}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot t, y \cdot -9, 27 \cdot \left(a \cdot b\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+89}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(z \cdot -9\right), t, x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(27 \cdot b, a, z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -1.00000000000000001e41Initial program 96.3%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6499.8%
Applied egg-rr99.8%
Taylor expanded in a around inf
*-lowering-*.f64N/A
*-lowering-*.f6487.8%
Simplified87.8%
if -1.00000000000000001e41 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 1.99999999999999999e89Initial program 97.7%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.7%
Applied egg-rr97.7%
Taylor expanded in a around 0
*-lowering-*.f6490.7%
Simplified90.7%
if 1.99999999999999999e89 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 89.3%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6480.6%
Simplified80.6%
+-rgt-identityN/A
+-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6486.0%
Applied egg-rr86.0%
+-rgt-identityN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.5%
Applied egg-rr83.5%
Final simplification89.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 (* (* a 27.0) b)))
(if (<= t_1 -4e+100)
(fma 27.0 (* a b) (* x 2.0))
(if (<= t_1 2e+89)
(fma (* y (* z -9.0)) t (* x 2.0))
(fma (* 27.0 b) a (* z (* t (* y -9.0))))))))assert(x < y && y < z && z < t && t < a && a < b);
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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -4e+100) {
tmp = fma(27.0, (a * b), (x * 2.0));
} else if (t_1 <= 2e+89) {
tmp = fma((y * (z * -9.0)), t, (x * 2.0));
} else {
tmp = fma((27.0 * b), a, (z * (t * (y * -9.0))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(a * 27.0) * b) tmp = 0.0 if (t_1 <= -4e+100) tmp = fma(27.0, Float64(a * b), Float64(x * 2.0)); elseif (t_1 <= 2e+89) tmp = fma(Float64(y * Float64(z * -9.0)), t, Float64(x * 2.0)); else tmp = fma(Float64(27.0 * b), a, Float64(z * Float64(t * Float64(y * -9.0)))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+100], N[(27.0 * N[(a * b), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+89], N[(N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision] * t + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * b), $MachinePrecision] * a + N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+100}:\\
\;\;\;\;\mathsf{fma}\left(27, a \cdot b, x \cdot 2\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+89}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(z \cdot -9\right), t, x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(27 \cdot b, a, z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -4.00000000000000006e100Initial program 97.4%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.4%
Applied egg-rr97.4%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6492.7%
Simplified92.7%
if -4.00000000000000006e100 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 1.99999999999999999e89Initial program 97.4%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.3%
Applied egg-rr97.3%
Taylor expanded in a around 0
*-lowering-*.f6488.1%
Simplified88.1%
if 1.99999999999999999e89 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 89.3%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6480.6%
Simplified80.6%
+-rgt-identityN/A
+-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6486.0%
Applied egg-rr86.0%
+-rgt-identityN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.5%
Applied egg-rr83.5%
Final simplification88.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 (* (* a 27.0) b)))
(if (<= t_1 -4e+100)
(fma 27.0 (* a b) (* x 2.0))
(if (<= t_1 2e+89)
(fma (* y (* z -9.0)) t (* x 2.0))
(fma 27.0 (* a b) (* (* t -9.0) (* y z)))))))assert(x < y && y < z && z < t && t < a && a < b);
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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -4e+100) {
tmp = fma(27.0, (a * b), (x * 2.0));
} else if (t_1 <= 2e+89) {
tmp = fma((y * (z * -9.0)), t, (x * 2.0));
} else {
tmp = fma(27.0, (a * b), ((t * -9.0) * (y * z)));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(a * 27.0) * b) tmp = 0.0 if (t_1 <= -4e+100) tmp = fma(27.0, Float64(a * b), Float64(x * 2.0)); elseif (t_1 <= 2e+89) tmp = fma(Float64(y * Float64(z * -9.0)), t, Float64(x * 2.0)); else tmp = fma(27.0, Float64(a * b), Float64(Float64(t * -9.0) * Float64(y * z))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+100], N[(27.0 * N[(a * b), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+89], N[(N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision] * t + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision] + N[(N[(t * -9.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+100}:\\
\;\;\;\;\mathsf{fma}\left(27, a \cdot b, x \cdot 2\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+89}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(z \cdot -9\right), t, x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(27, a \cdot b, \left(t \cdot -9\right) \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -4.00000000000000006e100Initial program 97.4%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.4%
Applied egg-rr97.4%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6492.7%
Simplified92.7%
if -4.00000000000000006e100 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 1.99999999999999999e89Initial program 97.4%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.3%
Applied egg-rr97.3%
Taylor expanded in a around 0
*-lowering-*.f6488.1%
Simplified88.1%
if 1.99999999999999999e89 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 89.3%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6489.2%
Applied egg-rr89.2%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6480.6%
Simplified80.6%
Final simplification87.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 (* (* a 27.0) b)))
(if (<= t_1 -4e+100)
(fma 27.0 (* a b) (* x 2.0))
(if (<= t_1 2e+111)
(fma (* y (* z -9.0)) t (* x 2.0))
(fma (* a 27.0) b (fma x 2.0 0.0))))))assert(x < y && y < z && z < t && t < a && a < b);
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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -4e+100) {
tmp = fma(27.0, (a * b), (x * 2.0));
} else if (t_1 <= 2e+111) {
tmp = fma((y * (z * -9.0)), t, (x * 2.0));
} else {
tmp = fma((a * 27.0), b, fma(x, 2.0, 0.0));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(a * 27.0) * b) tmp = 0.0 if (t_1 <= -4e+100) tmp = fma(27.0, Float64(a * b), Float64(x * 2.0)); elseif (t_1 <= 2e+111) tmp = fma(Float64(y * Float64(z * -9.0)), t, Float64(x * 2.0)); else tmp = fma(Float64(a * 27.0), b, fma(x, 2.0, 0.0)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+100], N[(27.0 * N[(a * b), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+111], N[(N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision] * t + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(a * 27.0), $MachinePrecision] * b + N[(x * 2.0 + 0.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+100}:\\
\;\;\;\;\mathsf{fma}\left(27, a \cdot b, x \cdot 2\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+111}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(z \cdot -9\right), t, x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot 27, b, \mathsf{fma}\left(x, 2, 0\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -4.00000000000000006e100Initial program 97.4%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.4%
Applied egg-rr97.4%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6492.7%
Simplified92.7%
if -4.00000000000000006e100 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 1.99999999999999991e111Initial program 97.4%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.4%
Applied egg-rr97.4%
Taylor expanded in a around 0
*-lowering-*.f6487.9%
Simplified87.9%
if 1.99999999999999991e111 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 88.1%
Taylor expanded in x around inf
+-rgt-identityN/A
accelerator-lowering-fma.f6476.8%
Simplified76.8%
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
accelerator-lowering-fma.f6476.8%
Applied egg-rr76.8%
Final simplification87.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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 (* (* a 27.0) b))) (if (<= t_1 -1e+41) (* 27.0 (* a b)) (if (<= t_1 2e+111) (* x 2.0) t_1))))
assert(x < y && y < z && z < t && t < a && a < b);
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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -1e+41) {
tmp = 27.0 * (a * b);
} else if (t_1 <= 2e+111) {
tmp = 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.
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 = (a * 27.0d0) * b
if (t_1 <= (-1d+41)) then
tmp = 27.0d0 * (a * b)
else if (t_1 <= 2d+111) then
tmp = x * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -1e+41) {
tmp = 27.0 * (a * b);
} else if (t_1 <= 2e+111) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (a * 27.0) * b tmp = 0 if t_1 <= -1e+41: tmp = 27.0 * (a * b) elif t_1 <= 2e+111: tmp = x * 2.0 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(a * 27.0) * b) tmp = 0.0 if (t_1 <= -1e+41) tmp = Float64(27.0 * Float64(a * b)); elseif (t_1 <= 2e+111) tmp = 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])){:}
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 = (a * 27.0) * b;
tmp = 0.0;
if (t_1 <= -1e+41)
tmp = 27.0 * (a * b);
elseif (t_1 <= 2e+111)
tmp = 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.
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[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+41], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+111], N[(x * 2.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+41}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+111}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -1.00000000000000001e41Initial program 96.3%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.4%
Applied egg-rr96.4%
Taylor expanded in a around inf
*-lowering-*.f64N/A
*-lowering-*.f6467.5%
Simplified67.5%
if -1.00000000000000001e41 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 1.99999999999999991e111Initial program 97.8%
Taylor expanded in x around inf
+-rgt-identityN/A
accelerator-lowering-fma.f6446.4%
Simplified46.4%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6446.4%
Applied egg-rr46.4%
if 1.99999999999999991e111 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 88.1%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6488.0%
Applied egg-rr88.0%
Taylor expanded in a around inf
*-lowering-*.f64N/A
*-lowering-*.f6464.8%
Simplified64.8%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6464.7%
Applied egg-rr64.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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 -5.6e+122) (fma (* 27.0 b) a (* z (* t (* y -9.0)))) (fma (* y (* z -9.0)) t (fma a (* 27.0 b) (* x 2.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
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 <= -5.6e+122) {
tmp = fma((27.0 * b), a, (z * (t * (y * -9.0))));
} else {
tmp = fma((y * (z * -9.0)), t, fma(a, (27.0 * b), (x * 2.0)));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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 <= -5.6e+122) tmp = fma(Float64(27.0 * b), a, Float64(z * Float64(t * Float64(y * -9.0)))); else tmp = fma(Float64(y * Float64(z * -9.0)), t, fma(a, Float64(27.0 * b), Float64(x * 2.0))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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, -5.6e+122], N[(N[(27.0 * b), $MachinePrecision] * a + N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision] * t + N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+122}:\\
\;\;\;\;\mathsf{fma}\left(27 \cdot b, a, z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(z \cdot -9\right), t, \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2\right)\right)\\
\end{array}
\end{array}
if z < -5.5999999999999999e122Initial program 87.5%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6474.5%
Simplified74.5%
+-rgt-identityN/A
+-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6480.8%
Applied egg-rr80.8%
+-rgt-identityN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.8%
Applied egg-rr83.8%
if -5.5999999999999999e122 < z Initial program 97.4%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.4%
Applied egg-rr97.4%
Final simplification95.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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 (<= (* x 2.0) -1e-16) (* x 2.0) (if (<= (* x 2.0) 1000000000.0) (* 27.0 (* a b)) (* x 2.0))))
assert(x < y && y < z && z < t && t < a && a < b);
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 ((x * 2.0) <= -1e-16) {
tmp = x * 2.0;
} else if ((x * 2.0) <= 1000000000.0) {
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.
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 ((x * 2.0d0) <= (-1d-16)) then
tmp = x * 2.0d0
else if ((x * 2.0d0) <= 1000000000.0d0) 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;
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 ((x * 2.0) <= -1e-16) {
tmp = x * 2.0;
} else if ((x * 2.0) <= 1000000000.0) {
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]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (x * 2.0) <= -1e-16: tmp = x * 2.0 elif (x * 2.0) <= 1000000000.0: 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]) 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 (Float64(x * 2.0) <= -1e-16) tmp = Float64(x * 2.0); elseif (Float64(x * 2.0) <= 1000000000.0) 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])){:}
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 ((x * 2.0) <= -1e-16)
tmp = x * 2.0;
elseif ((x * 2.0) <= 1000000000.0)
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. 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[N[(x * 2.0), $MachinePrecision], -1e-16], N[(x * 2.0), $MachinePrecision], If[LessEqual[N[(x * 2.0), $MachinePrecision], 1000000000.0], 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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq -1 \cdot 10^{-16}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \cdot 2 \leq 1000000000:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < -9.9999999999999998e-17 or 1e9 < (*.f64 x #s(literal 2 binary64)) Initial program 97.7%
Taylor expanded in x around inf
+-rgt-identityN/A
accelerator-lowering-fma.f6456.9%
Simplified56.9%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6456.9%
Applied egg-rr56.9%
if -9.9999999999999998e-17 < (*.f64 x #s(literal 2 binary64)) < 1e9Initial program 94.7%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6494.7%
Applied egg-rr94.7%
Taylor expanded in a around inf
*-lowering-*.f64N/A
*-lowering-*.f6444.2%
Simplified44.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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 (fma (* y t) (* z -9.0) (fma a (* 27.0 b) (* x 2.0))))
assert(x < y && y < z && z < t && t < a && a < b);
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 fma((y * t), (z * -9.0), fma(a, (27.0 * b), (x * 2.0)));
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return fma(Float64(y * t), Float64(z * -9.0), fma(a, Float64(27.0 * b), Float64(x * 2.0))) end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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[(N[(y * t), $MachinePrecision] * N[(z * -9.0), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\mathsf{fma}\left(y \cdot t, z \cdot -9, \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2\right)\right)
\end{array}
Initial program 96.2%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.5%
Applied egg-rr93.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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 -1.65e+41) (* (* z -9.0) (* y t)) (if (<= z 3.9e-35) (fma 27.0 (* a b) (* x 2.0)) (* t (* z (* y -9.0))))))
assert(x < y && y < z && z < t && t < a && a < b);
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 <= -1.65e+41) {
tmp = (z * -9.0) * (y * t);
} else if (z <= 3.9e-35) {
tmp = fma(27.0, (a * b), (x * 2.0));
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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 <= -1.65e+41) tmp = Float64(Float64(z * -9.0) * Float64(y * t)); elseif (z <= 3.9e-35) tmp = fma(27.0, Float64(a * b), Float64(x * 2.0)); else tmp = Float64(t * Float64(z * Float64(y * -9.0))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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, -1.65e+41], N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e-35], N[(27.0 * N[(a * b), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+41}:\\
\;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-35}:\\
\;\;\;\;\mathsf{fma}\left(27, a \cdot b, x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.65e41Initial program 93.3%
Taylor expanded in y around inf
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6450.5%
Simplified50.5%
+-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
+-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6451.8%
Applied egg-rr51.8%
if -1.65e41 < z < 3.8999999999999998e-35Initial program 98.6%
sub-negN/A
+-commutativeN/A
associate-+l+N/A
distribute-lft-neg-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6498.5%
Applied egg-rr98.5%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6474.8%
Simplified74.8%
if 3.8999999999999998e-35 < z Initial program 94.6%
Taylor expanded in y around inf
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6450.6%
Simplified50.6%
+-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
+-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6450.5%
Applied egg-rr50.5%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6450.6%
Applied egg-rr50.6%
Final simplification62.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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);
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.
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;
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]) [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]) 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])){:}
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. 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, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 96.2%
Taylor expanded in x around inf
+-rgt-identityN/A
accelerator-lowering-fma.f6435.0%
Simplified35.0%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6435.0%
Applied egg-rr35.0%
(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 2024193
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:alt
(! :herbie-platform default (if (< y 7590524218811189/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x 2) (* (* (* y 9) z) t)) (* a (* 27 b))) (+ (- (* x 2) (* 9 (* y (* t z)))) (* (* a 27) b))))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))