
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* y 9.0) -200.0) (fma a (* 27.0 b) (fma x 2.0 (* y (* (* -9.0 z) t)))) (+ (- (* x 2.0) (* (* y t) (* 9.0 z))) (* a (* 27.0 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) <= -200.0) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * ((-9.0 * z) * t))));
} else {
tmp = ((x * 2.0) - ((y * t) * (9.0 * z))) + (a * (27.0 * b));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -200.0) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(Float64(-9.0 * z) * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * t) * Float64(9.0 * z))) + Float64(a * Float64(27.0 * b))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y * 9.0), $MachinePrecision], -200.0], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(N[(-9.0 * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * t), $MachinePrecision] * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -200:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(\left(-9 \cdot z\right) \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot t\right) \cdot \left(9 \cdot z\right)\right) + a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -200Initial program 88.1%
+-commutative88.1%
associate-+r-88.1%
*-commutative88.1%
cancel-sign-sub-inv88.1%
associate-*r*92.3%
distribute-lft-neg-in92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-+r-92.3%
associate-*l*92.3%
fma-define93.9%
sub-neg93.9%
fma-define93.9%
*-commutative93.9%
distribute-lft-neg-in93.9%
associate-*l*89.6%
*-commutative89.6%
Simplified99.7%
if -200 < (*.f64 y 9) Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*95.8%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in y around 0 95.3%
*-commutative95.3%
associate-*r*95.7%
*-commutative95.7%
associate-*r*95.3%
*-commutative95.3%
associate-*r*96.7%
associate-*l*96.8%
*-commutative96.8%
Simplified96.8%
Final simplification97.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (* z (* y -9.0)))))
(if (<= (* a 27.0) -5e+120)
(* b (* a 27.0))
(if (<= (* a 27.0) -2e+29)
(* y (* z (* -9.0 t)))
(if (<= (* a 27.0) -5000000.0)
(* x 2.0)
(if (<= (* a 27.0) -4e-82)
(* z (* y (* -9.0 t)))
(if (<= (* a 27.0) -2e-106)
(* x 2.0)
(if (<= (* a 27.0) -1e-277)
t_1
(if (<= (* a 27.0) 5e-199)
(* x 2.0)
(if (<= (* a 27.0) 1e+20) t_1 (* 27.0 (* 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 = t * (z * (y * -9.0));
double tmp;
if ((a * 27.0) <= -5e+120) {
tmp = b * (a * 27.0);
} else if ((a * 27.0) <= -2e+29) {
tmp = y * (z * (-9.0 * t));
} else if ((a * 27.0) <= -5000000.0) {
tmp = x * 2.0;
} else if ((a * 27.0) <= -4e-82) {
tmp = z * (y * (-9.0 * t));
} else if ((a * 27.0) <= -2e-106) {
tmp = x * 2.0;
} else if ((a * 27.0) <= -1e-277) {
tmp = t_1;
} else if ((a * 27.0) <= 5e-199) {
tmp = x * 2.0;
} else if ((a * 27.0) <= 1e+20) {
tmp = t_1;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (z * (y * (-9.0d0)))
if ((a * 27.0d0) <= (-5d+120)) then
tmp = b * (a * 27.0d0)
else if ((a * 27.0d0) <= (-2d+29)) then
tmp = y * (z * ((-9.0d0) * t))
else if ((a * 27.0d0) <= (-5000000.0d0)) then
tmp = x * 2.0d0
else if ((a * 27.0d0) <= (-4d-82)) then
tmp = z * (y * ((-9.0d0) * t))
else if ((a * 27.0d0) <= (-2d-106)) then
tmp = x * 2.0d0
else if ((a * 27.0d0) <= (-1d-277)) then
tmp = t_1
else if ((a * 27.0d0) <= 5d-199) then
tmp = x * 2.0d0
else if ((a * 27.0d0) <= 1d+20) then
tmp = t_1
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (z * (y * -9.0));
double tmp;
if ((a * 27.0) <= -5e+120) {
tmp = b * (a * 27.0);
} else if ((a * 27.0) <= -2e+29) {
tmp = y * (z * (-9.0 * t));
} else if ((a * 27.0) <= -5000000.0) {
tmp = x * 2.0;
} else if ((a * 27.0) <= -4e-82) {
tmp = z * (y * (-9.0 * t));
} else if ((a * 27.0) <= -2e-106) {
tmp = x * 2.0;
} else if ((a * 27.0) <= -1e-277) {
tmp = t_1;
} else if ((a * 27.0) <= 5e-199) {
tmp = x * 2.0;
} else if ((a * 27.0) <= 1e+20) {
tmp = t_1;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = t * (z * (y * -9.0)) tmp = 0 if (a * 27.0) <= -5e+120: tmp = b * (a * 27.0) elif (a * 27.0) <= -2e+29: tmp = y * (z * (-9.0 * t)) elif (a * 27.0) <= -5000000.0: tmp = x * 2.0 elif (a * 27.0) <= -4e-82: tmp = z * (y * (-9.0 * t)) elif (a * 27.0) <= -2e-106: tmp = x * 2.0 elif (a * 27.0) <= -1e-277: tmp = t_1 elif (a * 27.0) <= 5e-199: tmp = x * 2.0 elif (a * 27.0) <= 1e+20: tmp = t_1 else: tmp = 27.0 * (a * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(z * Float64(y * -9.0))) tmp = 0.0 if (Float64(a * 27.0) <= -5e+120) tmp = Float64(b * Float64(a * 27.0)); elseif (Float64(a * 27.0) <= -2e+29) tmp = Float64(y * Float64(z * Float64(-9.0 * t))); elseif (Float64(a * 27.0) <= -5000000.0) tmp = Float64(x * 2.0); elseif (Float64(a * 27.0) <= -4e-82) tmp = Float64(z * Float64(y * Float64(-9.0 * t))); elseif (Float64(a * 27.0) <= -2e-106) tmp = Float64(x * 2.0); elseif (Float64(a * 27.0) <= -1e-277) tmp = t_1; elseif (Float64(a * 27.0) <= 5e-199) tmp = Float64(x * 2.0); elseif (Float64(a * 27.0) <= 1e+20) tmp = t_1; else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = t * (z * (y * -9.0));
tmp = 0.0;
if ((a * 27.0) <= -5e+120)
tmp = b * (a * 27.0);
elseif ((a * 27.0) <= -2e+29)
tmp = y * (z * (-9.0 * t));
elseif ((a * 27.0) <= -5000000.0)
tmp = x * 2.0;
elseif ((a * 27.0) <= -4e-82)
tmp = z * (y * (-9.0 * t));
elseif ((a * 27.0) <= -2e-106)
tmp = x * 2.0;
elseif ((a * 27.0) <= -1e-277)
tmp = t_1;
elseif ((a * 27.0) <= 5e-199)
tmp = x * 2.0;
elseif ((a * 27.0) <= 1e+20)
tmp = t_1;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * 27.0), $MachinePrecision], -5e+120], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], -2e+29], N[(y * N[(z * N[(-9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], -5000000.0], N[(x * 2.0), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], -4e-82], N[(z * N[(y * N[(-9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], -2e-106], N[(x * 2.0), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], -1e-277], t$95$1, If[LessEqual[N[(a * 27.0), $MachinePrecision], 5e-199], N[(x * 2.0), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], 1e+20], t$95$1, N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{if}\;a \cdot 27 \leq -5 \cdot 10^{+120}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;a \cdot 27 \leq -2 \cdot 10^{+29}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-9 \cdot t\right)\right)\\
\mathbf{elif}\;a \cdot 27 \leq -5000000:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \cdot 27 \leq -4 \cdot 10^{-82}:\\
\;\;\;\;z \cdot \left(y \cdot \left(-9 \cdot t\right)\right)\\
\mathbf{elif}\;a \cdot 27 \leq -2 \cdot 10^{-106}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \cdot 27 \leq -1 \cdot 10^{-277}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot 27 \leq 5 \cdot 10^{-199}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \cdot 27 \leq 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 a 27) < -5.00000000000000019e120Initial program 97.5%
sub-neg97.5%
sub-neg97.5%
associate-*l*97.6%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in a around inf 78.8%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
add-cbrt-cube56.5%
pow356.5%
Applied egg-rr56.5%
rem-cbrt-cube78.9%
associate-*r*78.9%
Applied egg-rr78.9%
if -5.00000000000000019e120 < (*.f64 a 27) < -1.99999999999999983e29Initial program 90.7%
sub-neg90.7%
sub-neg90.7%
associate-*l*85.9%
associate-*l*85.7%
Simplified85.7%
Taylor expanded in y around 0 90.4%
*-commutative90.4%
associate-*r*85.7%
*-commutative85.7%
associate-*r*90.4%
*-commutative90.4%
associate-*r*86.2%
associate-*l*86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in t around inf 53.7%
associate-*r*53.7%
*-commutative53.7%
associate-*l*53.9%
*-commutative53.9%
Simplified53.9%
if -1.99999999999999983e29 < (*.f64 a 27) < -5e6 or -4e-82 < (*.f64 a 27) < -1.99999999999999988e-106 or -9.99999999999999969e-278 < (*.f64 a 27) < 4.9999999999999996e-199Initial program 94.2%
sub-neg94.2%
sub-neg94.2%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 53.1%
if -5e6 < (*.f64 a 27) < -4e-82Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in y around 0 92.7%
*-commutative92.7%
associate-*r*99.7%
*-commutative99.7%
associate-*r*92.7%
*-commutative92.7%
associate-*r*99.6%
associate-*l*99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 48.7%
associate-*r*48.8%
associate-*r*54.4%
*-commutative54.4%
Simplified54.4%
if -1.99999999999999988e-106 < (*.f64 a 27) < -9.99999999999999969e-278 or 4.9999999999999996e-199 < (*.f64 a 27) < 1e20Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*96.3%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in x around 0 56.0%
pow156.0%
Applied egg-rr56.0%
unpow156.0%
associate-*r*60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in a around 0 45.8%
associate-*r*45.8%
*-commutative45.8%
associate-*l*45.8%
associate-*l*45.8%
*-commutative45.8%
*-commutative45.8%
Simplified45.8%
if 1e20 < (*.f64 a 27) Initial program 92.3%
sub-neg92.3%
sub-neg92.3%
associate-*l*96.8%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in a around inf 52.7%
Final simplification55.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (* z (* y -9.0)))))
(if (<= (* a 27.0) -5e+120)
(* b (* a 27.0))
(if (<= (* a 27.0) -2e+29)
(* y (* z (* -9.0 t)))
(if (<= (* a 27.0) -5000000.0)
(* x 2.0)
(if (<= (* a 27.0) -4e-82)
(* (* y t) (* 9.0 (- z)))
(if (<= (* a 27.0) -2e-106)
(* x 2.0)
(if (<= (* a 27.0) -1e-277)
t_1
(if (<= (* a 27.0) 5e-199)
(* x 2.0)
(if (<= (* a 27.0) 1e+20) t_1 (* 27.0 (* 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 = t * (z * (y * -9.0));
double tmp;
if ((a * 27.0) <= -5e+120) {
tmp = b * (a * 27.0);
} else if ((a * 27.0) <= -2e+29) {
tmp = y * (z * (-9.0 * t));
} else if ((a * 27.0) <= -5000000.0) {
tmp = x * 2.0;
} else if ((a * 27.0) <= -4e-82) {
tmp = (y * t) * (9.0 * -z);
} else if ((a * 27.0) <= -2e-106) {
tmp = x * 2.0;
} else if ((a * 27.0) <= -1e-277) {
tmp = t_1;
} else if ((a * 27.0) <= 5e-199) {
tmp = x * 2.0;
} else if ((a * 27.0) <= 1e+20) {
tmp = t_1;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (z * (y * (-9.0d0)))
if ((a * 27.0d0) <= (-5d+120)) then
tmp = b * (a * 27.0d0)
else if ((a * 27.0d0) <= (-2d+29)) then
tmp = y * (z * ((-9.0d0) * t))
else if ((a * 27.0d0) <= (-5000000.0d0)) then
tmp = x * 2.0d0
else if ((a * 27.0d0) <= (-4d-82)) then
tmp = (y * t) * (9.0d0 * -z)
else if ((a * 27.0d0) <= (-2d-106)) then
tmp = x * 2.0d0
else if ((a * 27.0d0) <= (-1d-277)) then
tmp = t_1
else if ((a * 27.0d0) <= 5d-199) then
tmp = x * 2.0d0
else if ((a * 27.0d0) <= 1d+20) then
tmp = t_1
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (z * (y * -9.0));
double tmp;
if ((a * 27.0) <= -5e+120) {
tmp = b * (a * 27.0);
} else if ((a * 27.0) <= -2e+29) {
tmp = y * (z * (-9.0 * t));
} else if ((a * 27.0) <= -5000000.0) {
tmp = x * 2.0;
} else if ((a * 27.0) <= -4e-82) {
tmp = (y * t) * (9.0 * -z);
} else if ((a * 27.0) <= -2e-106) {
tmp = x * 2.0;
} else if ((a * 27.0) <= -1e-277) {
tmp = t_1;
} else if ((a * 27.0) <= 5e-199) {
tmp = x * 2.0;
} else if ((a * 27.0) <= 1e+20) {
tmp = t_1;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = t * (z * (y * -9.0)) tmp = 0 if (a * 27.0) <= -5e+120: tmp = b * (a * 27.0) elif (a * 27.0) <= -2e+29: tmp = y * (z * (-9.0 * t)) elif (a * 27.0) <= -5000000.0: tmp = x * 2.0 elif (a * 27.0) <= -4e-82: tmp = (y * t) * (9.0 * -z) elif (a * 27.0) <= -2e-106: tmp = x * 2.0 elif (a * 27.0) <= -1e-277: tmp = t_1 elif (a * 27.0) <= 5e-199: tmp = x * 2.0 elif (a * 27.0) <= 1e+20: tmp = t_1 else: tmp = 27.0 * (a * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(z * Float64(y * -9.0))) tmp = 0.0 if (Float64(a * 27.0) <= -5e+120) tmp = Float64(b * Float64(a * 27.0)); elseif (Float64(a * 27.0) <= -2e+29) tmp = Float64(y * Float64(z * Float64(-9.0 * t))); elseif (Float64(a * 27.0) <= -5000000.0) tmp = Float64(x * 2.0); elseif (Float64(a * 27.0) <= -4e-82) tmp = Float64(Float64(y * t) * Float64(9.0 * Float64(-z))); elseif (Float64(a * 27.0) <= -2e-106) tmp = Float64(x * 2.0); elseif (Float64(a * 27.0) <= -1e-277) tmp = t_1; elseif (Float64(a * 27.0) <= 5e-199) tmp = Float64(x * 2.0); elseif (Float64(a * 27.0) <= 1e+20) tmp = t_1; else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = t * (z * (y * -9.0));
tmp = 0.0;
if ((a * 27.0) <= -5e+120)
tmp = b * (a * 27.0);
elseif ((a * 27.0) <= -2e+29)
tmp = y * (z * (-9.0 * t));
elseif ((a * 27.0) <= -5000000.0)
tmp = x * 2.0;
elseif ((a * 27.0) <= -4e-82)
tmp = (y * t) * (9.0 * -z);
elseif ((a * 27.0) <= -2e-106)
tmp = x * 2.0;
elseif ((a * 27.0) <= -1e-277)
tmp = t_1;
elseif ((a * 27.0) <= 5e-199)
tmp = x * 2.0;
elseif ((a * 27.0) <= 1e+20)
tmp = t_1;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * 27.0), $MachinePrecision], -5e+120], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], -2e+29], N[(y * N[(z * N[(-9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], -5000000.0], N[(x * 2.0), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], -4e-82], N[(N[(y * t), $MachinePrecision] * N[(9.0 * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], -2e-106], N[(x * 2.0), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], -1e-277], t$95$1, If[LessEqual[N[(a * 27.0), $MachinePrecision], 5e-199], N[(x * 2.0), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], 1e+20], t$95$1, N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{if}\;a \cdot 27 \leq -5 \cdot 10^{+120}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;a \cdot 27 \leq -2 \cdot 10^{+29}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-9 \cdot t\right)\right)\\
\mathbf{elif}\;a \cdot 27 \leq -5000000:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \cdot 27 \leq -4 \cdot 10^{-82}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(9 \cdot \left(-z\right)\right)\\
\mathbf{elif}\;a \cdot 27 \leq -2 \cdot 10^{-106}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \cdot 27 \leq -1 \cdot 10^{-277}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot 27 \leq 5 \cdot 10^{-199}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \cdot 27 \leq 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 a 27) < -5.00000000000000019e120Initial program 97.5%
sub-neg97.5%
sub-neg97.5%
associate-*l*97.6%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in a around inf 78.8%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
add-cbrt-cube56.5%
pow356.5%
Applied egg-rr56.5%
rem-cbrt-cube78.9%
associate-*r*78.9%
Applied egg-rr78.9%
if -5.00000000000000019e120 < (*.f64 a 27) < -1.99999999999999983e29Initial program 90.7%
sub-neg90.7%
sub-neg90.7%
associate-*l*85.9%
associate-*l*85.7%
Simplified85.7%
Taylor expanded in y around 0 90.4%
*-commutative90.4%
associate-*r*85.7%
*-commutative85.7%
associate-*r*90.4%
*-commutative90.4%
associate-*r*86.2%
associate-*l*86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in t around inf 53.7%
associate-*r*53.7%
*-commutative53.7%
associate-*l*53.9%
*-commutative53.9%
Simplified53.9%
if -1.99999999999999983e29 < (*.f64 a 27) < -5e6 or -4e-82 < (*.f64 a 27) < -1.99999999999999988e-106 or -9.99999999999999969e-278 < (*.f64 a 27) < 4.9999999999999996e-199Initial program 94.2%
sub-neg94.2%
sub-neg94.2%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 53.1%
if -5e6 < (*.f64 a 27) < -4e-82Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in y around 0 92.7%
*-commutative92.7%
associate-*r*99.7%
*-commutative99.7%
associate-*r*92.7%
*-commutative92.7%
associate-*r*99.6%
associate-*l*99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 48.7%
associate-*r*48.8%
*-commutative48.8%
associate-*l*54.6%
*-commutative54.6%
Simplified54.6%
Taylor expanded in z around 0 54.6%
*-commutative54.6%
associate-*r*54.5%
metadata-eval54.5%
*-commutative54.5%
associate-*r*54.3%
distribute-lft-neg-in54.3%
*-commutative54.3%
*-commutative54.3%
associate-*l*54.4%
Applied egg-rr54.4%
if -1.99999999999999988e-106 < (*.f64 a 27) < -9.99999999999999969e-278 or 4.9999999999999996e-199 < (*.f64 a 27) < 1e20Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*96.3%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in x around 0 56.0%
pow156.0%
Applied egg-rr56.0%
unpow156.0%
associate-*r*60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in a around 0 45.8%
associate-*r*45.8%
*-commutative45.8%
associate-*l*45.8%
associate-*l*45.8%
*-commutative45.8%
*-commutative45.8%
Simplified45.8%
if 1e20 < (*.f64 a 27) Initial program 92.3%
sub-neg92.3%
sub-neg92.3%
associate-*l*96.8%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in a around inf 52.7%
Final simplification55.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0)))
(t_2 (* 27.0 (* a b)))
(t_3 (* y (* -9.0 (* z t)))))
(if (<= t_1 -2e+41)
t_2
(if (<= t_1 -2e+23)
(* x 2.0)
(if (<= t_1 -400.0)
(* a (* 27.0 b))
(if (<= t_1 2e+69)
t_3
(if (<= t_1 2e+129) t_2 (if (<= t_1 4e+160) t_3 t_1))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double t_2 = 27.0 * (a * b);
double t_3 = y * (-9.0 * (z * t));
double tmp;
if (t_1 <= -2e+41) {
tmp = t_2;
} else if (t_1 <= -2e+23) {
tmp = x * 2.0;
} else if (t_1 <= -400.0) {
tmp = a * (27.0 * b);
} else if (t_1 <= 2e+69) {
tmp = t_3;
} else if (t_1 <= 2e+129) {
tmp = t_2;
} else if (t_1 <= 4e+160) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = b * (a * 27.0d0)
t_2 = 27.0d0 * (a * b)
t_3 = y * ((-9.0d0) * (z * t))
if (t_1 <= (-2d+41)) then
tmp = t_2
else if (t_1 <= (-2d+23)) then
tmp = x * 2.0d0
else if (t_1 <= (-400.0d0)) then
tmp = a * (27.0d0 * b)
else if (t_1 <= 2d+69) then
tmp = t_3
else if (t_1 <= 2d+129) then
tmp = t_2
else if (t_1 <= 4d+160) then
tmp = t_3
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double t_2 = 27.0 * (a * b);
double t_3 = y * (-9.0 * (z * t));
double tmp;
if (t_1 <= -2e+41) {
tmp = t_2;
} else if (t_1 <= -2e+23) {
tmp = x * 2.0;
} else if (t_1 <= -400.0) {
tmp = a * (27.0 * b);
} else if (t_1 <= 2e+69) {
tmp = t_3;
} else if (t_1 <= 2e+129) {
tmp = t_2;
} else if (t_1 <= 4e+160) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) t_2 = 27.0 * (a * b) t_3 = y * (-9.0 * (z * t)) tmp = 0 if t_1 <= -2e+41: tmp = t_2 elif t_1 <= -2e+23: tmp = x * 2.0 elif t_1 <= -400.0: tmp = a * (27.0 * b) elif t_1 <= 2e+69: tmp = t_3 elif t_1 <= 2e+129: tmp = t_2 elif t_1 <= 4e+160: tmp = t_3 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) t_2 = Float64(27.0 * Float64(a * b)) t_3 = Float64(y * Float64(-9.0 * Float64(z * t))) tmp = 0.0 if (t_1 <= -2e+41) tmp = t_2; elseif (t_1 <= -2e+23) tmp = Float64(x * 2.0); elseif (t_1 <= -400.0) tmp = Float64(a * Float64(27.0 * b)); elseif (t_1 <= 2e+69) tmp = t_3; elseif (t_1 <= 2e+129) tmp = t_2; elseif (t_1 <= 4e+160) tmp = t_3; else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
t_2 = 27.0 * (a * b);
t_3 = y * (-9.0 * (z * t));
tmp = 0.0;
if (t_1 <= -2e+41)
tmp = t_2;
elseif (t_1 <= -2e+23)
tmp = x * 2.0;
elseif (t_1 <= -400.0)
tmp = a * (27.0 * b);
elseif (t_1 <= 2e+69)
tmp = t_3;
elseif (t_1 <= 2e+129)
tmp = t_2;
elseif (t_1 <= 4e+160)
tmp = t_3;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+41], t$95$2, If[LessEqual[t$95$1, -2e+23], N[(x * 2.0), $MachinePrecision], If[LessEqual[t$95$1, -400.0], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+69], t$95$3, If[LessEqual[t$95$1, 2e+129], t$95$2, If[LessEqual[t$95$1, 4e+160], t$95$3, t$95$1]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
t_3 := y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+41}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{+23}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t_1 \leq -400:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+69}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+129}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+160}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -2.00000000000000001e41 or 2.0000000000000001e69 < (*.f64 (*.f64 a 27) b) < 2e129Initial program 93.9%
sub-neg93.9%
sub-neg93.9%
associate-*l*96.7%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in a around inf 71.4%
if -2.00000000000000001e41 < (*.f64 (*.f64 a 27) b) < -1.9999999999999998e23Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 76.1%
if -1.9999999999999998e23 < (*.f64 (*.f64 a 27) b) < -400Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 67.7%
associate-*r*68.7%
*-commutative68.7%
associate-*r*68.7%
Simplified68.7%
if -400 < (*.f64 (*.f64 a 27) b) < 2.0000000000000001e69 or 2e129 < (*.f64 (*.f64 a 27) b) < 4.00000000000000003e160Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*96.1%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in y around 0 93.0%
*-commutative93.0%
associate-*r*96.0%
*-commutative96.0%
associate-*r*93.0%
*-commutative93.0%
associate-*r*96.7%
associate-*l*96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in t around inf 50.0%
associate-*r*50.0%
*-commutative50.0%
associate-*l*52.4%
*-commutative52.4%
Simplified52.4%
Taylor expanded in z around 0 52.4%
if 4.00000000000000003e160 < (*.f64 (*.f64 a 27) b) Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*96.5%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in a around inf 92.8%
associate-*r*93.1%
*-commutative93.1%
associate-*r*93.0%
Simplified93.0%
add-cbrt-cube57.6%
pow357.6%
Applied egg-rr57.6%
rem-cbrt-cube93.0%
associate-*r*93.1%
Applied egg-rr93.1%
Final simplification62.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0)))
(t_2 (* 27.0 (* a b)))
(t_3 (* y (* z (* -9.0 t)))))
(if (<= t_1 -2e+41)
t_2
(if (<= t_1 -2e+23)
(* x 2.0)
(if (<= t_1 -400.0)
(* a (* 27.0 b))
(if (<= t_1 2e+69)
t_3
(if (<= t_1 2e+129) t_2 (if (<= t_1 4e+160) t_3 t_1))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double t_2 = 27.0 * (a * b);
double t_3 = y * (z * (-9.0 * t));
double tmp;
if (t_1 <= -2e+41) {
tmp = t_2;
} else if (t_1 <= -2e+23) {
tmp = x * 2.0;
} else if (t_1 <= -400.0) {
tmp = a * (27.0 * b);
} else if (t_1 <= 2e+69) {
tmp = t_3;
} else if (t_1 <= 2e+129) {
tmp = t_2;
} else if (t_1 <= 4e+160) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = b * (a * 27.0d0)
t_2 = 27.0d0 * (a * b)
t_3 = y * (z * ((-9.0d0) * t))
if (t_1 <= (-2d+41)) then
tmp = t_2
else if (t_1 <= (-2d+23)) then
tmp = x * 2.0d0
else if (t_1 <= (-400.0d0)) then
tmp = a * (27.0d0 * b)
else if (t_1 <= 2d+69) then
tmp = t_3
else if (t_1 <= 2d+129) then
tmp = t_2
else if (t_1 <= 4d+160) then
tmp = t_3
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double t_2 = 27.0 * (a * b);
double t_3 = y * (z * (-9.0 * t));
double tmp;
if (t_1 <= -2e+41) {
tmp = t_2;
} else if (t_1 <= -2e+23) {
tmp = x * 2.0;
} else if (t_1 <= -400.0) {
tmp = a * (27.0 * b);
} else if (t_1 <= 2e+69) {
tmp = t_3;
} else if (t_1 <= 2e+129) {
tmp = t_2;
} else if (t_1 <= 4e+160) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) t_2 = 27.0 * (a * b) t_3 = y * (z * (-9.0 * t)) tmp = 0 if t_1 <= -2e+41: tmp = t_2 elif t_1 <= -2e+23: tmp = x * 2.0 elif t_1 <= -400.0: tmp = a * (27.0 * b) elif t_1 <= 2e+69: tmp = t_3 elif t_1 <= 2e+129: tmp = t_2 elif t_1 <= 4e+160: tmp = t_3 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) t_2 = Float64(27.0 * Float64(a * b)) t_3 = Float64(y * Float64(z * Float64(-9.0 * t))) tmp = 0.0 if (t_1 <= -2e+41) tmp = t_2; elseif (t_1 <= -2e+23) tmp = Float64(x * 2.0); elseif (t_1 <= -400.0) tmp = Float64(a * Float64(27.0 * b)); elseif (t_1 <= 2e+69) tmp = t_3; elseif (t_1 <= 2e+129) tmp = t_2; elseif (t_1 <= 4e+160) tmp = t_3; else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
t_2 = 27.0 * (a * b);
t_3 = y * (z * (-9.0 * t));
tmp = 0.0;
if (t_1 <= -2e+41)
tmp = t_2;
elseif (t_1 <= -2e+23)
tmp = x * 2.0;
elseif (t_1 <= -400.0)
tmp = a * (27.0 * b);
elseif (t_1 <= 2e+69)
tmp = t_3;
elseif (t_1 <= 2e+129)
tmp = t_2;
elseif (t_1 <= 4e+160)
tmp = t_3;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y * N[(z * N[(-9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+41], t$95$2, If[LessEqual[t$95$1, -2e+23], N[(x * 2.0), $MachinePrecision], If[LessEqual[t$95$1, -400.0], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+69], t$95$3, If[LessEqual[t$95$1, 2e+129], t$95$2, If[LessEqual[t$95$1, 4e+160], t$95$3, t$95$1]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
t_3 := y \cdot \left(z \cdot \left(-9 \cdot t\right)\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+41}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{+23}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t_1 \leq -400:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+69}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+129}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+160}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -2.00000000000000001e41 or 2.0000000000000001e69 < (*.f64 (*.f64 a 27) b) < 2e129Initial program 93.9%
sub-neg93.9%
sub-neg93.9%
associate-*l*96.7%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in a around inf 71.4%
if -2.00000000000000001e41 < (*.f64 (*.f64 a 27) b) < -1.9999999999999998e23Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 76.1%
if -1.9999999999999998e23 < (*.f64 (*.f64 a 27) b) < -400Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 67.7%
associate-*r*68.7%
*-commutative68.7%
associate-*r*68.7%
Simplified68.7%
if -400 < (*.f64 (*.f64 a 27) b) < 2.0000000000000001e69 or 2e129 < (*.f64 (*.f64 a 27) b) < 4.00000000000000003e160Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*96.1%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in y around 0 93.0%
*-commutative93.0%
associate-*r*96.0%
*-commutative96.0%
associate-*r*93.0%
*-commutative93.0%
associate-*r*96.7%
associate-*l*96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in t around inf 50.0%
associate-*r*50.0%
*-commutative50.0%
associate-*l*52.4%
*-commutative52.4%
Simplified52.4%
if 4.00000000000000003e160 < (*.f64 (*.f64 a 27) b) Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*96.5%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in a around inf 92.8%
associate-*r*93.1%
*-commutative93.1%
associate-*r*93.0%
Simplified93.0%
add-cbrt-cube57.6%
pow357.6%
Applied egg-rr57.6%
rem-cbrt-cube93.0%
associate-*r*93.1%
Applied egg-rr93.1%
Final simplification62.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (or (<= t_1 -400.0)
(and (not (<= t_1 1e+82))
(or (<= t_1 5e+134) (not (<= t_1 4e+160)))))
(+ (* x 2.0) (* 27.0 (* a b)))
(+ (* x 2.0) (* -9.0 (* t (* y z)))))))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 = b * (a * 27.0);
double tmp;
if ((t_1 <= -400.0) || (!(t_1 <= 1e+82) && ((t_1 <= 5e+134) || !(t_1 <= 4e+160)))) {
tmp = (x * 2.0) + (27.0 * (a * b));
} 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.
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 = b * (a * 27.0d0)
if ((t_1 <= (-400.0d0)) .or. (.not. (t_1 <= 1d+82)) .and. (t_1 <= 5d+134) .or. (.not. (t_1 <= 4d+160))) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) + ((-9.0d0) * (t * (y * z)))
end if
code = tmp
end function
assert 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 = b * (a * 27.0);
double tmp;
if ((t_1 <= -400.0) || (!(t_1 <= 1e+82) && ((t_1 <= 5e+134) || !(t_1 <= 4e+160)))) {
tmp = (x * 2.0) + (27.0 * (a * b));
} 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]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if (t_1 <= -400.0) or (not (t_1 <= 1e+82) and ((t_1 <= 5e+134) or not (t_1 <= 4e+160))): tmp = (x * 2.0) + (27.0 * (a * b)) 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]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if ((t_1 <= -400.0) || (!(t_1 <= 1e+82) && ((t_1 <= 5e+134) || !(t_1 <= 4e+160)))) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(t * Float64(y * z)))); end return tmp end
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 = b * (a * 27.0);
tmp = 0.0;
if ((t_1 <= -400.0) || (~((t_1 <= 1e+82)) && ((t_1 <= 5e+134) || ~((t_1 <= 4e+160)))))
tmp = (x * 2.0) + (27.0 * (a * b));
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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -400.0], And[N[Not[LessEqual[t$95$1, 1e+82]], $MachinePrecision], Or[LessEqual[t$95$1, 5e+134], N[Not[LessEqual[t$95$1, 4e+160]], $MachinePrecision]]]], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_1 \leq -400 \lor \neg \left(t_1 \leq 10^{+82}\right) \land \left(t_1 \leq 5 \cdot 10^{+134} \lor \neg \left(t_1 \leq 4 \cdot 10^{+160}\right)\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -400 or 9.9999999999999996e81 < (*.f64 (*.f64 a 27) b) < 4.99999999999999981e134 or 4.00000000000000003e160 < (*.f64 (*.f64 a 27) b) Initial program 94.2%
sub-neg94.2%
sub-neg94.2%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in y around 0 87.8%
if -400 < (*.f64 (*.f64 a 27) b) < 9.9999999999999996e81 or 4.99999999999999981e134 < (*.f64 (*.f64 a 27) b) < 4.00000000000000003e160Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in a around 0 83.6%
cancel-sign-sub-inv83.6%
metadata-eval83.6%
associate-*l*83.6%
+-commutative83.6%
*-commutative83.6%
*-commutative83.6%
associate-*r*86.8%
*-commutative86.8%
associate-*r*86.7%
associate-*l*86.7%
*-commutative86.7%
Applied egg-rr86.7%
Taylor expanded in t around 0 83.6%
Final simplification85.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (or (<= t_1 -400.0)
(and (not (<= t_1 1e+82))
(or (<= t_1 5e+134) (not (<= t_1 4e+160)))))
(+ (* x 2.0) (* 27.0 (* a b)))
(+ (* x 2.0) (* (* z t) (* y -9.0))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if ((t_1 <= -400.0) || (!(t_1 <= 1e+82) && ((t_1 <= 5e+134) || !(t_1 <= 4e+160)))) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + ((z * t) * (y * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a * 27.0d0)
if ((t_1 <= (-400.0d0)) .or. (.not. (t_1 <= 1d+82)) .and. (t_1 <= 5d+134) .or. (.not. (t_1 <= 4d+160))) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) + ((z * t) * (y * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if ((t_1 <= -400.0) || (!(t_1 <= 1e+82) && ((t_1 <= 5e+134) || !(t_1 <= 4e+160)))) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + ((z * t) * (y * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if (t_1 <= -400.0) or (not (t_1 <= 1e+82) and ((t_1 <= 5e+134) or not (t_1 <= 4e+160))): tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) + ((z * t) * (y * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if ((t_1 <= -400.0) || (!(t_1 <= 1e+82) && ((t_1 <= 5e+134) || !(t_1 <= 4e+160)))) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) + Float64(Float64(z * t) * Float64(y * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
tmp = 0.0;
if ((t_1 <= -400.0) || (~((t_1 <= 1e+82)) && ((t_1 <= 5e+134) || ~((t_1 <= 4e+160)))))
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) + ((z * t) * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -400.0], And[N[Not[LessEqual[t$95$1, 1e+82]], $MachinePrecision], Or[LessEqual[t$95$1, 5e+134], N[Not[LessEqual[t$95$1, 4e+160]], $MachinePrecision]]]], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_1 \leq -400 \lor \neg \left(t_1 \leq 10^{+82}\right) \land \left(t_1 \leq 5 \cdot 10^{+134} \lor \neg \left(t_1 \leq 4 \cdot 10^{+160}\right)\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -400 or 9.9999999999999996e81 < (*.f64 (*.f64 a 27) b) < 4.99999999999999981e134 or 4.00000000000000003e160 < (*.f64 (*.f64 a 27) b) Initial program 94.2%
sub-neg94.2%
sub-neg94.2%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in y around 0 87.8%
if -400 < (*.f64 (*.f64 a 27) b) < 9.9999999999999996e81 or 4.99999999999999981e134 < (*.f64 (*.f64 a 27) b) < 4.00000000000000003e160Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in a around 0 83.6%
cancel-sign-sub-inv83.6%
metadata-eval83.6%
associate-*l*83.6%
+-commutative83.6%
*-commutative83.6%
*-commutative83.6%
associate-*r*86.8%
*-commutative86.8%
associate-*r*86.7%
associate-*l*86.7%
*-commutative86.7%
Applied egg-rr86.7%
Final simplification87.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (<= t_1 -400.0)
(+ (* x 2.0) (* 27.0 (* a b)))
(if (<= t_1 5e-15)
(+ (* x 2.0) (* (* z t) (* y -9.0)))
(+ (* a (* 27.0 b)) (* (* y z) (* -9.0 t)))))))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 = b * (a * 27.0);
double tmp;
if (t_1 <= -400.0) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if (t_1 <= 5e-15) {
tmp = (x * 2.0) + ((z * t) * (y * -9.0));
} else {
tmp = (a * (27.0 * b)) + ((y * z) * (-9.0 * t));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a * 27.0d0)
if (t_1 <= (-400.0d0)) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else if (t_1 <= 5d-15) then
tmp = (x * 2.0d0) + ((z * t) * (y * (-9.0d0)))
else
tmp = (a * (27.0d0 * b)) + ((y * z) * ((-9.0d0) * t))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (t_1 <= -400.0) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if (t_1 <= 5e-15) {
tmp = (x * 2.0) + ((z * t) * (y * -9.0));
} else {
tmp = (a * (27.0 * b)) + ((y * z) * (-9.0 * t));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if t_1 <= -400.0: tmp = (x * 2.0) + (27.0 * (a * b)) elif t_1 <= 5e-15: tmp = (x * 2.0) + ((z * t) * (y * -9.0)) else: tmp = (a * (27.0 * b)) + ((y * z) * (-9.0 * t)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (t_1 <= -400.0) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); elseif (t_1 <= 5e-15) tmp = Float64(Float64(x * 2.0) + Float64(Float64(z * t) * Float64(y * -9.0))); else tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(y * z) * Float64(-9.0 * t))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
tmp = 0.0;
if (t_1 <= -400.0)
tmp = (x * 2.0) + (27.0 * (a * b));
elseif (t_1 <= 5e-15)
tmp = (x * 2.0) + ((z * t) * (y * -9.0));
else
tmp = (a * (27.0 * b)) + ((y * z) * (-9.0 * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -400.0], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-15], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] * N[(-9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_1 \leq -400:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-15}:\\
\;\;\;\;x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(y \cdot z\right) \cdot \left(-9 \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -400Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*96.5%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in y around 0 85.6%
if -400 < (*.f64 (*.f64 a 27) b) < 4.99999999999999999e-15Initial program 92.2%
sub-neg92.2%
sub-neg92.2%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in a around 0 86.3%
cancel-sign-sub-inv86.3%
metadata-eval86.3%
associate-*l*86.3%
+-commutative86.3%
*-commutative86.3%
*-commutative86.3%
associate-*r*90.1%
*-commutative90.1%
associate-*r*90.1%
associate-*l*90.1%
*-commutative90.1%
Applied egg-rr90.1%
if 4.99999999999999999e-15 < (*.f64 (*.f64 a 27) b) Initial program 95.6%
sub-neg95.6%
sub-neg95.6%
associate-*l*97.0%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in x around 0 84.4%
sub-neg84.4%
+-commutative84.4%
distribute-lft-neg-in84.4%
associate-*r*84.4%
metadata-eval84.4%
*-commutative84.4%
associate-*r*84.5%
*-commutative84.5%
Applied egg-rr84.5%
Final simplification87.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* y z)))))
(if (<= z -245.0)
t_1
(if (<= z -5.8e-158)
(* a (* 27.0 b))
(if (<= z -5.2e-236)
(* x 2.0)
(if (<= z 9e-129) (* 27.0 (* a b)) t_1))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (y * z));
double tmp;
if (z <= -245.0) {
tmp = t_1;
} else if (z <= -5.8e-158) {
tmp = a * (27.0 * b);
} else if (z <= -5.2e-236) {
tmp = x * 2.0;
} else if (z <= 9e-129) {
tmp = 27.0 * (a * b);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (t * (y * z))
if (z <= (-245.0d0)) then
tmp = t_1
else if (z <= (-5.8d-158)) then
tmp = a * (27.0d0 * b)
else if (z <= (-5.2d-236)) then
tmp = x * 2.0d0
else if (z <= 9d-129) then
tmp = 27.0d0 * (a * b)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (y * z));
double tmp;
if (z <= -245.0) {
tmp = t_1;
} else if (z <= -5.8e-158) {
tmp = a * (27.0 * b);
} else if (z <= -5.2e-236) {
tmp = x * 2.0;
} else if (z <= 9e-129) {
tmp = 27.0 * (a * b);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (y * z)) tmp = 0 if z <= -245.0: tmp = t_1 elif z <= -5.8e-158: tmp = a * (27.0 * b) elif z <= -5.2e-236: tmp = x * 2.0 elif z <= 9e-129: tmp = 27.0 * (a * b) else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (z <= -245.0) tmp = t_1; elseif (z <= -5.8e-158) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= -5.2e-236) tmp = Float64(x * 2.0); elseif (z <= 9e-129) tmp = Float64(27.0 * Float64(a * b)); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (y * z));
tmp = 0.0;
if (z <= -245.0)
tmp = t_1;
elseif (z <= -5.8e-158)
tmp = a * (27.0 * b);
elseif (z <= -5.2e-236)
tmp = x * 2.0;
elseif (z <= 9e-129)
tmp = 27.0 * (a * b);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -245.0], t$95$1, If[LessEqual[z, -5.8e-158], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.2e-236], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 9e-129], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -245:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-158}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-236}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-129}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -245 or 9.00000000000000061e-129 < z Initial program 88.8%
sub-neg88.8%
sub-neg88.8%
associate-*l*94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in y around inf 48.6%
if -245 < z < -5.79999999999999961e-158Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 41.3%
associate-*r*41.3%
*-commutative41.3%
associate-*r*41.3%
Simplified41.3%
if -5.79999999999999961e-158 < z < -5.2000000000000001e-236Initial program 99.5%
sub-neg99.5%
sub-neg99.5%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 40.9%
if -5.2000000000000001e-236 < z < 9.00000000000000061e-129Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*98.1%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in a around inf 52.4%
Final simplification47.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (* z (* y -9.0)))))
(if (<= z -90.0)
t_1
(if (<= z -5e-158)
(* a (* 27.0 b))
(if (<= z -5e-237)
(* x 2.0)
(if (<= z 1.8e-129) (* 27.0 (* a b)) t_1))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (z * (y * -9.0));
double tmp;
if (z <= -90.0) {
tmp = t_1;
} else if (z <= -5e-158) {
tmp = a * (27.0 * b);
} else if (z <= -5e-237) {
tmp = x * 2.0;
} else if (z <= 1.8e-129) {
tmp = 27.0 * (a * b);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (z * (y * (-9.0d0)))
if (z <= (-90.0d0)) then
tmp = t_1
else if (z <= (-5d-158)) then
tmp = a * (27.0d0 * b)
else if (z <= (-5d-237)) then
tmp = x * 2.0d0
else if (z <= 1.8d-129) then
tmp = 27.0d0 * (a * b)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (z * (y * -9.0));
double tmp;
if (z <= -90.0) {
tmp = t_1;
} else if (z <= -5e-158) {
tmp = a * (27.0 * b);
} else if (z <= -5e-237) {
tmp = x * 2.0;
} else if (z <= 1.8e-129) {
tmp = 27.0 * (a * b);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = t * (z * (y * -9.0)) tmp = 0 if z <= -90.0: tmp = t_1 elif z <= -5e-158: tmp = a * (27.0 * b) elif z <= -5e-237: tmp = x * 2.0 elif z <= 1.8e-129: tmp = 27.0 * (a * b) else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(z * Float64(y * -9.0))) tmp = 0.0 if (z <= -90.0) tmp = t_1; elseif (z <= -5e-158) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= -5e-237) tmp = Float64(x * 2.0); elseif (z <= 1.8e-129) tmp = Float64(27.0 * Float64(a * b)); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = t * (z * (y * -9.0));
tmp = 0.0;
if (z <= -90.0)
tmp = t_1;
elseif (z <= -5e-158)
tmp = a * (27.0 * b);
elseif (z <= -5e-237)
tmp = x * 2.0;
elseif (z <= 1.8e-129)
tmp = 27.0 * (a * b);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -90.0], t$95$1, If[LessEqual[z, -5e-158], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5e-237], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.8e-129], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{if}\;z \leq -90:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-158}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-237}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-129}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -90 or 1.8e-129 < z Initial program 88.8%
sub-neg88.8%
sub-neg88.8%
associate-*l*94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in x around 0 68.9%
pow168.9%
Applied egg-rr68.9%
unpow168.9%
associate-*r*76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in a around 0 48.6%
associate-*r*48.6%
*-commutative48.6%
associate-*l*48.6%
associate-*l*48.5%
*-commutative48.5%
*-commutative48.5%
Simplified48.5%
if -90 < z < -4.99999999999999972e-158Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 41.3%
associate-*r*41.3%
*-commutative41.3%
associate-*r*41.3%
Simplified41.3%
if -4.99999999999999972e-158 < z < -5.0000000000000002e-237Initial program 99.5%
sub-neg99.5%
sub-neg99.5%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 40.9%
if -5.0000000000000002e-237 < z < 1.8e-129Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*98.1%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in a around inf 52.4%
Final simplification47.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* 27.0 b))))
(if (<= (* y 9.0) -2e+51)
(+ t_1 (- (* x 2.0) (* (* y 9.0) (* z t))))
(+ (- (* x 2.0) (* (* y t) (* 9.0 z))) t_1))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if ((y * 9.0) <= -2e+51) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - ((y * t) * (9.0 * z))) + t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if ((y * 9.0d0) <= (-2d+51)) then
tmp = t_1 + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
else
tmp = ((x * 2.0d0) - ((y * t) * (9.0d0 * z))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if ((y * 9.0) <= -2e+51) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - ((y * t) * (9.0 * z))) + t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) tmp = 0 if (y * 9.0) <= -2e+51: tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t))) else: tmp = ((x * 2.0) - ((y * t) * (9.0 * z))) + t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (Float64(y * 9.0) <= -2e+51) tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * t) * Float64(9.0 * z))) + t_1); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
tmp = 0.0;
if ((y * 9.0) <= -2e+51)
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
else
tmp = ((x * 2.0) - ((y * t) * (9.0 * z))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * 9.0), $MachinePrecision], -2e+51], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * t), $MachinePrecision] * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;y \cdot 9 \leq -2 \cdot 10^{+51}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot t\right) \cdot \left(9 \cdot z\right)\right) + t_1\\
\end{array}
\end{array}
if (*.f64 y 9) < -2e51Initial program 85.8%
sub-neg85.8%
sub-neg85.8%
associate-*l*97.9%
associate-*l*97.9%
Simplified97.9%
if -2e51 < (*.f64 y 9) Initial program 95.5%
sub-neg95.5%
sub-neg95.5%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in y around 0 95.5%
*-commutative95.5%
associate-*r*96.0%
*-commutative96.0%
associate-*r*95.5%
*-commutative95.5%
associate-*r*96.9%
associate-*l*96.9%
*-commutative96.9%
Simplified96.9%
Final simplification97.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (<= t_1 -2e+41)
(* 27.0 (* a b))
(if (<= t_1 0.0004) (* x 2.0) (* a (* 27.0 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 = b * (a * 27.0);
double tmp;
if (t_1 <= -2e+41) {
tmp = 27.0 * (a * b);
} else if (t_1 <= 0.0004) {
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.
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 = b * (a * 27.0d0)
if (t_1 <= (-2d+41)) then
tmp = 27.0d0 * (a * b)
else if (t_1 <= 0.0004d0) 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;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (t_1 <= -2e+41) {
tmp = 27.0 * (a * b);
} else if (t_1 <= 0.0004) {
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]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if t_1 <= -2e+41: tmp = 27.0 * (a * b) elif t_1 <= 0.0004: 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]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (t_1 <= -2e+41) tmp = Float64(27.0 * Float64(a * b)); elseif (t_1 <= 0.0004) 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
tmp = 0.0;
if (t_1 <= -2e+41)
tmp = 27.0 * (a * b);
elseif (t_1 <= 0.0004)
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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+41], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0004], 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])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+41}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;t_1 \leq 0.0004:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -2.00000000000000001e41Initial program 92.2%
sub-neg92.2%
sub-neg92.2%
associate-*l*95.8%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in a around inf 74.9%
if -2.00000000000000001e41 < (*.f64 (*.f64 a 27) b) < 4.00000000000000019e-4Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*96.3%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in x around inf 42.5%
if 4.00000000000000019e-4 < (*.f64 (*.f64 a 27) b) Initial program 95.6%
sub-neg95.6%
sub-neg95.6%
associate-*l*97.0%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in a around inf 61.3%
associate-*r*61.4%
*-commutative61.4%
associate-*r*61.3%
Simplified61.3%
Final simplification54.0%
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 -85000.0) (* y (* z (* -9.0 t))) (if (<= z 2e-26) (+ (* x 2.0) (* 27.0 (* a b))) (* (* y t) (* 9.0 (- z))))))
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 <= -85000.0) {
tmp = y * (z * (-9.0 * t));
} else if (z <= 2e-26) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (y * t) * (9.0 * -z);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-85000.0d0)) then
tmp = y * (z * ((-9.0d0) * t))
else if (z <= 2d-26) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (y * t) * (9.0d0 * -z)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -85000.0) {
tmp = y * (z * (-9.0 * t));
} else if (z <= 2e-26) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (y * t) * (9.0 * -z);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -85000.0: tmp = y * (z * (-9.0 * t)) elif z <= 2e-26: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (y * t) * (9.0 * -z) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -85000.0) tmp = Float64(y * Float64(z * Float64(-9.0 * t))); elseif (z <= 2e-26) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(y * t) * Float64(9.0 * Float64(-z))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -85000.0)
tmp = y * (z * (-9.0 * t));
elseif (z <= 2e-26)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (y * t) * (9.0 * -z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -85000.0], N[(y * N[(z * N[(-9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-26], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * t), $MachinePrecision] * N[(9.0 * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -85000:\\
\;\;\;\;y \cdot \left(z \cdot \left(-9 \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-26}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(9 \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if z < -85000Initial program 74.5%
sub-neg74.5%
sub-neg74.5%
associate-*l*90.2%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in y around 0 74.6%
*-commutative74.6%
associate-*r*90.3%
*-commutative90.3%
associate-*r*74.6%
*-commutative74.6%
associate-*r*95.0%
associate-*l*95.0%
*-commutative95.0%
Simplified95.0%
Taylor expanded in t around inf 45.3%
associate-*r*45.2%
*-commutative45.2%
associate-*l*58.7%
*-commutative58.7%
Simplified58.7%
if -85000 < z < 2.0000000000000001e-26Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.0%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in y around 0 78.4%
if 2.0000000000000001e-26 < z Initial program 92.9%
sub-neg92.9%
sub-neg92.9%
associate-*l*95.3%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in y around 0 92.9%
*-commutative92.9%
associate-*r*95.3%
*-commutative95.3%
associate-*r*92.9%
*-commutative92.9%
associate-*r*98.6%
associate-*l*98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in t around inf 52.4%
associate-*r*52.4%
*-commutative52.4%
associate-*l*52.4%
*-commutative52.4%
Simplified52.4%
Taylor expanded in z around 0 52.4%
*-commutative52.4%
associate-*r*52.4%
metadata-eval52.4%
*-commutative52.4%
associate-*r*54.5%
distribute-lft-neg-in54.5%
*-commutative54.5%
*-commutative54.5%
associate-*l*54.6%
Applied egg-rr54.6%
Final simplification67.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* y t) (* 9.0 z))) (* a (* 27.0 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) - ((y * t) * (9.0 * z))) + (a * (27.0 * b));
}
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) - ((y * t) * (9.0d0 * z))) + (a * (27.0d0 * b))
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - ((y * t) * (9.0 * z))) + (a * (27.0 * 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) - ((y * t) * (9.0 * z))) + (a * (27.0 * b))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * t) * Float64(9.0 * z))) + Float64(a * Float64(27.0 * b))) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((x * 2.0) - ((y * t) * (9.0 * z))) + (a * (27.0 * b));
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * t), $MachinePrecision] * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(x \cdot 2 - \left(y \cdot t\right) \cdot \left(9 \cdot z\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in y around 0 93.4%
*-commutative93.4%
associate-*r*96.4%
*-commutative96.4%
associate-*r*93.4%
*-commutative93.4%
associate-*r*95.6%
associate-*l*95.7%
*-commutative95.7%
Simplified95.7%
Final simplification95.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.08e+39) (not (<= a 1.05e-144))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.08e+39) || !(a <= 1.05e-144)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.08d+39)) .or. (.not. (a <= 1.05d-144))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.08e+39) || !(a <= 1.05e-144)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.08e+39) or not (a <= 1.05e-144): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.08e+39) || !(a <= 1.05e-144)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -1.08e+39) || ~((a <= 1.05e-144)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.08e+39], N[Not[LessEqual[a, 1.05e-144]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.08 \cdot 10^{+39} \lor \neg \left(a \leq 1.05 \cdot 10^{-144}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -1.07999999999999998e39 or 1.0500000000000001e-144 < a Initial program 94.0%
sub-neg94.0%
sub-neg94.0%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around inf 52.8%
if -1.07999999999999998e39 < a < 1.0500000000000001e-144Initial program 92.6%
sub-neg92.6%
sub-neg92.6%
associate-*l*97.9%
associate-*l*97.9%
Simplified97.9%
Taylor expanded in x around inf 40.9%
Final simplification47.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 28.4%
Final simplification28.4%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024026
(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)))