
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: 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 (<= (* y 9.0) -200000000.0) (- (+ (* 27.0 (* b a)) (* x 2.0)) (* y (* (* 9.0 z) t))) (fma (* 27.0 a) b (fma x 2.0 (* (* z -9.0) (* y t))))))
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 ((y * 9.0) <= -200000000.0) {
tmp = ((27.0 * (b * a)) + (x * 2.0)) - (y * ((9.0 * z) * t));
} else {
tmp = fma((27.0 * a), b, fma(x, 2.0, ((z * -9.0) * (y * t))));
}
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(y * 9.0) <= -200000000.0) tmp = Float64(Float64(Float64(27.0 * Float64(b * a)) + Float64(x * 2.0)) - Float64(y * Float64(Float64(9.0 * z) * t))); else tmp = fma(Float64(27.0 * a), b, fma(x, 2.0, Float64(Float64(z * -9.0) * Float64(y * t)))); 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[N[(y * 9.0), $MachinePrecision], -200000000.0], N[(N[(N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(9.0 * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * a), $MachinePrecision] * b + N[(x * 2.0 + N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $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}
\mathbf{if}\;y \cdot 9 \leq -200000000:\\
\;\;\;\;\left(27 \cdot \left(b \cdot a\right) + x \cdot 2\right) - y \cdot \left(\left(9 \cdot z\right) \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(27 \cdot a, b, \mathsf{fma}\left(x, 2, \left(z \cdot -9\right) \cdot \left(y \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -2e8Initial program 90.1%
sub-neg90.1%
sub-neg90.1%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
associate-*l*99.8%
associate-*l*99.8%
associate-*r*99.8%
Applied egg-rr99.8%
if -2e8 < (*.f64 y 9) Initial program 93.5%
sub-neg93.5%
sub-neg93.5%
associate-*l*92.1%
associate-*l*92.1%
Simplified92.1%
+-commutative92.1%
sub-neg92.1%
associate-+r+92.1%
*-commutative92.1%
distribute-rgt-neg-in92.1%
*-commutative92.1%
distribute-lft-neg-in92.1%
metadata-eval92.1%
associate-*l*92.6%
associate-*r*92.6%
*-commutative92.6%
associate-+r+92.6%
associate-*r*92.6%
fma-undefine92.6%
fma-define92.6%
*-commutative92.6%
associate-*r*92.6%
*-commutative92.6%
Applied egg-rr97.4%
Final simplification98.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 (* 27.0 (* b a))))
(if (<= z -1.85e+74)
(* -9.0 (* z (* y t)))
(if (<= z -1.05e-199)
t_1
(if (<= z -3.9e-235)
(* x 2.0)
(if (<= z -1.45e-295)
t_1
(if (<= z 4.7e-263)
(* x 2.0)
(if (<= z 7e-64)
(* a (* 27.0 b))
(if (<= z 3.6) (* x 2.0) (* -9.0 (* t (* 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 = 27.0 * (b * a);
double tmp;
if (z <= -1.85e+74) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -1.05e-199) {
tmp = t_1;
} else if (z <= -3.9e-235) {
tmp = x * 2.0;
} else if (z <= -1.45e-295) {
tmp = t_1;
} else if (z <= 4.7e-263) {
tmp = x * 2.0;
} else if (z <= 7e-64) {
tmp = a * (27.0 * b);
} else if (z <= 3.6) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (y * z));
}
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 = 27.0d0 * (b * a)
if (z <= (-1.85d+74)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= (-1.05d-199)) then
tmp = t_1
else if (z <= (-3.9d-235)) then
tmp = x * 2.0d0
else if (z <= (-1.45d-295)) then
tmp = t_1
else if (z <= 4.7d-263) then
tmp = x * 2.0d0
else if (z <= 7d-64) then
tmp = a * (27.0d0 * b)
else if (z <= 3.6d0) then
tmp = x * 2.0d0
else
tmp = (-9.0d0) * (t * (y * z))
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 = 27.0 * (b * a);
double tmp;
if (z <= -1.85e+74) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -1.05e-199) {
tmp = t_1;
} else if (z <= -3.9e-235) {
tmp = x * 2.0;
} else if (z <= -1.45e-295) {
tmp = t_1;
} else if (z <= 4.7e-263) {
tmp = x * 2.0;
} else if (z <= 7e-64) {
tmp = a * (27.0 * b);
} else if (z <= 3.6) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (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]) def code(x, y, z, t, a, b): t_1 = 27.0 * (b * a) tmp = 0 if z <= -1.85e+74: tmp = -9.0 * (z * (y * t)) elif z <= -1.05e-199: tmp = t_1 elif z <= -3.9e-235: tmp = x * 2.0 elif z <= -1.45e-295: tmp = t_1 elif z <= 4.7e-263: tmp = x * 2.0 elif z <= 7e-64: tmp = a * (27.0 * b) elif z <= 3.6: tmp = x * 2.0 else: tmp = -9.0 * (t * (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(27.0 * Float64(b * a)) tmp = 0.0 if (z <= -1.85e+74) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= -1.05e-199) tmp = t_1; elseif (z <= -3.9e-235) tmp = Float64(x * 2.0); elseif (z <= -1.45e-295) tmp = t_1; elseif (z <= 4.7e-263) tmp = Float64(x * 2.0); elseif (z <= 7e-64) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= 3.6) tmp = Float64(x * 2.0); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); 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 = 27.0 * (b * a);
tmp = 0.0;
if (z <= -1.85e+74)
tmp = -9.0 * (z * (y * t));
elseif (z <= -1.05e-199)
tmp = t_1;
elseif (z <= -3.9e-235)
tmp = x * 2.0;
elseif (z <= -1.45e-295)
tmp = t_1;
elseif (z <= 4.7e-263)
tmp = x * 2.0;
elseif (z <= 7e-64)
tmp = a * (27.0 * b);
elseif (z <= 3.6)
tmp = x * 2.0;
else
tmp = -9.0 * (t * (y * z));
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[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+74], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.05e-199], t$95$1, If[LessEqual[z, -3.9e-235], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.45e-295], t$95$1, If[LessEqual[z, 4.7e-263], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 7e-64], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6], N[(x * 2.0), $MachinePrecision], N[(-9.0 * N[(t * 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 := 27 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+74}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{-235}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-295}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-263}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-64}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 3.6:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.8500000000000001e74Initial program 87.7%
sub-neg87.7%
sub-neg87.7%
associate-*l*91.3%
associate-*l*91.3%
Simplified91.3%
+-commutative91.3%
associate-+r-91.3%
*-commutative91.3%
associate-*l*91.3%
associate-*l*91.3%
associate-*r*91.3%
Applied egg-rr91.3%
Taylor expanded in y around inf 47.4%
associate-*r*52.4%
Simplified52.4%
if -1.8500000000000001e74 < z < -1.05000000000000001e-199 or -3.8999999999999997e-235 < z < -1.45000000000000008e-295Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*98.3%
associate-*l*98.3%
Simplified98.3%
+-commutative98.3%
associate-+r-98.3%
*-commutative98.3%
associate-*l*98.3%
associate-*l*98.3%
associate-*r*98.3%
Applied egg-rr98.3%
Taylor expanded in b around inf 42.3%
if -1.05000000000000001e-199 < z < -3.8999999999999997e-235 or -1.45000000000000008e-295 < z < 4.6999999999999997e-263 or 7.0000000000000006e-64 < z < 3.60000000000000009Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 65.0%
if 4.6999999999999997e-263 < z < 7.0000000000000006e-64Initial program 96.8%
sub-neg96.8%
sub-neg96.8%
associate-*l*96.8%
associate-*l*96.9%
Simplified96.9%
+-commutative96.9%
associate-+r-96.9%
*-commutative96.9%
associate-*l*96.8%
associate-*l*99.7%
associate-*r*99.7%
Applied egg-rr99.7%
Taylor expanded in b around inf 49.1%
*-commutative49.1%
associate-*r*49.2%
Simplified49.2%
if 3.60000000000000009 < z Initial program 87.8%
sub-neg87.8%
sub-neg87.8%
associate-*l*86.5%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in y around inf 52.1%
Final simplification50.8%
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 (* 27.0 (* b a))))
(if (<= z -2.1e-70)
(* y (* -9.0 (* z t)))
(if (<= z -2.5e-199)
t_1
(if (<= z -3.5e-235)
(* x 2.0)
(if (<= z -1.5e-295)
t_1
(if (<= z 1e-263)
(* x 2.0)
(if (<= z 2.75e-58)
(* a (* 27.0 b))
(if (<= z 112000000.0) (* x 2.0) (* -9.0 (* t (* 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 = 27.0 * (b * a);
double tmp;
if (z <= -2.1e-70) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -2.5e-199) {
tmp = t_1;
} else if (z <= -3.5e-235) {
tmp = x * 2.0;
} else if (z <= -1.5e-295) {
tmp = t_1;
} else if (z <= 1e-263) {
tmp = x * 2.0;
} else if (z <= 2.75e-58) {
tmp = a * (27.0 * b);
} else if (z <= 112000000.0) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (y * z));
}
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 = 27.0d0 * (b * a)
if (z <= (-2.1d-70)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= (-2.5d-199)) then
tmp = t_1
else if (z <= (-3.5d-235)) then
tmp = x * 2.0d0
else if (z <= (-1.5d-295)) then
tmp = t_1
else if (z <= 1d-263) then
tmp = x * 2.0d0
else if (z <= 2.75d-58) then
tmp = a * (27.0d0 * b)
else if (z <= 112000000.0d0) then
tmp = x * 2.0d0
else
tmp = (-9.0d0) * (t * (y * z))
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 = 27.0 * (b * a);
double tmp;
if (z <= -2.1e-70) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -2.5e-199) {
tmp = t_1;
} else if (z <= -3.5e-235) {
tmp = x * 2.0;
} else if (z <= -1.5e-295) {
tmp = t_1;
} else if (z <= 1e-263) {
tmp = x * 2.0;
} else if (z <= 2.75e-58) {
tmp = a * (27.0 * b);
} else if (z <= 112000000.0) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (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]) def code(x, y, z, t, a, b): t_1 = 27.0 * (b * a) tmp = 0 if z <= -2.1e-70: tmp = y * (-9.0 * (z * t)) elif z <= -2.5e-199: tmp = t_1 elif z <= -3.5e-235: tmp = x * 2.0 elif z <= -1.5e-295: tmp = t_1 elif z <= 1e-263: tmp = x * 2.0 elif z <= 2.75e-58: tmp = a * (27.0 * b) elif z <= 112000000.0: tmp = x * 2.0 else: tmp = -9.0 * (t * (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(27.0 * Float64(b * a)) tmp = 0.0 if (z <= -2.1e-70) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= -2.5e-199) tmp = t_1; elseif (z <= -3.5e-235) tmp = Float64(x * 2.0); elseif (z <= -1.5e-295) tmp = t_1; elseif (z <= 1e-263) tmp = Float64(x * 2.0); elseif (z <= 2.75e-58) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= 112000000.0) tmp = Float64(x * 2.0); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); 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 = 27.0 * (b * a);
tmp = 0.0;
if (z <= -2.1e-70)
tmp = y * (-9.0 * (z * t));
elseif (z <= -2.5e-199)
tmp = t_1;
elseif (z <= -3.5e-235)
tmp = x * 2.0;
elseif (z <= -1.5e-295)
tmp = t_1;
elseif (z <= 1e-263)
tmp = x * 2.0;
elseif (z <= 2.75e-58)
tmp = a * (27.0 * b);
elseif (z <= 112000000.0)
tmp = x * 2.0;
else
tmp = -9.0 * (t * (y * z));
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[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e-70], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.5e-199], t$95$1, If[LessEqual[z, -3.5e-235], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.5e-295], t$95$1, If[LessEqual[z, 1e-263], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.75e-58], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 112000000.0], N[(x * 2.0), $MachinePrecision], N[(-9.0 * N[(t * 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 := 27 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{-70}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-235}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-295}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{-263}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-58}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 112000000:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -2.1000000000000001e-70Initial program 90.2%
sub-neg90.2%
sub-neg90.2%
associate-*l*92.6%
associate-*l*92.5%
Simplified92.5%
+-commutative92.5%
associate-+r-92.5%
*-commutative92.5%
associate-*l*92.5%
associate-*l*92.4%
associate-*r*92.5%
Applied egg-rr92.5%
Taylor expanded in y around inf 44.2%
*-commutative44.2%
*-commutative44.2%
associate-*r*42.8%
associate-*l*42.8%
*-commutative42.8%
*-commutative42.8%
Simplified42.8%
if -2.1000000000000001e-70 < z < -2.4999999999999998e-199 or -3.4999999999999999e-235 < z < -1.49999999999999998e-295Initial program 95.7%
sub-neg95.7%
sub-neg95.7%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
associate-*l*99.9%
associate-*l*99.8%
associate-*r*99.8%
Applied egg-rr99.8%
Taylor expanded in b around inf 47.5%
if -2.4999999999999998e-199 < z < -3.4999999999999999e-235 or -1.49999999999999998e-295 < z < 1e-263 or 2.74999999999999998e-58 < z < 1.12e8Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 66.8%
if 1e-263 < z < 2.74999999999999998e-58Initial program 96.9%
sub-neg96.9%
sub-neg96.9%
associate-*l*96.9%
associate-*l*97.0%
Simplified97.0%
+-commutative97.0%
associate-+r-97.0%
*-commutative97.0%
associate-*l*96.9%
associate-*l*99.7%
associate-*r*99.7%
Applied egg-rr99.7%
Taylor expanded in b around inf 50.5%
*-commutative50.5%
associate-*r*50.6%
Simplified50.6%
if 1.12e8 < z Initial program 87.8%
sub-neg87.8%
sub-neg87.8%
associate-*l*86.5%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in y around inf 52.1%
Final simplification50.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 (* 27.0 (* b a))))
(if (<= z -1.4e+75)
(- (* x 2.0) (* 9.0 (* z (* y t))))
(if (or (<= z 2.05e-95) (and (not (<= z 1.2e-55)) (<= z 0.00033)))
(+ t_1 (* x 2.0))
(- t_1 (* 9.0 (* t (* 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 = 27.0 * (b * a);
double tmp;
if (z <= -1.4e+75) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else if ((z <= 2.05e-95) || (!(z <= 1.2e-55) && (z <= 0.00033))) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_1 - (9.0 * (t * (y * z)));
}
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 = 27.0d0 * (b * a)
if (z <= (-1.4d+75)) then
tmp = (x * 2.0d0) - (9.0d0 * (z * (y * t)))
else if ((z <= 2.05d-95) .or. (.not. (z <= 1.2d-55)) .and. (z <= 0.00033d0)) then
tmp = t_1 + (x * 2.0d0)
else
tmp = t_1 - (9.0d0 * (t * (y * z)))
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 = 27.0 * (b * a);
double tmp;
if (z <= -1.4e+75) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else if ((z <= 2.05e-95) || (!(z <= 1.2e-55) && (z <= 0.00033))) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_1 - (9.0 * (t * (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]) def code(x, y, z, t, a, b): t_1 = 27.0 * (b * a) tmp = 0 if z <= -1.4e+75: tmp = (x * 2.0) - (9.0 * (z * (y * t))) elif (z <= 2.05e-95) or (not (z <= 1.2e-55) and (z <= 0.00033)): tmp = t_1 + (x * 2.0) else: tmp = t_1 - (9.0 * (t * (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(27.0 * Float64(b * a)) tmp = 0.0 if (z <= -1.4e+75) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))); elseif ((z <= 2.05e-95) || (!(z <= 1.2e-55) && (z <= 0.00033))) tmp = Float64(t_1 + Float64(x * 2.0)); else tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(y * z)))); 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 = 27.0 * (b * a);
tmp = 0.0;
if (z <= -1.4e+75)
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
elseif ((z <= 2.05e-95) || (~((z <= 1.2e-55)) && (z <= 0.00033)))
tmp = t_1 + (x * 2.0);
else
tmp = t_1 - (9.0 * (t * (y * z)));
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[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.4e+75], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 2.05e-95], And[N[Not[LessEqual[z, 1.2e-55]], $MachinePrecision], LessEqual[z, 0.00033]]], N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(9.0 * N[(t * N[(y * z), $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 := 27 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+75}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-95} \lor \neg \left(z \leq 1.2 \cdot 10^{-55}\right) \land z \leq 0.00033:\\
\;\;\;\;t\_1 + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.40000000000000006e75Initial program 87.7%
sub-neg87.7%
sub-neg87.7%
associate-*l*91.3%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in a around 0 66.3%
pow166.3%
*-commutative66.3%
associate-*l*62.9%
Applied egg-rr62.9%
unpow162.9%
associate-*r*66.3%
*-commutative66.3%
associate-*r*71.3%
Simplified71.3%
if -1.40000000000000006e75 < z < 2.0499999999999999e-95 or 1.19999999999999996e-55 < z < 3.3e-4Initial program 96.9%
sub-neg96.9%
sub-neg96.9%
associate-*l*98.2%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in y around 0 85.4%
if 2.0499999999999999e-95 < z < 1.19999999999999996e-55 or 3.3e-4 < z Initial program 89.5%
sub-neg89.5%
sub-neg89.5%
associate-*l*88.5%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in x around 0 70.4%
Final simplification77.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 (if (<= z 8e+70) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (- (* 27.0 (* b a)) (* 9.0 (* t (* 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 tmp;
if (z <= 8e+70) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = (27.0 * (b * a)) - (9.0 * (t * (y * z)));
}
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 (z <= 8d+70) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = (27.0d0 * (b * a)) - (9.0d0 * (t * (y * z)))
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 (z <= 8e+70) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = (27.0 * (b * a)) - (9.0 * (t * (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]) def code(x, y, z, t, a, b): tmp = 0 if z <= 8e+70: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = (27.0 * (b * a)) - (9.0 * (t * (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) tmp = 0.0 if (z <= 8e+70) 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(27.0 * Float64(b * a)) - Float64(9.0 * Float64(t * Float64(y * z)))); 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 (z <= 8e+70)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = (27.0 * (b * a)) - (9.0 * (t * (y * z)));
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[z, 8e+70], 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[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $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}
\mathbf{if}\;z \leq 8 \cdot 10^{+70}:\\
\;\;\;\;\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}:\\
\;\;\;\;27 \cdot \left(b \cdot a\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 8.00000000000000058e70Initial program 94.6%
sub-neg94.6%
sub-neg94.6%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
if 8.00000000000000058e70 < z Initial program 86.5%
sub-neg86.5%
sub-neg86.5%
associate-*l*85.2%
associate-*l*85.2%
Simplified85.2%
Taylor expanded in x around 0 72.0%
Final simplification90.8%
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 3e-249) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* y (* 9.0 z)))) (* b (* 27.0 a)))))
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 <= 3e-249) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (27.0 * a));
}
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 (z <= 3d-249) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * (y * (9.0d0 * z)))) + (b * (27.0d0 * a))
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 (z <= 3e-249) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (27.0 * a));
}
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 z <= 3e-249: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (27.0 * a)) 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 <= 3e-249) 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(9.0 * z)))) + Float64(b * Float64(27.0 * a))); 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 (z <= 3e-249)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (27.0 * a));
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[z, 3e-249], 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[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $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 3 \cdot 10^{-249}:\\
\;\;\;\;\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(9 \cdot z\right)\right)\right) + b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if z < 3.00000000000000004e-249Initial program 93.3%
sub-neg93.3%
sub-neg93.3%
associate-*l*95.9%
associate-*l*95.8%
Simplified95.8%
if 3.00000000000000004e-249 < z Initial program 92.0%
Taylor expanded in y around 0 93.0%
associate-*r*92.0%
*-commutative92.0%
associate-*r*93.0%
Simplified93.0%
Final simplification94.6%
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 4.5e-249) (- (+ (* 27.0 (* b a)) (* x 2.0)) (* y (* (* 9.0 z) t))) (+ (- (* x 2.0) (* t (* y (* 9.0 z)))) (* b (* 27.0 a)))))
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 <= 4.5e-249) {
tmp = ((27.0 * (b * a)) + (x * 2.0)) - (y * ((9.0 * z) * t));
} else {
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (27.0 * a));
}
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 (z <= 4.5d-249) then
tmp = ((27.0d0 * (b * a)) + (x * 2.0d0)) - (y * ((9.0d0 * z) * t))
else
tmp = ((x * 2.0d0) - (t * (y * (9.0d0 * z)))) + (b * (27.0d0 * a))
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 (z <= 4.5e-249) {
tmp = ((27.0 * (b * a)) + (x * 2.0)) - (y * ((9.0 * z) * t));
} else {
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (27.0 * a));
}
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 z <= 4.5e-249: tmp = ((27.0 * (b * a)) + (x * 2.0)) - (y * ((9.0 * z) * t)) else: tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (27.0 * a)) 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 <= 4.5e-249) tmp = Float64(Float64(Float64(27.0 * Float64(b * a)) + Float64(x * 2.0)) - Float64(y * Float64(Float64(9.0 * z) * t))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(9.0 * z)))) + Float64(b * Float64(27.0 * a))); 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 (z <= 4.5e-249)
tmp = ((27.0 * (b * a)) + (x * 2.0)) - (y * ((9.0 * z) * t));
else
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (27.0 * a));
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[z, 4.5e-249], N[(N[(N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(9.0 * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $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 4.5 \cdot 10^{-249}:\\
\;\;\;\;\left(27 \cdot \left(b \cdot a\right) + x \cdot 2\right) - y \cdot \left(\left(9 \cdot z\right) \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\right) + b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if z < 4.49999999999999981e-249Initial program 93.3%
sub-neg93.3%
sub-neg93.3%
associate-*l*95.9%
associate-*l*95.8%
Simplified95.8%
+-commutative95.8%
associate-+r-95.8%
*-commutative95.8%
associate-*l*95.8%
associate-*l*95.8%
associate-*r*95.8%
Applied egg-rr95.8%
if 4.49999999999999981e-249 < z Initial program 92.0%
Taylor expanded in y around 0 93.0%
associate-*r*92.0%
*-commutative92.0%
associate-*r*93.0%
Simplified93.0%
Final simplification94.6%
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 -7.5e+74)
(* y (* -9.0 (* z t)))
(if (<= z 5.6e-82)
(+ (* 27.0 (* b a)) (* x 2.0))
(- (* x 2.0) (* 9.0 (* t (* 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 tmp;
if (z <= -7.5e+74) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 5.6e-82) {
tmp = (27.0 * (b * a)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
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 (z <= (-7.5d+74)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 5.6d-82) then
tmp = (27.0d0 * (b * a)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
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 (z <= -7.5e+74) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 5.6e-82) {
tmp = (27.0 * (b * a)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (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]) def code(x, y, z, t, a, b): tmp = 0 if z <= -7.5e+74: tmp = y * (-9.0 * (z * t)) elif z <= 5.6e-82: tmp = (27.0 * (b * a)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (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) tmp = 0.0 if (z <= -7.5e+74) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 5.6e-82) tmp = Float64(Float64(27.0 * Float64(b * a)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); 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 (z <= -7.5e+74)
tmp = y * (-9.0 * (z * t));
elseif (z <= 5.6e-82)
tmp = (27.0 * (b * a)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
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[z, -7.5e+74], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e-82], N[(N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $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}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-82}:\\
\;\;\;\;27 \cdot \left(b \cdot a\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -7.5e74Initial program 87.7%
sub-neg87.7%
sub-neg87.7%
associate-*l*91.3%
associate-*l*91.3%
Simplified91.3%
+-commutative91.3%
associate-+r-91.3%
*-commutative91.3%
associate-*l*91.3%
associate-*l*91.3%
associate-*r*91.3%
Applied egg-rr91.3%
Taylor expanded in y around inf 47.4%
*-commutative47.4%
*-commutative47.4%
associate-*r*43.9%
associate-*l*43.9%
*-commutative43.9%
*-commutative43.9%
Simplified43.9%
if -7.5e74 < z < 5.60000000000000049e-82Initial program 96.6%
sub-neg96.6%
sub-neg96.6%
associate-*l*98.1%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in y around 0 84.3%
if 5.60000000000000049e-82 < z Initial program 90.5%
sub-neg90.5%
sub-neg90.5%
associate-*l*89.6%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in a around 0 72.5%
Final simplification71.8%
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.02e+74)
(- (* x 2.0) (* 9.0 (* z (* y t))))
(if (<= z 6.6e-81)
(+ (* 27.0 (* b a)) (* x 2.0))
(- (* x 2.0) (* 9.0 (* t (* 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 tmp;
if (z <= -1.02e+74) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else if (z <= 6.6e-81) {
tmp = (27.0 * (b * a)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
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 (z <= (-1.02d+74)) then
tmp = (x * 2.0d0) - (9.0d0 * (z * (y * t)))
else if (z <= 6.6d-81) then
tmp = (27.0d0 * (b * a)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
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 (z <= -1.02e+74) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else if (z <= 6.6e-81) {
tmp = (27.0 * (b * a)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (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]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.02e+74: tmp = (x * 2.0) - (9.0 * (z * (y * t))) elif z <= 6.6e-81: tmp = (27.0 * (b * a)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (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) tmp = 0.0 if (z <= -1.02e+74) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))); elseif (z <= 6.6e-81) tmp = Float64(Float64(27.0 * Float64(b * a)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); 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 (z <= -1.02e+74)
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
elseif (z <= 6.6e-81)
tmp = (27.0 * (b * a)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
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[z, -1.02e+74], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e-81], N[(N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $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}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+74}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-81}:\\
\;\;\;\;27 \cdot \left(b \cdot a\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.02000000000000005e74Initial program 87.7%
sub-neg87.7%
sub-neg87.7%
associate-*l*91.3%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in a around 0 66.3%
pow166.3%
*-commutative66.3%
associate-*l*62.9%
Applied egg-rr62.9%
unpow162.9%
associate-*r*66.3%
*-commutative66.3%
associate-*r*71.3%
Simplified71.3%
if -1.02000000000000005e74 < z < 6.59999999999999975e-81Initial program 96.6%
sub-neg96.6%
sub-neg96.6%
associate-*l*98.1%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in y around 0 84.3%
if 6.59999999999999975e-81 < z Initial program 90.5%
sub-neg90.5%
sub-neg90.5%
associate-*l*89.6%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in a around 0 72.5%
Final simplification77.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 -3.8e+75)
(* y (* -9.0 (* z t)))
(if (<= z 4000000000.0)
(+ (* 27.0 (* b a)) (* x 2.0))
(* -9.0 (* t (* 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 tmp;
if (z <= -3.8e+75) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 4000000000.0) {
tmp = (27.0 * (b * a)) + (x * 2.0);
} else {
tmp = -9.0 * (t * (y * z));
}
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 (z <= (-3.8d+75)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 4000000000.0d0) then
tmp = (27.0d0 * (b * a)) + (x * 2.0d0)
else
tmp = (-9.0d0) * (t * (y * z))
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 (z <= -3.8e+75) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 4000000000.0) {
tmp = (27.0 * (b * a)) + (x * 2.0);
} else {
tmp = -9.0 * (t * (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]) def code(x, y, z, t, a, b): tmp = 0 if z <= -3.8e+75: tmp = y * (-9.0 * (z * t)) elif z <= 4000000000.0: tmp = (27.0 * (b * a)) + (x * 2.0) else: tmp = -9.0 * (t * (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) tmp = 0.0 if (z <= -3.8e+75) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 4000000000.0) tmp = Float64(Float64(27.0 * Float64(b * a)) + Float64(x * 2.0)); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); 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 (z <= -3.8e+75)
tmp = y * (-9.0 * (z * t));
elseif (z <= 4000000000.0)
tmp = (27.0 * (b * a)) + (x * 2.0);
else
tmp = -9.0 * (t * (y * z));
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[z, -3.8e+75], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4000000000.0], N[(N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * 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}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+75}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 4000000000:\\
\;\;\;\;27 \cdot \left(b \cdot a\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -3.8000000000000002e75Initial program 87.5%
sub-neg87.5%
sub-neg87.5%
associate-*l*91.2%
associate-*l*91.1%
Simplified91.1%
+-commutative91.1%
associate-+r-91.1%
*-commutative91.1%
associate-*l*91.1%
associate-*l*91.1%
associate-*r*91.1%
Applied egg-rr91.1%
Taylor expanded in y around inf 48.3%
*-commutative48.3%
*-commutative48.3%
associate-*r*44.7%
associate-*l*44.7%
*-commutative44.7%
*-commutative44.7%
Simplified44.7%
if -3.8000000000000002e75 < z < 4e9Initial program 97.1%
sub-neg97.1%
sub-neg97.1%
associate-*l*98.4%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in y around 0 83.1%
if 4e9 < z Initial program 87.8%
sub-neg87.8%
sub-neg87.8%
associate-*l*86.5%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in y around inf 52.1%
Final simplification67.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 (if (or (<= a -6.2e+18) (not (<= a 1.4e-95))) (* 27.0 (* b a)) (* 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 ((a <= -6.2e+18) || !(a <= 1.4e-95)) {
tmp = 27.0 * (b * a);
} 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 ((a <= (-6.2d+18)) .or. (.not. (a <= 1.4d-95))) then
tmp = 27.0d0 * (b * a)
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 ((a <= -6.2e+18) || !(a <= 1.4e-95)) {
tmp = 27.0 * (b * a);
} 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 (a <= -6.2e+18) or not (a <= 1.4e-95): tmp = 27.0 * (b * a) 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 ((a <= -6.2e+18) || !(a <= 1.4e-95)) tmp = Float64(27.0 * Float64(b * a)); 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 ((a <= -6.2e+18) || ~((a <= 1.4e-95)))
tmp = 27.0 * (b * a);
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[Or[LessEqual[a, -6.2e+18], N[Not[LessEqual[a, 1.4e-95]], $MachinePrecision]], N[(27.0 * N[(b * a), $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}\;a \leq -6.2 \cdot 10^{+18} \lor \neg \left(a \leq 1.4 \cdot 10^{-95}\right):\\
\;\;\;\;27 \cdot \left(b \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -6.2e18 or 1.4e-95 < a Initial program 91.8%
sub-neg91.8%
sub-neg91.8%
associate-*l*93.1%
associate-*l*93.1%
Simplified93.1%
+-commutative93.1%
associate-+r-93.1%
*-commutative93.1%
associate-*l*93.0%
associate-*l*93.8%
associate-*r*93.8%
Applied egg-rr93.8%
Taylor expanded in b around inf 51.1%
if -6.2e18 < a < 1.4e-95Initial program 93.9%
sub-neg93.9%
sub-neg93.9%
associate-*l*94.8%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in x around inf 50.5%
Final simplification50.8%
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 (<= a -6.8e+18) (* 27.0 (* b a)) (if (<= a 6e-123) (* x 2.0) (* a (* 27.0 b)))))
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 (a <= -6.8e+18) {
tmp = 27.0 * (b * a);
} else if (a <= 6e-123) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * b);
}
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 (a <= (-6.8d+18)) then
tmp = 27.0d0 * (b * a)
else if (a <= 6d-123) then
tmp = x * 2.0d0
else
tmp = a * (27.0d0 * b)
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 (a <= -6.8e+18) {
tmp = 27.0 * (b * a);
} else if (a <= 6e-123) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * b);
}
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 a <= -6.8e+18: tmp = 27.0 * (b * a) elif a <= 6e-123: tmp = x * 2.0 else: tmp = a * (27.0 * b) 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 (a <= -6.8e+18) tmp = Float64(27.0 * Float64(b * a)); elseif (a <= 6e-123) tmp = Float64(x * 2.0); else tmp = Float64(a * Float64(27.0 * b)); 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 (a <= -6.8e+18)
tmp = 27.0 * (b * a);
elseif (a <= 6e-123)
tmp = x * 2.0;
else
tmp = a * (27.0 * b);
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[a, -6.8e+18], N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6e-123], N[(x * 2.0), $MachinePrecision], N[(a * N[(27.0 * b), $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}\;a \leq -6.8 \cdot 10^{+18}:\\
\;\;\;\;27 \cdot \left(b \cdot a\right)\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-123}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if a < -6.8e18Initial program 94.0%
sub-neg94.0%
sub-neg94.0%
associate-*l*95.9%
associate-*l*95.9%
Simplified95.9%
+-commutative95.9%
associate-+r-95.9%
*-commutative95.9%
associate-*l*95.9%
associate-*l*95.9%
associate-*r*95.8%
Applied egg-rr95.8%
Taylor expanded in b around inf 55.1%
if -6.8e18 < a < 5.99999999999999968e-123Initial program 93.6%
sub-neg93.6%
sub-neg93.6%
associate-*l*94.5%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in x around inf 50.4%
if 5.99999999999999968e-123 < a Initial program 91.2%
sub-neg91.2%
sub-neg91.2%
associate-*l*92.1%
associate-*l*92.1%
Simplified92.1%
+-commutative92.1%
associate-+r-92.1%
*-commutative92.1%
associate-*l*92.1%
associate-*l*93.1%
associate-*r*93.1%
Applied egg-rr93.1%
Taylor expanded in b around inf 47.2%
*-commutative47.2%
associate-*r*47.3%
Simplified47.3%
Final simplification50.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 (* 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 92.7%
sub-neg92.7%
sub-neg92.7%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in x around inf 33.1%
Final simplification33.1%
(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 2024044
(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)))