
(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. (FPCore (x y z t a b) :precision binary64 (if (<= t 1e+116) (+ (- (* x 2.0) (* (* y 9.0) (* t z))) (* a (* 27.0 b))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -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 tmp;
if (t <= 1e+116) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -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) tmp = 0.0 if (t <= 1e+116) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(t * z))) + Float64(a * Float64(27.0 * b))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 1e+116], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $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}\;t \leq 10^{+116}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if t < 1.00000000000000002e116Initial program 90.8%
sub-neg90.8%
sub-neg90.8%
associate-*l*94.8%
associate-*l*94.7%
Simplified94.7%
if 1.00000000000000002e116 < t Initial program 97.5%
+-commutative97.5%
associate-+r-97.5%
*-commutative97.5%
cancel-sign-sub-inv97.5%
associate-*r*90.8%
distribute-lft-neg-in90.8%
*-commutative90.8%
cancel-sign-sub-inv90.8%
associate-+r-90.8%
associate-*l*90.8%
fma-def93.2%
cancel-sign-sub-inv93.2%
fma-def93.2%
distribute-lft-neg-in93.2%
distribute-rgt-neg-in93.2%
*-commutative93.2%
associate-*r*99.9%
associate-*l*99.9%
neg-mul-199.9%
associate-*r*99.9%
Simplified99.9%
Final simplification95.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 9.0 (* t (* y z))))
(t_2 (* b (* a 27.0)))
(t_3 (* 27.0 (* a b)))
(t_4 (- t_3 t_1)))
(if (<= t_2 -4e+163)
t_4
(if (<= t_2 -2e+66)
(+ (* x 2.0) t_3)
(if (or (<= t_2 -1e-18) (not (<= t_2 2.6e+69)))
t_4
(- (* x 2.0) t_1))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 9.0 * (t * (y * z));
double t_2 = b * (a * 27.0);
double t_3 = 27.0 * (a * b);
double t_4 = t_3 - t_1;
double tmp;
if (t_2 <= -4e+163) {
tmp = t_4;
} else if (t_2 <= -2e+66) {
tmp = (x * 2.0) + t_3;
} else if ((t_2 <= -1e-18) || !(t_2 <= 2.6e+69)) {
tmp = t_4;
} else {
tmp = (x * 2.0) - t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = 9.0d0 * (t * (y * z))
t_2 = b * (a * 27.0d0)
t_3 = 27.0d0 * (a * b)
t_4 = t_3 - t_1
if (t_2 <= (-4d+163)) then
tmp = t_4
else if (t_2 <= (-2d+66)) then
tmp = (x * 2.0d0) + t_3
else if ((t_2 <= (-1d-18)) .or. (.not. (t_2 <= 2.6d+69))) then
tmp = t_4
else
tmp = (x * 2.0d0) - t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 9.0 * (t * (y * z));
double t_2 = b * (a * 27.0);
double t_3 = 27.0 * (a * b);
double t_4 = t_3 - t_1;
double tmp;
if (t_2 <= -4e+163) {
tmp = t_4;
} else if (t_2 <= -2e+66) {
tmp = (x * 2.0) + t_3;
} else if ((t_2 <= -1e-18) || !(t_2 <= 2.6e+69)) {
tmp = t_4;
} else {
tmp = (x * 2.0) - t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 9.0 * (t * (y * z)) t_2 = b * (a * 27.0) t_3 = 27.0 * (a * b) t_4 = t_3 - t_1 tmp = 0 if t_2 <= -4e+163: tmp = t_4 elif t_2 <= -2e+66: tmp = (x * 2.0) + t_3 elif (t_2 <= -1e-18) or not (t_2 <= 2.6e+69): tmp = t_4 else: tmp = (x * 2.0) - t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(9.0 * Float64(t * Float64(y * z))) t_2 = Float64(b * Float64(a * 27.0)) t_3 = Float64(27.0 * Float64(a * b)) t_4 = Float64(t_3 - t_1) tmp = 0.0 if (t_2 <= -4e+163) tmp = t_4; elseif (t_2 <= -2e+66) tmp = Float64(Float64(x * 2.0) + t_3); elseif ((t_2 <= -1e-18) || !(t_2 <= 2.6e+69)) tmp = t_4; else tmp = Float64(Float64(x * 2.0) - t_1); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 9.0 * (t * (y * z));
t_2 = b * (a * 27.0);
t_3 = 27.0 * (a * b);
t_4 = t_3 - t_1;
tmp = 0.0;
if (t_2 <= -4e+163)
tmp = t_4;
elseif (t_2 <= -2e+66)
tmp = (x * 2.0) + t_3;
elseif ((t_2 <= -1e-18) || ~((t_2 <= 2.6e+69)))
tmp = t_4;
else
tmp = (x * 2.0) - t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+163], t$95$4, If[LessEqual[t$95$2, -2e+66], N[(N[(x * 2.0), $MachinePrecision] + t$95$3), $MachinePrecision], If[Or[LessEqual[t$95$2, -1e-18], N[Not[LessEqual[t$95$2, 2.6e+69]], $MachinePrecision]], t$95$4, N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_2 := b \cdot \left(a \cdot 27\right)\\
t_3 := 27 \cdot \left(a \cdot b\right)\\
t_4 := t\_3 - t\_1\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+163}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+66}:\\
\;\;\;\;x \cdot 2 + t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-18} \lor \neg \left(t\_2 \leq 2.6 \cdot 10^{+69}\right):\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -3.9999999999999998e163 or -1.99999999999999989e66 < (*.f64 (*.f64 a 27) b) < -1.0000000000000001e-18 or 2.6000000000000002e69 < (*.f64 (*.f64 a 27) b) Initial program 89.7%
sub-neg89.7%
sub-neg89.7%
associate-*l*91.3%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in x around 0 85.8%
if -3.9999999999999998e163 < (*.f64 (*.f64 a 27) b) < -1.99999999999999989e66Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*94.0%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in y around 0 83.2%
if -1.0000000000000001e-18 < (*.f64 (*.f64 a 27) b) < 2.6000000000000002e69Initial program 93.7%
sub-neg93.7%
sub-neg93.7%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in a around 0 88.4%
Final simplification86.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 (if (<= (+ (- (* x 2.0) (* t (* (* y 9.0) z))) (* b (* a 27.0))) INFINITY) (+ (- (* x 2.0) (* (* y 9.0) (* t z))) (* a (* 27.0 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 tmp;
if ((((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0))) <= ((double) INFINITY)) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0))) <= Double.POSITIVE_INFINITY) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * 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): tmp = 0 if (((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0))) <= math.inf: tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * 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) tmp = 0.0 if (Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(Float64(y * 9.0) * z))) + Float64(b * Float64(a * 27.0))) <= Inf) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(t * z))) + Float64(a * Float64(27.0 * 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)
tmp = 0.0;
if ((((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0))) <= Inf)
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * 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_] := If[LessEqual[N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\mathbf{if}\;\left(x \cdot 2 - t \cdot \left(\left(y \cdot 9\right) \cdot z\right)\right) + b \cdot \left(a \cdot 27\right) \leq \infty:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\right) + a \cdot \left(27 \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 (*.f64 x 2) (*.f64 (*.f64 (*.f64 y 9) z) t)) (*.f64 (*.f64 a 27) b)) < +inf.0Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*96.8%
associate-*l*96.8%
Simplified96.8%
if +inf.0 < (+.f64 (-.f64 (*.f64 x 2) (*.f64 (*.f64 (*.f64 y 9) z) t)) (*.f64 (*.f64 a 27) b)) Initial program 0.0%
sub-neg0.0%
sub-neg0.0%
associate-*l*0.0%
associate-*l*0.0%
Simplified0.0%
Taylor expanded in a around 0 75.0%
Final simplification96.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 (* -9.0 (* t (* y z)))))
(if (<= y -1.32e+100)
t_1
(if (<= y -4.2e+86)
(* x 2.0)
(if (<= y -1.1e+30)
t_1
(if (<= y -1.1e-255)
(* a (* 27.0 b))
(if (<= y 1.02e-290)
(* x 2.0)
(if (<= y 1.15e-91) (* 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 (y <= -1.32e+100) {
tmp = t_1;
} else if (y <= -4.2e+86) {
tmp = x * 2.0;
} else if (y <= -1.1e+30) {
tmp = t_1;
} else if (y <= -1.1e-255) {
tmp = a * (27.0 * b);
} else if (y <= 1.02e-290) {
tmp = x * 2.0;
} else if (y <= 1.15e-91) {
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 (y <= (-1.32d+100)) then
tmp = t_1
else if (y <= (-4.2d+86)) then
tmp = x * 2.0d0
else if (y <= (-1.1d+30)) then
tmp = t_1
else if (y <= (-1.1d-255)) then
tmp = a * (27.0d0 * b)
else if (y <= 1.02d-290) then
tmp = x * 2.0d0
else if (y <= 1.15d-91) 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 (y <= -1.32e+100) {
tmp = t_1;
} else if (y <= -4.2e+86) {
tmp = x * 2.0;
} else if (y <= -1.1e+30) {
tmp = t_1;
} else if (y <= -1.1e-255) {
tmp = a * (27.0 * b);
} else if (y <= 1.02e-290) {
tmp = x * 2.0;
} else if (y <= 1.15e-91) {
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 y <= -1.32e+100: tmp = t_1 elif y <= -4.2e+86: tmp = x * 2.0 elif y <= -1.1e+30: tmp = t_1 elif y <= -1.1e-255: tmp = a * (27.0 * b) elif y <= 1.02e-290: tmp = x * 2.0 elif y <= 1.15e-91: 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 (y <= -1.32e+100) tmp = t_1; elseif (y <= -4.2e+86) tmp = Float64(x * 2.0); elseif (y <= -1.1e+30) tmp = t_1; elseif (y <= -1.1e-255) tmp = Float64(a * Float64(27.0 * b)); elseif (y <= 1.02e-290) tmp = Float64(x * 2.0); elseif (y <= 1.15e-91) 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 (y <= -1.32e+100)
tmp = t_1;
elseif (y <= -4.2e+86)
tmp = x * 2.0;
elseif (y <= -1.1e+30)
tmp = t_1;
elseif (y <= -1.1e-255)
tmp = a * (27.0 * b);
elseif (y <= 1.02e-290)
tmp = x * 2.0;
elseif (y <= 1.15e-91)
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[y, -1.32e+100], t$95$1, If[LessEqual[y, -4.2e+86], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -1.1e+30], t$95$1, If[LessEqual[y, -1.1e-255], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e-290], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, 1.15e-91], 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}\;y \leq -1.32 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{+86}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-255}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{-290}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-91}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.32e100 or -4.1999999999999998e86 < y < -1.1e30 or 1.14999999999999998e-91 < y Initial program 86.6%
sub-neg86.6%
sub-neg86.6%
associate-*l*94.4%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in y around inf 56.8%
if -1.32e100 < y < -4.1999999999999998e86 or -1.1e-255 < y < 1.02e-290Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*87.4%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in x around inf 70.2%
if -1.1e30 < y < -1.1e-255Initial program 97.9%
sub-neg97.9%
sub-neg97.9%
associate-*l*93.0%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in a around inf 53.6%
associate-*r*53.7%
*-commutative53.7%
associate-*r*53.8%
Simplified53.8%
if 1.02e-290 < y < 1.14999999999999998e-91Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*95.2%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in a around inf 50.2%
Final simplification56.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
(let* ((t_1 (* t (* -9.0 (* y z)))))
(if (<= y -1.2e+100)
t_1
(if (<= y -4.2e+86)
(* x 2.0)
(if (<= y -1.35e+30)
t_1
(if (<= y -3.5e-258)
(* a (* 27.0 b))
(if (<= y 8.2e-296)
(* x 2.0)
(if (<= y 2e-92) (* 27.0 (* a b)) (* -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 = t * (-9.0 * (y * z));
double tmp;
if (y <= -1.2e+100) {
tmp = t_1;
} else if (y <= -4.2e+86) {
tmp = x * 2.0;
} else if (y <= -1.35e+30) {
tmp = t_1;
} else if (y <= -3.5e-258) {
tmp = a * (27.0 * b);
} else if (y <= 8.2e-296) {
tmp = x * 2.0;
} else if (y <= 2e-92) {
tmp = 27.0 * (a * b);
} 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.
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 * ((-9.0d0) * (y * z))
if (y <= (-1.2d+100)) then
tmp = t_1
else if (y <= (-4.2d+86)) then
tmp = x * 2.0d0
else if (y <= (-1.35d+30)) then
tmp = t_1
else if (y <= (-3.5d-258)) then
tmp = a * (27.0d0 * b)
else if (y <= 8.2d-296) then
tmp = x * 2.0d0
else if (y <= 2d-92) then
tmp = 27.0d0 * (a * b)
else
tmp = (-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 = t * (-9.0 * (y * z));
double tmp;
if (y <= -1.2e+100) {
tmp = t_1;
} else if (y <= -4.2e+86) {
tmp = x * 2.0;
} else if (y <= -1.35e+30) {
tmp = t_1;
} else if (y <= -3.5e-258) {
tmp = a * (27.0 * b);
} else if (y <= 8.2e-296) {
tmp = x * 2.0;
} else if (y <= 2e-92) {
tmp = 27.0 * (a * b);
} else {
tmp = -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 = t * (-9.0 * (y * z)) tmp = 0 if y <= -1.2e+100: tmp = t_1 elif y <= -4.2e+86: tmp = x * 2.0 elif y <= -1.35e+30: tmp = t_1 elif y <= -3.5e-258: tmp = a * (27.0 * b) elif y <= 8.2e-296: tmp = x * 2.0 elif y <= 2e-92: tmp = 27.0 * (a * b) else: tmp = -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(t * Float64(-9.0 * Float64(y * z))) tmp = 0.0 if (y <= -1.2e+100) tmp = t_1; elseif (y <= -4.2e+86) tmp = Float64(x * 2.0); elseif (y <= -1.35e+30) tmp = t_1; elseif (y <= -3.5e-258) tmp = Float64(a * Float64(27.0 * b)); elseif (y <= 8.2e-296) tmp = Float64(x * 2.0); elseif (y <= 2e-92) tmp = Float64(27.0 * Float64(a * b)); 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = t * (-9.0 * (y * z));
tmp = 0.0;
if (y <= -1.2e+100)
tmp = t_1;
elseif (y <= -4.2e+86)
tmp = x * 2.0;
elseif (y <= -1.35e+30)
tmp = t_1;
elseif (y <= -3.5e-258)
tmp = a * (27.0 * b);
elseif (y <= 8.2e-296)
tmp = x * 2.0;
elseif (y <= 2e-92)
tmp = 27.0 * (a * b);
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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(-9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.2e+100], t$95$1, If[LessEqual[y, -4.2e+86], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -1.35e+30], t$95$1, If[LessEqual[y, -3.5e-258], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e-296], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, 2e-92], N[(27.0 * N[(a * b), $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])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{+86}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-258}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-296}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-92}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if y < -1.20000000000000006e100 or -4.1999999999999998e86 < y < -1.3499999999999999e30Initial program 83.4%
sub-neg83.4%
sub-neg83.4%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around 0 58.1%
sub-neg58.1%
+-commutative58.1%
*-commutative58.1%
distribute-rgt-neg-in58.1%
*-commutative58.1%
associate-*l*65.3%
metadata-eval65.3%
associate-*r*65.3%
*-commutative65.3%
associate-*l*65.3%
Applied egg-rr65.3%
Taylor expanded in y around inf 55.3%
*-commutative55.3%
associate-*l*55.3%
Simplified55.3%
if -1.20000000000000006e100 < y < -4.1999999999999998e86 or -3.50000000000000001e-258 < y < 8.19999999999999988e-296Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*87.4%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in x around inf 70.2%
if -1.3499999999999999e30 < y < -3.50000000000000001e-258Initial program 97.9%
sub-neg97.9%
sub-neg97.9%
associate-*l*93.0%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in a around inf 53.6%
associate-*r*53.7%
*-commutative53.7%
associate-*r*53.8%
Simplified53.8%
if 8.19999999999999988e-296 < y < 1.99999999999999998e-92Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*95.2%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in a around inf 50.2%
if 1.99999999999999998e-92 < y Initial program 88.4%
sub-neg88.4%
sub-neg88.4%
associate-*l*93.5%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in y around inf 57.7%
Final simplification56.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 (<= y -1.25e+100)
(* y (* z (* t -9.0)))
(if (<= y -2.25e+86)
(* x 2.0)
(if (<= y -1.15e+30)
(* t (* -9.0 (* y z)))
(if (<= y -1.16e-259)
(* a (* 27.0 b))
(if (<= y 1.4e-294)
(* x 2.0)
(if (<= y 4.9e-92) (* 27.0 (* a b)) (* -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 tmp;
if (y <= -1.25e+100) {
tmp = y * (z * (t * -9.0));
} else if (y <= -2.25e+86) {
tmp = x * 2.0;
} else if (y <= -1.15e+30) {
tmp = t * (-9.0 * (y * z));
} else if (y <= -1.16e-259) {
tmp = a * (27.0 * b);
} else if (y <= 1.4e-294) {
tmp = x * 2.0;
} else if (y <= 4.9e-92) {
tmp = 27.0 * (a * b);
} 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.
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 <= (-1.25d+100)) then
tmp = y * (z * (t * (-9.0d0)))
else if (y <= (-2.25d+86)) then
tmp = x * 2.0d0
else if (y <= (-1.15d+30)) then
tmp = t * ((-9.0d0) * (y * z))
else if (y <= (-1.16d-259)) then
tmp = a * (27.0d0 * b)
else if (y <= 1.4d-294) then
tmp = x * 2.0d0
else if (y <= 4.9d-92) then
tmp = 27.0d0 * (a * b)
else
tmp = (-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 tmp;
if (y <= -1.25e+100) {
tmp = y * (z * (t * -9.0));
} else if (y <= -2.25e+86) {
tmp = x * 2.0;
} else if (y <= -1.15e+30) {
tmp = t * (-9.0 * (y * z));
} else if (y <= -1.16e-259) {
tmp = a * (27.0 * b);
} else if (y <= 1.4e-294) {
tmp = x * 2.0;
} else if (y <= 4.9e-92) {
tmp = 27.0 * (a * b);
} else {
tmp = -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): tmp = 0 if y <= -1.25e+100: tmp = y * (z * (t * -9.0)) elif y <= -2.25e+86: tmp = x * 2.0 elif y <= -1.15e+30: tmp = t * (-9.0 * (y * z)) elif y <= -1.16e-259: tmp = a * (27.0 * b) elif y <= 1.4e-294: tmp = x * 2.0 elif y <= 4.9e-92: tmp = 27.0 * (a * b) else: tmp = -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) tmp = 0.0 if (y <= -1.25e+100) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (y <= -2.25e+86) tmp = Float64(x * 2.0); elseif (y <= -1.15e+30) tmp = Float64(t * Float64(-9.0 * Float64(y * z))); elseif (y <= -1.16e-259) tmp = Float64(a * Float64(27.0 * b)); elseif (y <= 1.4e-294) tmp = Float64(x * 2.0); elseif (y <= 4.9e-92) tmp = Float64(27.0 * Float64(a * b)); 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -1.25e+100)
tmp = y * (z * (t * -9.0));
elseif (y <= -2.25e+86)
tmp = x * 2.0;
elseif (y <= -1.15e+30)
tmp = t * (-9.0 * (y * z));
elseif (y <= -1.16e-259)
tmp = a * (27.0 * b);
elseif (y <= 1.4e-294)
tmp = x * 2.0;
elseif (y <= 4.9e-92)
tmp = 27.0 * (a * b);
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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.25e+100], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.25e+86], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -1.15e+30], N[(t * N[(-9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.16e-259], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e-294], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, 4.9e-92], N[(27.0 * N[(a * b), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+100}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{+86}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{+30}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;y \leq -1.16 \cdot 10^{-259}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-294}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{-92}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if y < -1.25e100Initial program 79.4%
Taylor expanded in y around 0 79.4%
associate-*r*79.4%
*-commutative79.4%
associate-*r*79.5%
Simplified79.5%
Taylor expanded in y around inf 60.7%
*-commutative60.7%
*-commutative60.7%
associate-*r*68.2%
associate-*l*68.2%
associate-*l*68.1%
Simplified68.1%
if -1.25e100 < y < -2.24999999999999996e86 or -1.16e-259 < y < 1.39999999999999995e-294Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*87.4%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in x around inf 70.2%
if -2.24999999999999996e86 < y < -1.15e30Initial program 93.5%
sub-neg93.5%
sub-neg93.5%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around 0 48.2%
sub-neg48.2%
+-commutative48.2%
*-commutative48.2%
distribute-rgt-neg-in48.2%
*-commutative48.2%
associate-*l*54.5%
metadata-eval54.5%
associate-*r*54.5%
*-commutative54.5%
associate-*l*54.5%
Applied egg-rr54.5%
Taylor expanded in y around inf 41.5%
*-commutative41.5%
associate-*l*41.4%
Simplified41.4%
if -1.15e30 < y < -1.16e-259Initial program 97.9%
sub-neg97.9%
sub-neg97.9%
associate-*l*93.0%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in a around inf 53.6%
associate-*r*53.7%
*-commutative53.7%
associate-*r*53.8%
Simplified53.8%
if 1.39999999999999995e-294 < y < 4.9e-92Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*95.2%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in a around inf 50.2%
if 4.9e-92 < y Initial program 88.4%
sub-neg88.4%
sub-neg88.4%
associate-*l*93.5%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in y around inf 57.7%
Final simplification57.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.2e+100)
(* y (* z (* t -9.0)))
(if (<= y -3.6e+86)
(* x 2.0)
(if (<= y -1.02e+30)
(* y (* (* t z) -9.0))
(if (<= y -3.8e-258)
(* a (* 27.0 b))
(if (<= y 6.5e-297)
(* x 2.0)
(if (<= y 9.2e-95) (* 27.0 (* a b)) (* -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 tmp;
if (y <= -1.2e+100) {
tmp = y * (z * (t * -9.0));
} else if (y <= -3.6e+86) {
tmp = x * 2.0;
} else if (y <= -1.02e+30) {
tmp = y * ((t * z) * -9.0);
} else if (y <= -3.8e-258) {
tmp = a * (27.0 * b);
} else if (y <= 6.5e-297) {
tmp = x * 2.0;
} else if (y <= 9.2e-95) {
tmp = 27.0 * (a * b);
} 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.
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 <= (-1.2d+100)) then
tmp = y * (z * (t * (-9.0d0)))
else if (y <= (-3.6d+86)) then
tmp = x * 2.0d0
else if (y <= (-1.02d+30)) then
tmp = y * ((t * z) * (-9.0d0))
else if (y <= (-3.8d-258)) then
tmp = a * (27.0d0 * b)
else if (y <= 6.5d-297) then
tmp = x * 2.0d0
else if (y <= 9.2d-95) then
tmp = 27.0d0 * (a * b)
else
tmp = (-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 tmp;
if (y <= -1.2e+100) {
tmp = y * (z * (t * -9.0));
} else if (y <= -3.6e+86) {
tmp = x * 2.0;
} else if (y <= -1.02e+30) {
tmp = y * ((t * z) * -9.0);
} else if (y <= -3.8e-258) {
tmp = a * (27.0 * b);
} else if (y <= 6.5e-297) {
tmp = x * 2.0;
} else if (y <= 9.2e-95) {
tmp = 27.0 * (a * b);
} else {
tmp = -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): tmp = 0 if y <= -1.2e+100: tmp = y * (z * (t * -9.0)) elif y <= -3.6e+86: tmp = x * 2.0 elif y <= -1.02e+30: tmp = y * ((t * z) * -9.0) elif y <= -3.8e-258: tmp = a * (27.0 * b) elif y <= 6.5e-297: tmp = x * 2.0 elif y <= 9.2e-95: tmp = 27.0 * (a * b) else: tmp = -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) tmp = 0.0 if (y <= -1.2e+100) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (y <= -3.6e+86) tmp = Float64(x * 2.0); elseif (y <= -1.02e+30) tmp = Float64(y * Float64(Float64(t * z) * -9.0)); elseif (y <= -3.8e-258) tmp = Float64(a * Float64(27.0 * b)); elseif (y <= 6.5e-297) tmp = Float64(x * 2.0); elseif (y <= 9.2e-95) tmp = Float64(27.0 * Float64(a * b)); 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -1.2e+100)
tmp = y * (z * (t * -9.0));
elseif (y <= -3.6e+86)
tmp = x * 2.0;
elseif (y <= -1.02e+30)
tmp = y * ((t * z) * -9.0);
elseif (y <= -3.8e-258)
tmp = a * (27.0 * b);
elseif (y <= 6.5e-297)
tmp = x * 2.0;
elseif (y <= 9.2e-95)
tmp = 27.0 * (a * b);
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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.2e+100], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.6e+86], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -1.02e+30], N[(y * N[(N[(t * z), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.8e-258], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e-297], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, 9.2e-95], N[(27.0 * N[(a * b), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+100}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{+86}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -1.02 \cdot 10^{+30}:\\
\;\;\;\;y \cdot \left(\left(t \cdot z\right) \cdot -9\right)\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-258}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-297}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-95}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if y < -1.20000000000000006e100Initial program 79.4%
Taylor expanded in y around 0 79.4%
associate-*r*79.4%
*-commutative79.4%
associate-*r*79.5%
Simplified79.5%
Taylor expanded in y around inf 60.7%
*-commutative60.7%
*-commutative60.7%
associate-*r*68.2%
associate-*l*68.2%
associate-*l*68.1%
Simplified68.1%
if -1.20000000000000006e100 < y < -3.60000000000000005e86 or -3.7999999999999998e-258 < y < 6.5000000000000002e-297Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*87.4%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in x around inf 70.2%
if -3.60000000000000005e86 < y < -1.02e30Initial program 93.5%
Taylor expanded in y around 0 93.4%
associate-*r*93.5%
*-commutative93.5%
associate-*r*93.4%
Simplified93.4%
Taylor expanded in y around inf 41.5%
*-commutative41.5%
*-commutative41.5%
associate-*r*47.8%
associate-*l*48.0%
*-commutative48.0%
Simplified48.0%
if -1.02e30 < y < -3.7999999999999998e-258Initial program 97.9%
sub-neg97.9%
sub-neg97.9%
associate-*l*93.0%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in a around inf 53.6%
associate-*r*53.7%
*-commutative53.7%
associate-*r*53.8%
Simplified53.8%
if 6.5000000000000002e-297 < y < 9.19999999999999997e-95Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*95.0%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in a around inf 51.5%
if 9.19999999999999997e-95 < y Initial program 88.5%
sub-neg88.5%
sub-neg88.5%
associate-*l*93.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in y around inf 57.1%
Final simplification57.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (or (<= t_1 -1e-18) (not (<= t_1 2.6e+69)))
(+ (* a (* 27.0 b)) (* -9.0 (* y (* t z))))
(- (* 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 <= -1e-18) || !(t_1 <= 2.6e+69)) {
tmp = (a * (27.0 * b)) + (-9.0 * (y * (t * z)));
} 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 <= (-1d-18)) .or. (.not. (t_1 <= 2.6d+69))) then
tmp = (a * (27.0d0 * b)) + ((-9.0d0) * (y * (t * z)))
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 <= -1e-18) || !(t_1 <= 2.6e+69)) {
tmp = (a * (27.0 * b)) + (-9.0 * (y * (t * z)));
} 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 <= -1e-18) or not (t_1 <= 2.6e+69): tmp = (a * (27.0 * b)) + (-9.0 * (y * (t * z))) 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 <= -1e-18) || !(t_1 <= 2.6e+69)) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(-9.0 * Float64(y * Float64(t * z)))); 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 <= -1e-18) || ~((t_1 <= 2.6e+69)))
tmp = (a * (27.0 * b)) + (-9.0 * (y * (t * z)));
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, -1e-18], N[Not[LessEqual[t$95$1, 2.6e+69]], $MachinePrecision]], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $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 -1 \cdot 10^{-18} \lor \neg \left(t\_1 \leq 2.6 \cdot 10^{+69}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + -9 \cdot \left(y \cdot \left(t \cdot z\right)\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) < -1.0000000000000001e-18 or 2.6000000000000002e69 < (*.f64 (*.f64 a 27) b) Initial program 90.3%
sub-neg90.3%
sub-neg90.3%
associate-*l*91.6%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in x around 0 81.1%
sub-neg81.1%
+-commutative81.1%
*-commutative81.1%
distribute-rgt-neg-in81.1%
*-commutative81.1%
associate-*l*81.7%
metadata-eval81.7%
associate-*r*81.8%
*-commutative81.8%
associate-*l*81.8%
Applied egg-rr81.8%
if -1.0000000000000001e-18 < (*.f64 (*.f64 a 27) b) < 2.6000000000000002e69Initial program 93.7%
sub-neg93.7%
sub-neg93.7%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in a around 0 88.4%
Final simplification84.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 (+ (* x 2.0) (* 27.0 (* a b)))))
(if (<= z -2.5e-8)
(* y (* z (* t -9.0)))
(if (<= z 1.6e-42)
t_1
(if (<= z 0.00132)
(* y (* (* t z) -9.0))
(if (<= z 2.7e+32) t_1 (* -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 = (x * 2.0) + (27.0 * (a * b));
double tmp;
if (z <= -2.5e-8) {
tmp = y * (z * (t * -9.0));
} else if (z <= 1.6e-42) {
tmp = t_1;
} else if (z <= 0.00132) {
tmp = y * ((t * z) * -9.0);
} else if (z <= 2.7e+32) {
tmp = t_1;
} 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.
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 = (x * 2.0d0) + (27.0d0 * (a * b))
if (z <= (-2.5d-8)) then
tmp = y * (z * (t * (-9.0d0)))
else if (z <= 1.6d-42) then
tmp = t_1
else if (z <= 0.00132d0) then
tmp = y * ((t * z) * (-9.0d0))
else if (z <= 2.7d+32) then
tmp = t_1
else
tmp = (-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 = (x * 2.0) + (27.0 * (a * b));
double tmp;
if (z <= -2.5e-8) {
tmp = y * (z * (t * -9.0));
} else if (z <= 1.6e-42) {
tmp = t_1;
} else if (z <= 0.00132) {
tmp = y * ((t * z) * -9.0);
} else if (z <= 2.7e+32) {
tmp = t_1;
} else {
tmp = -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 = (x * 2.0) + (27.0 * (a * b)) tmp = 0 if z <= -2.5e-8: tmp = y * (z * (t * -9.0)) elif z <= 1.6e-42: tmp = t_1 elif z <= 0.00132: tmp = y * ((t * z) * -9.0) elif z <= 2.7e+32: tmp = t_1 else: tmp = -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(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))) tmp = 0.0 if (z <= -2.5e-8) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (z <= 1.6e-42) tmp = t_1; elseif (z <= 0.00132) tmp = Float64(y * Float64(Float64(t * z) * -9.0)); elseif (z <= 2.7e+32) tmp = t_1; 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (x * 2.0) + (27.0 * (a * b));
tmp = 0.0;
if (z <= -2.5e-8)
tmp = y * (z * (t * -9.0));
elseif (z <= 1.6e-42)
tmp = t_1;
elseif (z <= 0.00132)
tmp = y * ((t * z) * -9.0);
elseif (z <= 2.7e+32)
tmp = t_1;
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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e-8], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e-42], t$95$1, If[LessEqual[z, 0.00132], N[(y * N[(N[(t * z), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e+32], t$95$1, 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])\\
\\
\begin{array}{l}
t_1 := x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{-8}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.00132:\\
\;\;\;\;y \cdot \left(\left(t \cdot z\right) \cdot -9\right)\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -2.4999999999999999e-8Initial program 91.3%
Taylor expanded in y around 0 91.3%
associate-*r*91.3%
*-commutative91.3%
associate-*r*91.3%
Simplified91.3%
Taylor expanded in y around inf 62.5%
*-commutative62.5%
*-commutative62.5%
associate-*r*62.3%
associate-*l*62.3%
associate-*l*62.3%
Simplified62.3%
if -2.4999999999999999e-8 < z < 1.60000000000000012e-42 or 0.00132 < z < 2.70000000000000013e32Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.0%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in y around 0 83.2%
if 1.60000000000000012e-42 < z < 0.00132Initial program 99.8%
Taylor expanded in y around 0 99.9%
associate-*r*99.8%
*-commutative99.8%
associate-*r*99.9%
Simplified99.9%
Taylor expanded in y around inf 54.4%
*-commutative54.4%
*-commutative54.4%
associate-*r*54.6%
associate-*l*54.7%
*-commutative54.7%
Simplified54.7%
if 2.70000000000000013e32 < z Initial program 75.2%
sub-neg75.2%
sub-neg75.2%
associate-*l*80.1%
associate-*l*80.1%
Simplified80.1%
Taylor expanded in y around inf 54.3%
Final simplification69.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (or (<= t_1 -2e+173) (not (<= t_1 2.6e+69)))
(* a (* 27.0 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 t_1 = b * (a * 27.0);
double tmp;
if ((t_1 <= -2e+173) || !(t_1 <= 2.6e+69)) {
tmp = a * (27.0 * 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) :: t_1
real(8) :: tmp
t_1 = b * (a * 27.0d0)
if ((t_1 <= (-2d+173)) .or. (.not. (t_1 <= 2.6d+69))) then
tmp = a * (27.0d0 * 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 t_1 = b * (a * 27.0);
double tmp;
if ((t_1 <= -2e+173) || !(t_1 <= 2.6e+69)) {
tmp = a * (27.0 * 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): t_1 = b * (a * 27.0) tmp = 0 if (t_1 <= -2e+173) or not (t_1 <= 2.6e+69): tmp = a * (27.0 * 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) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if ((t_1 <= -2e+173) || !(t_1 <= 2.6e+69)) tmp = Float64(a * Float64(27.0 * 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)
t_1 = b * (a * 27.0);
tmp = 0.0;
if ((t_1 <= -2e+173) || ~((t_1 <= 2.6e+69)))
tmp = a * (27.0 * 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_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+173], N[Not[LessEqual[t$95$1, 2.6e+69]], $MachinePrecision]], N[(a * N[(27.0 * 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}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+173} \lor \neg \left(t\_1 \leq 2.6 \cdot 10^{+69}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -2e173 or 2.6000000000000002e69 < (*.f64 (*.f64 a 27) b) Initial program 90.8%
sub-neg90.8%
sub-neg90.8%
associate-*l*90.7%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in a around inf 71.4%
associate-*r*71.5%
*-commutative71.5%
associate-*r*71.5%
Simplified71.5%
if -2e173 < (*.f64 (*.f64 a 27) b) < 2.6000000000000002e69Initial program 92.6%
sub-neg92.6%
sub-neg92.6%
associate-*l*95.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around inf 41.2%
Final simplification52.8%
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 (* y z))))
(if (<= y -2.45e+30)
(- (* x 2.0) (* 9.0 t_1))
(if (<= y 1.15e-91) (+ (* x 2.0) (* 27.0 (* a b))) (* -9.0 t_1)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (y * z);
double tmp;
if (y <= -2.45e+30) {
tmp = (x * 2.0) - (9.0 * t_1);
} else if (y <= 1.15e-91) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = -9.0 * t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (y * z)
if (y <= (-2.45d+30)) then
tmp = (x * 2.0d0) - (9.0d0 * t_1)
else if (y <= 1.15d-91) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (-9.0d0) * t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (y * z);
double tmp;
if (y <= -2.45e+30) {
tmp = (x * 2.0) - (9.0 * t_1);
} else if (y <= 1.15e-91) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = -9.0 * t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = t * (y * z) tmp = 0 if y <= -2.45e+30: tmp = (x * 2.0) - (9.0 * t_1) elif y <= 1.15e-91: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = -9.0 * t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(y * z)) tmp = 0.0 if (y <= -2.45e+30) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * t_1)); elseif (y <= 1.15e-91) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(-9.0 * t_1); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = t * (y * z);
tmp = 0.0;
if (y <= -2.45e+30)
tmp = (x * 2.0) - (9.0 * t_1);
elseif (y <= 1.15e-91)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = -9.0 * t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.45e+30], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e-91], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-9.0 * 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 := t \cdot \left(y \cdot z\right)\\
\mathbf{if}\;y \leq -2.45 \cdot 10^{+30}:\\
\;\;\;\;x \cdot 2 - 9 \cdot t\_1\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-91}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot t\_1\\
\end{array}
\end{array}
if y < -2.44999999999999992e30Initial program 84.0%
sub-neg84.0%
sub-neg84.0%
associate-*l*96.2%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in a around 0 80.8%
if -2.44999999999999992e30 < y < 1.14999999999999998e-91Initial program 98.9%
sub-neg98.9%
sub-neg98.9%
associate-*l*92.8%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in y around 0 81.1%
if 1.14999999999999998e-91 < y Initial program 88.4%
sub-neg88.4%
sub-neg88.4%
associate-*l*93.5%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in y around inf 57.7%
Final simplification72.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -3.8e-63) (not (<= b 1150000.0))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.8e-63) || !(b <= 1150000.0)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-3.8d-63)) .or. (.not. (b <= 1150000.0d0))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.8e-63) || !(b <= 1150000.0)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -3.8e-63) or not (b <= 1150000.0): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -3.8e-63) || !(b <= 1150000.0)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -3.8e-63) || ~((b <= 1150000.0)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -3.8e-63], N[Not[LessEqual[b, 1150000.0]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{-63} \lor \neg \left(b \leq 1150000\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -3.80000000000000017e-63 or 1.15e6 < b Initial program 92.0%
sub-neg92.0%
sub-neg92.0%
associate-*l*90.7%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in a around inf 53.0%
if -3.80000000000000017e-63 < b < 1.15e6Initial program 91.8%
sub-neg91.8%
sub-neg91.8%
associate-*l*98.0%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in x around inf 42.7%
Final simplification48.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 (* 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 91.9%
sub-neg91.9%
sub-neg91.9%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in x around inf 27.0%
Final simplification27.0%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024041
(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)))