
(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 15 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) z) 5e+224) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0))))) (+ (* a (* 27.0 b)) (+ (* y (* z (* t -9.0))) (* x 2.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((y * 9.0) * z) <= 5e+224) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
} else {
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (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 (Float64(Float64(y * 9.0) * z) <= 5e+224) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); else tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision], 5e+224], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 5 \cdot 10^{+224}:\\
\;\;\;\;\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)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 4.99999999999999964e224Initial program 96.9%
+-commutative96.9%
associate-+r-96.9%
*-commutative96.9%
cancel-sign-sub-inv96.9%
associate-*r*95.6%
distribute-lft-neg-in95.6%
*-commutative95.6%
cancel-sign-sub-inv95.6%
associate-+r-95.6%
associate-*l*95.6%
fma-def95.6%
cancel-sign-sub-inv95.6%
fma-def95.6%
distribute-lft-neg-in95.6%
distribute-rgt-neg-in95.6%
*-commutative95.6%
associate-*r*96.9%
associate-*l*96.8%
neg-mul-196.8%
associate-*r*96.8%
Simplified96.8%
if 4.99999999999999964e224 < (*.f64 (*.f64 y 9) z) Initial program 77.3%
sub-neg77.3%
sub-neg77.3%
associate-*l*96.3%
associate-*l*96.3%
Simplified96.3%
sub-neg96.3%
*-commutative96.3%
distribute-rgt-neg-in96.3%
*-commutative96.3%
distribute-lft-neg-in96.3%
metadata-eval96.3%
associate-*l*96.3%
associate-*r*96.4%
*-commutative96.4%
Applied egg-rr96.4%
Final simplification96.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 (* a (* 27.0 b))) (t_2 (* t (* z (* y -9.0)))))
(if (<= t -1.95e-150)
t_2
(if (<= t 1.05e-169)
(* x 2.0)
(if (<= t 7.5e-97)
(* b (* a 27.0))
(if (<= t 2.4e-45)
(* x 2.0)
(if (<= t 1.32e+39)
t_1
(if (<= t 6e+64) (* x 2.0) (if (<= t 8.8e+127) t_1 t_2)))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double t_2 = t * (z * (y * -9.0));
double tmp;
if (t <= -1.95e-150) {
tmp = t_2;
} else if (t <= 1.05e-169) {
tmp = x * 2.0;
} else if (t <= 7.5e-97) {
tmp = b * (a * 27.0);
} else if (t <= 2.4e-45) {
tmp = x * 2.0;
} else if (t <= 1.32e+39) {
tmp = t_1;
} else if (t <= 6e+64) {
tmp = x * 2.0;
} else if (t <= 8.8e+127) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * (27.0d0 * b)
t_2 = t * (z * (y * (-9.0d0)))
if (t <= (-1.95d-150)) then
tmp = t_2
else if (t <= 1.05d-169) then
tmp = x * 2.0d0
else if (t <= 7.5d-97) then
tmp = b * (a * 27.0d0)
else if (t <= 2.4d-45) then
tmp = x * 2.0d0
else if (t <= 1.32d+39) then
tmp = t_1
else if (t <= 6d+64) then
tmp = x * 2.0d0
else if (t <= 8.8d+127) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double t_2 = t * (z * (y * -9.0));
double tmp;
if (t <= -1.95e-150) {
tmp = t_2;
} else if (t <= 1.05e-169) {
tmp = x * 2.0;
} else if (t <= 7.5e-97) {
tmp = b * (a * 27.0);
} else if (t <= 2.4e-45) {
tmp = x * 2.0;
} else if (t <= 1.32e+39) {
tmp = t_1;
} else if (t <= 6e+64) {
tmp = x * 2.0;
} else if (t <= 8.8e+127) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) t_2 = t * (z * (y * -9.0)) tmp = 0 if t <= -1.95e-150: tmp = t_2 elif t <= 1.05e-169: tmp = x * 2.0 elif t <= 7.5e-97: tmp = b * (a * 27.0) elif t <= 2.4e-45: tmp = x * 2.0 elif t <= 1.32e+39: tmp = t_1 elif t <= 6e+64: tmp = x * 2.0 elif t <= 8.8e+127: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) t_2 = Float64(t * Float64(z * Float64(y * -9.0))) tmp = 0.0 if (t <= -1.95e-150) tmp = t_2; elseif (t <= 1.05e-169) tmp = Float64(x * 2.0); elseif (t <= 7.5e-97) tmp = Float64(b * Float64(a * 27.0)); elseif (t <= 2.4e-45) tmp = Float64(x * 2.0); elseif (t <= 1.32e+39) tmp = t_1; elseif (t <= 6e+64) tmp = Float64(x * 2.0); elseif (t <= 8.8e+127) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
t_2 = t * (z * (y * -9.0));
tmp = 0.0;
if (t <= -1.95e-150)
tmp = t_2;
elseif (t <= 1.05e-169)
tmp = x * 2.0;
elseif (t <= 7.5e-97)
tmp = b * (a * 27.0);
elseif (t <= 2.4e-45)
tmp = x * 2.0;
elseif (t <= 1.32e+39)
tmp = t_1;
elseif (t <= 6e+64)
tmp = x * 2.0;
elseif (t <= 8.8e+127)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.95e-150], t$95$2, If[LessEqual[t, 1.05e-169], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 7.5e-97], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-45], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 1.32e+39], t$95$1, If[LessEqual[t, 6e+64], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 8.8e+127], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
t_2 := t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{if}\;t \leq -1.95 \cdot 10^{-150}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-169}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-97}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-45}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 1.32 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+64}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{+127}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.9500000000000001e-150 or 8.8000000000000007e127 < t Initial program 96.1%
sub-neg96.1%
sub-neg96.1%
associate-*l*91.7%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in y around inf 49.2%
*-commutative49.2%
associate-*l*49.2%
*-commutative49.2%
associate-*l*49.2%
Simplified49.2%
if -1.9500000000000001e-150 < t < 1.05e-169 or 7.5e-97 < t < 2.3999999999999999e-45 or 1.32e39 < t < 6.0000000000000004e64Initial program 92.1%
sub-neg92.1%
sub-neg92.1%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 47.9%
if 1.05e-169 < t < 7.5e-97Initial program 90.4%
Taylor expanded in y around 0 90.4%
associate-*r*90.4%
*-commutative90.4%
associate-*r*90.3%
Simplified90.3%
+-commutative90.3%
associate-+r-90.3%
associate-*l*90.5%
associate-*l*99.8%
*-commutative99.8%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in a around inf 54.1%
*-commutative54.1%
*-commutative54.1%
associate-*l*54.1%
*-commutative54.1%
Simplified54.1%
if 2.3999999999999999e-45 < t < 1.32e39 or 6.0000000000000004e64 < t < 8.8000000000000007e127Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*85.9%
associate-*l*85.9%
Simplified85.9%
Taylor expanded in a around inf 42.0%
associate-*r*42.0%
*-commutative42.0%
associate-*r*42.0%
Simplified42.0%
Final simplification48.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 (* a (* 27.0 b))) (t_2 (* (* t -9.0) (* y z))))
(if (<= t -1.95e-150)
t_2
(if (<= t 1.05e-169)
(* x 2.0)
(if (<= t 1.05e-95)
(* b (* a 27.0))
(if (<= t 1.18e-45)
(* x 2.0)
(if (<= t 2.2e+40)
t_1
(if (<= t 1.52e+63) (* x 2.0) (if (<= t 8.8e+127) t_1 t_2)))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double t_2 = (t * -9.0) * (y * z);
double tmp;
if (t <= -1.95e-150) {
tmp = t_2;
} else if (t <= 1.05e-169) {
tmp = x * 2.0;
} else if (t <= 1.05e-95) {
tmp = b * (a * 27.0);
} else if (t <= 1.18e-45) {
tmp = x * 2.0;
} else if (t <= 2.2e+40) {
tmp = t_1;
} else if (t <= 1.52e+63) {
tmp = x * 2.0;
} else if (t <= 8.8e+127) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * (27.0d0 * b)
t_2 = (t * (-9.0d0)) * (y * z)
if (t <= (-1.95d-150)) then
tmp = t_2
else if (t <= 1.05d-169) then
tmp = x * 2.0d0
else if (t <= 1.05d-95) then
tmp = b * (a * 27.0d0)
else if (t <= 1.18d-45) then
tmp = x * 2.0d0
else if (t <= 2.2d+40) then
tmp = t_1
else if (t <= 1.52d+63) then
tmp = x * 2.0d0
else if (t <= 8.8d+127) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double t_2 = (t * -9.0) * (y * z);
double tmp;
if (t <= -1.95e-150) {
tmp = t_2;
} else if (t <= 1.05e-169) {
tmp = x * 2.0;
} else if (t <= 1.05e-95) {
tmp = b * (a * 27.0);
} else if (t <= 1.18e-45) {
tmp = x * 2.0;
} else if (t <= 2.2e+40) {
tmp = t_1;
} else if (t <= 1.52e+63) {
tmp = x * 2.0;
} else if (t <= 8.8e+127) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) t_2 = (t * -9.0) * (y * z) tmp = 0 if t <= -1.95e-150: tmp = t_2 elif t <= 1.05e-169: tmp = x * 2.0 elif t <= 1.05e-95: tmp = b * (a * 27.0) elif t <= 1.18e-45: tmp = x * 2.0 elif t <= 2.2e+40: tmp = t_1 elif t <= 1.52e+63: tmp = x * 2.0 elif t <= 8.8e+127: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) t_2 = Float64(Float64(t * -9.0) * Float64(y * z)) tmp = 0.0 if (t <= -1.95e-150) tmp = t_2; elseif (t <= 1.05e-169) tmp = Float64(x * 2.0); elseif (t <= 1.05e-95) tmp = Float64(b * Float64(a * 27.0)); elseif (t <= 1.18e-45) tmp = Float64(x * 2.0); elseif (t <= 2.2e+40) tmp = t_1; elseif (t <= 1.52e+63) tmp = Float64(x * 2.0); elseif (t <= 8.8e+127) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
t_2 = (t * -9.0) * (y * z);
tmp = 0.0;
if (t <= -1.95e-150)
tmp = t_2;
elseif (t <= 1.05e-169)
tmp = x * 2.0;
elseif (t <= 1.05e-95)
tmp = b * (a * 27.0);
elseif (t <= 1.18e-45)
tmp = x * 2.0;
elseif (t <= 2.2e+40)
tmp = t_1;
elseif (t <= 1.52e+63)
tmp = x * 2.0;
elseif (t <= 8.8e+127)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * -9.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.95e-150], t$95$2, If[LessEqual[t, 1.05e-169], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 1.05e-95], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.18e-45], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 2.2e+40], t$95$1, If[LessEqual[t, 1.52e+63], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 8.8e+127], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
t_2 := \left(t \cdot -9\right) \cdot \left(y \cdot z\right)\\
\mathbf{if}\;t \leq -1.95 \cdot 10^{-150}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-169}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-95}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;t \leq 1.18 \cdot 10^{-45}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.52 \cdot 10^{+63}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{+127}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.9500000000000001e-150 or 8.8000000000000007e127 < t Initial program 96.1%
sub-neg96.1%
sub-neg96.1%
associate-*l*91.7%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in y around inf 49.2%
associate-*r*49.1%
*-commutative49.1%
Simplified49.1%
if -1.9500000000000001e-150 < t < 1.05e-169 or 1.05e-95 < t < 1.18e-45 or 2.1999999999999999e40 < t < 1.51999999999999993e63Initial program 92.1%
sub-neg92.1%
sub-neg92.1%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 48.4%
if 1.05e-169 < t < 1.05e-95Initial program 90.4%
Taylor expanded in y around 0 90.4%
associate-*r*90.4%
*-commutative90.4%
associate-*r*90.3%
Simplified90.3%
+-commutative90.3%
associate-+r-90.3%
associate-*l*90.5%
associate-*l*99.8%
*-commutative99.8%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in a around inf 54.1%
*-commutative54.1%
*-commutative54.1%
associate-*l*54.1%
*-commutative54.1%
Simplified54.1%
if 1.18e-45 < t < 2.1999999999999999e40 or 1.51999999999999993e63 < t < 8.8000000000000007e127Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*86.6%
associate-*l*86.6%
Simplified86.6%
Taylor expanded in a around inf 44.7%
associate-*r*44.7%
*-commutative44.7%
associate-*r*44.7%
Simplified44.7%
Final simplification48.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 (or (<= a -6.8e+52)
(not
(or (<= a -8.1e-112) (and (not (<= a -2.2e-174)) (<= a 8.8e+39)))))
(* 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 <= -6.8e+52) || !((a <= -8.1e-112) || (!(a <= -2.2e-174) && (a <= 8.8e+39)))) {
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 <= (-6.8d+52)) .or. (.not. (a <= (-8.1d-112)) .or. (.not. (a <= (-2.2d-174))) .and. (a <= 8.8d+39))) 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 <= -6.8e+52) || !((a <= -8.1e-112) || (!(a <= -2.2e-174) && (a <= 8.8e+39)))) {
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 <= -6.8e+52) or not ((a <= -8.1e-112) or (not (a <= -2.2e-174) and (a <= 8.8e+39))): 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 <= -6.8e+52) || !((a <= -8.1e-112) || (!(a <= -2.2e-174) && (a <= 8.8e+39)))) 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 <= -6.8e+52) || ~(((a <= -8.1e-112) || (~((a <= -2.2e-174)) && (a <= 8.8e+39)))))
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, -6.8e+52], N[Not[Or[LessEqual[a, -8.1e-112], And[N[Not[LessEqual[a, -2.2e-174]], $MachinePrecision], LessEqual[a, 8.8e+39]]]], $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 -6.8 \cdot 10^{+52} \lor \neg \left(a \leq -8.1 \cdot 10^{-112} \lor \neg \left(a \leq -2.2 \cdot 10^{-174}\right) \land a \leq 8.8 \cdot 10^{+39}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -6.8e52 or -8.10000000000000022e-112 < a < -2.20000000000000022e-174 or 8.8000000000000006e39 < a Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*91.3%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in a around inf 56.4%
if -6.8e52 < a < -8.10000000000000022e-112 or -2.20000000000000022e-174 < a < 8.8000000000000006e39Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*97.7%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in x around inf 42.2%
Final simplification49.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.4e+52)
(* a (* 27.0 b))
(if (or (<= a -2.55e-111) (and (not (<= a -2.2e-174)) (<= a 4e+39)))
(* x 2.0)
(* 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 tmp;
if (a <= -1.4e+52) {
tmp = a * (27.0 * b);
} else if ((a <= -2.55e-111) || (!(a <= -2.2e-174) && (a <= 4e+39))) {
tmp = x * 2.0;
} 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) :: tmp
if (a <= (-1.4d+52)) then
tmp = a * (27.0d0 * b)
else if ((a <= (-2.55d-111)) .or. (.not. (a <= (-2.2d-174))) .and. (a <= 4d+39)) then
tmp = x * 2.0d0
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 tmp;
if (a <= -1.4e+52) {
tmp = a * (27.0 * b);
} else if ((a <= -2.55e-111) || (!(a <= -2.2e-174) && (a <= 4e+39))) {
tmp = x * 2.0;
} 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): tmp = 0 if a <= -1.4e+52: tmp = a * (27.0 * b) elif (a <= -2.55e-111) or (not (a <= -2.2e-174) and (a <= 4e+39)): tmp = x * 2.0 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) tmp = 0.0 if (a <= -1.4e+52) tmp = Float64(a * Float64(27.0 * b)); elseif ((a <= -2.55e-111) || (!(a <= -2.2e-174) && (a <= 4e+39))) tmp = Float64(x * 2.0); 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)
tmp = 0.0;
if (a <= -1.4e+52)
tmp = a * (27.0 * b);
elseif ((a <= -2.55e-111) || (~((a <= -2.2e-174)) && (a <= 4e+39)))
tmp = x * 2.0;
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_] := If[LessEqual[a, -1.4e+52], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -2.55e-111], And[N[Not[LessEqual[a, -2.2e-174]], $MachinePrecision], LessEqual[a, 4e+39]]], N[(x * 2.0), $MachinePrecision], 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}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+52}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq -2.55 \cdot 10^{-111} \lor \neg \left(a \leq -2.2 \cdot 10^{-174}\right) \land a \leq 4 \cdot 10^{+39}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -1.4e52Initial program 93.3%
sub-neg93.3%
sub-neg93.3%
associate-*l*86.9%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in a around inf 61.8%
associate-*r*61.9%
*-commutative61.9%
associate-*r*61.9%
Simplified61.9%
if -1.4e52 < a < -2.55000000000000016e-111 or -2.20000000000000022e-174 < a < 3.99999999999999976e39Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*97.7%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in x around inf 42.2%
if -2.55000000000000016e-111 < a < -2.20000000000000022e-174 or 3.99999999999999976e39 < a Initial program 95.0%
sub-neg95.0%
sub-neg95.0%
associate-*l*93.8%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in a around inf 53.3%
Final simplification49.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.95e+51)
(* a (* 27.0 b))
(if (or (<= a -6.5e-112) (and (not (<= a -2.2e-174)) (<= a 1.9e+40)))
(* x 2.0)
(* b (* a 27.0)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.95e+51) {
tmp = a * (27.0 * b);
} else if ((a <= -6.5e-112) || (!(a <= -2.2e-174) && (a <= 1.9e+40))) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-2.95d+51)) then
tmp = a * (27.0d0 * b)
else if ((a <= (-6.5d-112)) .or. (.not. (a <= (-2.2d-174))) .and. (a <= 1.9d+40)) then
tmp = x * 2.0d0
else
tmp = b * (a * 27.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.95e+51) {
tmp = a * (27.0 * b);
} else if ((a <= -6.5e-112) || (!(a <= -2.2e-174) && (a <= 1.9e+40))) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if a <= -2.95e+51: tmp = a * (27.0 * b) elif (a <= -6.5e-112) or (not (a <= -2.2e-174) and (a <= 1.9e+40)): tmp = x * 2.0 else: tmp = b * (a * 27.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.95e+51) tmp = Float64(a * Float64(27.0 * b)); elseif ((a <= -6.5e-112) || (!(a <= -2.2e-174) && (a <= 1.9e+40))) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(a * 27.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (a <= -2.95e+51)
tmp = a * (27.0 * b);
elseif ((a <= -6.5e-112) || (~((a <= -2.2e-174)) && (a <= 1.9e+40)))
tmp = x * 2.0;
else
tmp = b * (a * 27.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.95e+51], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -6.5e-112], And[N[Not[LessEqual[a, -2.2e-174]], $MachinePrecision], LessEqual[a, 1.9e+40]]], N[(x * 2.0), $MachinePrecision], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.95 \cdot 10^{+51}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq -6.5 \cdot 10^{-112} \lor \neg \left(a \leq -2.2 \cdot 10^{-174}\right) \land a \leq 1.9 \cdot 10^{+40}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if a < -2.94999999999999991e51Initial program 93.3%
sub-neg93.3%
sub-neg93.3%
associate-*l*86.9%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in a around inf 61.8%
associate-*r*61.9%
*-commutative61.9%
associate-*r*61.9%
Simplified61.9%
if -2.94999999999999991e51 < a < -6.49999999999999956e-112 or -2.20000000000000022e-174 < a < 1.90000000000000002e40Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*97.7%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in x around inf 42.2%
if -6.49999999999999956e-112 < a < -2.20000000000000022e-174 or 1.90000000000000002e40 < a Initial program 95.0%
Taylor expanded in y around 0 95.0%
associate-*r*95.0%
*-commutative95.0%
associate-*r*95.0%
Simplified95.0%
+-commutative95.0%
associate-+r-95.0%
associate-*l*95.1%
associate-*l*92.7%
*-commutative92.7%
associate-*l*92.7%
Applied egg-rr92.7%
Taylor expanded in a around inf 53.3%
*-commutative53.3%
*-commutative53.3%
associate-*l*53.3%
*-commutative53.3%
Simplified53.3%
Final simplification49.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -1.32e-87)
(+ (* y (* z (* t -9.0))) (* a (* 27.0 b)))
(if (<= z 8e-6) (+ (* x 2.0) t_1) (- 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 = 27.0 * (a * b);
double tmp;
if (z <= -1.32e-87) {
tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
} else if (z <= 8e-6) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_1 - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-1.32d-87)) then
tmp = (y * (z * (t * (-9.0d0)))) + (a * (27.0d0 * b))
else if (z <= 8d-6) then
tmp = (x * 2.0d0) + t_1
else
tmp = t_1 - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -1.32e-87) {
tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
} else if (z <= 8e-6) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_1 - (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 = 27.0 * (a * b) tmp = 0 if z <= -1.32e-87: tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b)) elif z <= 8e-6: tmp = (x * 2.0) + t_1 else: tmp = t_1 - (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(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -1.32e-87) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(a * Float64(27.0 * b))); elseif (z <= 8e-6) tmp = Float64(Float64(x * 2.0) + t_1); else tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -1.32e-87)
tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
elseif (z <= 8e-6)
tmp = (x * 2.0) + t_1;
else
tmp = t_1 - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.32e-87], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-6], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -1.32 \cdot 10^{-87}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-6}:\\
\;\;\;\;x \cdot 2 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.31999999999999997e-87Initial program 88.7%
Taylor expanded in y around 0 88.7%
associate-*r*88.7%
*-commutative88.7%
associate-*r*88.6%
Simplified88.6%
Taylor expanded in x around 0 67.1%
associate-*r*67.1%
*-commutative67.1%
associate-*r*67.1%
Simplified67.1%
expm1-log1p-u40.5%
expm1-udef40.0%
*-commutative40.0%
associate-*l*40.9%
Applied egg-rr40.9%
expm1-def41.4%
expm1-log1p71.1%
*-commutative71.1%
associate-*l*74.7%
Simplified74.7%
sub-neg74.7%
associate-*r*74.7%
*-commutative74.7%
associate-*r*74.6%
+-commutative74.6%
distribute-lft-neg-in74.6%
metadata-eval74.6%
associate-*r*71.0%
associate-*r*71.0%
*-commutative71.0%
associate-*r*71.0%
*-commutative71.0%
associate-*r*71.1%
*-commutative71.1%
associate-*r*71.1%
Applied egg-rr71.1%
if -1.31999999999999997e-87 < z < 7.99999999999999964e-6Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 85.9%
if 7.99999999999999964e-6 < z Initial program 95.0%
sub-neg95.0%
sub-neg95.0%
associate-*l*86.7%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in x around 0 84.1%
Final simplification80.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 (* a (* 27.0 b))))
(if (<= z -1.32e-87)
(+ (* y (* z (* t -9.0))) t_1)
(if (<= z 2.3e-6)
(+ (* x 2.0) (* 27.0 (* a b)))
(- t_1 (* t (* y (* 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 t_1 = a * (27.0 * b);
double tmp;
if (z <= -1.32e-87) {
tmp = (y * (z * (t * -9.0))) + t_1;
} else if (z <= 2.3e-6) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t_1 - (t * (y * (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) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if (z <= (-1.32d-87)) then
tmp = (y * (z * (t * (-9.0d0)))) + t_1
else if (z <= 2.3d-6) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = t_1 - (t * (y * (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 t_1 = a * (27.0 * b);
double tmp;
if (z <= -1.32e-87) {
tmp = (y * (z * (t * -9.0))) + t_1;
} else if (z <= 2.3e-6) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t_1 - (t * (y * (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): t_1 = a * (27.0 * b) tmp = 0 if z <= -1.32e-87: tmp = (y * (z * (t * -9.0))) + t_1 elif z <= 2.3e-6: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = t_1 - (t * (y * (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) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -1.32e-87) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + t_1); elseif (z <= 2.3e-6) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(t_1 - Float64(t * Float64(y * Float64(9.0 * 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 = a * (27.0 * b);
tmp = 0.0;
if (z <= -1.32e-87)
tmp = (y * (z * (t * -9.0))) + t_1;
elseif (z <= 2.3e-6)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = t_1 - (t * (y * (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_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.32e-87], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 2.3e-6], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(t * N[(y * N[(9.0 * 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 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -1.32 \cdot 10^{-87}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + t_1\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-6}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.31999999999999997e-87Initial program 88.7%
Taylor expanded in y around 0 88.7%
associate-*r*88.7%
*-commutative88.7%
associate-*r*88.6%
Simplified88.6%
Taylor expanded in x around 0 67.1%
associate-*r*67.1%
*-commutative67.1%
associate-*r*67.1%
Simplified67.1%
expm1-log1p-u40.5%
expm1-udef40.0%
*-commutative40.0%
associate-*l*40.9%
Applied egg-rr40.9%
expm1-def41.4%
expm1-log1p71.1%
*-commutative71.1%
associate-*l*74.7%
Simplified74.7%
sub-neg74.7%
associate-*r*74.7%
*-commutative74.7%
associate-*r*74.6%
+-commutative74.6%
distribute-lft-neg-in74.6%
metadata-eval74.6%
associate-*r*71.0%
associate-*r*71.0%
*-commutative71.0%
associate-*r*71.0%
*-commutative71.0%
associate-*r*71.1%
*-commutative71.1%
associate-*r*71.1%
Applied egg-rr71.1%
if -1.31999999999999997e-87 < z < 2.3e-6Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 85.9%
if 2.3e-6 < z Initial program 95.0%
Taylor expanded in y around 0 95.1%
associate-*r*95.0%
*-commutative95.0%
associate-*r*95.1%
Simplified95.1%
Taylor expanded in x around 0 84.1%
associate-*r*84.1%
*-commutative84.1%
associate-*r*84.1%
Simplified84.1%
expm1-log1p-u58.7%
expm1-udef57.1%
*-commutative57.1%
associate-*l*52.8%
Applied egg-rr52.8%
expm1-def54.4%
expm1-log1p75.8%
*-commutative75.8%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in z around 0 84.1%
*-commutative84.1%
associate-*l*84.1%
associate-*r*84.1%
Simplified84.1%
Final simplification80.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 (* a (* 27.0 b))))
(if (<= z 6e+62)
(+ t_1 (+ (* y (* z (* t -9.0))) (* x 2.0)))
(- t_1 (* t (* y (* 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 t_1 = a * (27.0 * b);
double tmp;
if (z <= 6e+62) {
tmp = t_1 + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = t_1 - (t * (y * (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) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if (z <= 6d+62) then
tmp = t_1 + ((y * (z * (t * (-9.0d0)))) + (x * 2.0d0))
else
tmp = t_1 - (t * (y * (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 t_1 = a * (27.0 * b);
double tmp;
if (z <= 6e+62) {
tmp = t_1 + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = t_1 - (t * (y * (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): t_1 = a * (27.0 * b) tmp = 0 if z <= 6e+62: tmp = t_1 + ((y * (z * (t * -9.0))) + (x * 2.0)) else: tmp = t_1 - (t * (y * (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) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= 6e+62) tmp = Float64(t_1 + Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0))); else tmp = Float64(t_1 - Float64(t * Float64(y * Float64(9.0 * 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 = a * (27.0 * b);
tmp = 0.0;
if (z <= 6e+62)
tmp = t_1 + ((y * (z * (t * -9.0))) + (x * 2.0));
else
tmp = t_1 - (t * (y * (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_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 6e+62], N[(t$95$1 + N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(t * N[(y * N[(9.0 * 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 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq 6 \cdot 10^{+62}:\\
\;\;\;\;t_1 + \left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 6e62Initial program 94.8%
sub-neg94.8%
sub-neg94.8%
associate-*l*97.0%
associate-*l*97.0%
Simplified97.0%
sub-neg97.0%
*-commutative97.0%
distribute-rgt-neg-in97.0%
*-commutative97.0%
distribute-lft-neg-in97.0%
metadata-eval97.0%
associate-*l*97.0%
associate-*r*97.0%
*-commutative97.0%
Applied egg-rr97.0%
if 6e62 < z Initial program 94.1%
Taylor expanded in y around 0 94.1%
associate-*r*94.1%
*-commutative94.1%
associate-*r*94.1%
Simplified94.1%
Taylor expanded in x around 0 85.0%
associate-*r*85.0%
*-commutative85.0%
associate-*r*85.0%
Simplified85.0%
expm1-log1p-u56.7%
expm1-udef54.7%
*-commutative54.7%
associate-*l*49.5%
Applied egg-rr49.5%
expm1-def51.5%
expm1-log1p75.0%
*-commutative75.0%
associate-*l*88.7%
Simplified88.7%
Taylor expanded in z around 0 85.0%
*-commutative85.0%
associate-*l*85.0%
associate-*r*85.0%
Simplified85.0%
Final simplification94.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -2e-209) (+ (* a (* 27.0 b)) (+ (* y (* z (* t -9.0))) (* x 2.0))) (+ (- (* x 2.0) (* t (* y (* 9.0 z)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2e-209) {
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2d-209)) then
tmp = (a * (27.0d0 * b)) + ((y * (z * (t * (-9.0d0)))) + (x * 2.0d0))
else
tmp = ((x * 2.0d0) - (t * (y * (9.0d0 * z)))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2e-209) {
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2e-209: tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0)) else: tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2e-209) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(9.0 * z)))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2e-209)
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
else
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2e-209], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-209}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -2.0000000000000001e-209Initial program 90.8%
sub-neg90.8%
sub-neg90.8%
associate-*l*94.8%
associate-*l*94.8%
Simplified94.8%
sub-neg94.8%
*-commutative94.8%
distribute-rgt-neg-in94.8%
*-commutative94.8%
distribute-lft-neg-in94.8%
metadata-eval94.8%
associate-*l*94.8%
associate-*r*94.8%
*-commutative94.8%
Applied egg-rr94.8%
if -2.0000000000000001e-209 < z Initial program 97.8%
Taylor expanded in y around 0 97.8%
associate-*r*97.8%
*-commutative97.8%
associate-*r*97.8%
Simplified97.8%
Final simplification96.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
(if (<= z -2.5e+24)
(+ (* y (* z (* t -9.0))) (* x 2.0))
(if (<= z 1.75e-44)
(+ (* 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 tmp;
if (z <= -2.5e+24) {
tmp = (y * (z * (t * -9.0))) + (x * 2.0);
} else if (z <= 1.75e-44) {
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) :: tmp
if (z <= (-2.5d+24)) then
tmp = (y * (z * (t * (-9.0d0)))) + (x * 2.0d0)
else if (z <= 1.75d-44) 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 tmp;
if (z <= -2.5e+24) {
tmp = (y * (z * (t * -9.0))) + (x * 2.0);
} else if (z <= 1.75e-44) {
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): tmp = 0 if z <= -2.5e+24: tmp = (y * (z * (t * -9.0))) + (x * 2.0) elif z <= 1.75e-44: 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) tmp = 0.0 if (z <= -2.5e+24) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0)); elseif (z <= 1.75e-44) 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)
tmp = 0.0;
if (z <= -2.5e+24)
tmp = (y * (z * (t * -9.0))) + (x * 2.0);
elseif (z <= 1.75e-44)
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_] := If[LessEqual[z, -2.5e+24], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e-44], 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}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+24}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-44}:\\
\;\;\;\;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 z < -2.50000000000000023e24Initial program 84.3%
sub-neg84.3%
sub-neg84.3%
associate-*l*91.2%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in a around 0 64.8%
*-commutative64.8%
sub-neg64.8%
+-commutative64.8%
*-commutative64.8%
distribute-rgt-neg-in64.8%
*-commutative64.8%
metadata-eval64.8%
associate-*r*64.8%
associate-*l*72.8%
Applied egg-rr72.8%
if -2.50000000000000023e24 < z < 1.7499999999999999e-44Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 82.8%
if 1.7499999999999999e-44 < z Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*88.8%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in a around 0 58.2%
Final simplification73.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.2e-88)
(+ (* y (* z (* t -9.0))) (* a (* 27.0 b)))
(if (<= z 1.9e-44)
(+ (* 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 tmp;
if (z <= -4.2e-88) {
tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
} else if (z <= 1.9e-44) {
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) :: tmp
if (z <= (-4.2d-88)) then
tmp = (y * (z * (t * (-9.0d0)))) + (a * (27.0d0 * b))
else if (z <= 1.9d-44) 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 tmp;
if (z <= -4.2e-88) {
tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
} else if (z <= 1.9e-44) {
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): tmp = 0 if z <= -4.2e-88: tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b)) elif z <= 1.9e-44: 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) tmp = 0.0 if (z <= -4.2e-88) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(a * Float64(27.0 * b))); elseif (z <= 1.9e-44) 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)
tmp = 0.0;
if (z <= -4.2e-88)
tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
elseif (z <= 1.9e-44)
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_] := If[LessEqual[z, -4.2e-88], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-44], 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}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-88}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-44}:\\
\;\;\;\;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 z < -4.1999999999999999e-88Initial program 88.7%
Taylor expanded in y around 0 88.7%
associate-*r*88.7%
*-commutative88.7%
associate-*r*88.6%
Simplified88.6%
Taylor expanded in x around 0 67.1%
associate-*r*67.1%
*-commutative67.1%
associate-*r*67.1%
Simplified67.1%
expm1-log1p-u40.5%
expm1-udef40.0%
*-commutative40.0%
associate-*l*40.9%
Applied egg-rr40.9%
expm1-def41.4%
expm1-log1p71.1%
*-commutative71.1%
associate-*l*74.7%
Simplified74.7%
sub-neg74.7%
associate-*r*74.7%
*-commutative74.7%
associate-*r*74.6%
+-commutative74.6%
distribute-lft-neg-in74.6%
metadata-eval74.6%
associate-*r*71.0%
associate-*r*71.0%
*-commutative71.0%
associate-*r*71.0%
*-commutative71.0%
associate-*r*71.1%
*-commutative71.1%
associate-*r*71.1%
Applied egg-rr71.1%
if -4.1999999999999999e-88 < z < 1.9e-44Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 86.3%
if 1.9e-44 < z Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*88.8%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in a around 0 58.2%
Final simplification73.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 (<= z -6.5e+30) (* y (* -9.0 (* z t))) (if (<= z 1e+63) (+ (* x 2.0) (* 27.0 (* a b))) (* (* z -9.0) (* y 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 tmp;
if (z <= -6.5e+30) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 1e+63) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (z * -9.0) * (y * 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) :: tmp
if (z <= (-6.5d+30)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 1d+63) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (z * (-9.0d0)) * (y * 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 tmp;
if (z <= -6.5e+30) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 1e+63) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (z * -9.0) * (y * t);
}
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 <= -6.5e+30: tmp = y * (-9.0 * (z * t)) elif z <= 1e+63: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (z * -9.0) * (y * t) 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 <= -6.5e+30) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 1e+63) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(z * -9.0) * Float64(y * 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)
tmp = 0.0;
if (z <= -6.5e+30)
tmp = y * (-9.0 * (z * t));
elseif (z <= 1e+63)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (z * -9.0) * (y * 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_] := If[LessEqual[z, -6.5e+30], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+63], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $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 -6.5 \cdot 10^{+30}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 10^{+63}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if z < -6.5e30Initial program 84.1%
Taylor expanded in y around 0 84.1%
associate-*r*84.1%
*-commutative84.1%
associate-*r*84.0%
Simplified84.0%
+-commutative84.0%
associate-+r-84.0%
associate-*l*84.0%
associate-*l*91.1%
*-commutative91.1%
associate-*l*91.1%
Applied egg-rr91.1%
Taylor expanded in y around inf 47.1%
associate-*r*47.1%
metadata-eval47.1%
distribute-lft-neg-in47.1%
*-commutative47.1%
associate-*r*53.9%
*-commutative53.9%
distribute-rgt-neg-in53.9%
metadata-eval53.9%
Simplified53.9%
Taylor expanded in z around 0 53.9%
if -6.5e30 < z < 1.00000000000000006e63Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 81.9%
if 1.00000000000000006e63 < z Initial program 94.1%
sub-neg94.1%
sub-neg94.1%
associate-*l*84.1%
associate-*l*84.2%
Simplified84.2%
Taylor expanded in y around inf 46.7%
associate-*r*46.7%
*-commutative46.7%
Simplified46.7%
add-sqr-sqrt25.6%
pow225.6%
*-commutative25.6%
associate-*l*25.5%
Applied egg-rr25.5%
unpow225.5%
add-sqr-sqrt42.7%
associate-*r*42.7%
associate-*r*42.6%
*-commutative42.6%
associate-*r*50.4%
*-commutative50.4%
associate-*r*50.4%
*-commutative50.4%
Applied egg-rr50.4%
Final simplification68.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -5.8e+27) (+ (* y (* z (* t -9.0))) (* x 2.0)) (if (<= z 1.7e+63) (+ (* x 2.0) (* 27.0 (* a b))) (* (* z -9.0) (* y 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 tmp;
if (z <= -5.8e+27) {
tmp = (y * (z * (t * -9.0))) + (x * 2.0);
} else if (z <= 1.7e+63) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (z * -9.0) * (y * 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) :: tmp
if (z <= (-5.8d+27)) then
tmp = (y * (z * (t * (-9.0d0)))) + (x * 2.0d0)
else if (z <= 1.7d+63) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (z * (-9.0d0)) * (y * 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 tmp;
if (z <= -5.8e+27) {
tmp = (y * (z * (t * -9.0))) + (x * 2.0);
} else if (z <= 1.7e+63) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (z * -9.0) * (y * t);
}
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 <= -5.8e+27: tmp = (y * (z * (t * -9.0))) + (x * 2.0) elif z <= 1.7e+63: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (z * -9.0) * (y * t) 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 <= -5.8e+27) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0)); elseif (z <= 1.7e+63) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(z * -9.0) * Float64(y * 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)
tmp = 0.0;
if (z <= -5.8e+27)
tmp = (y * (z * (t * -9.0))) + (x * 2.0);
elseif (z <= 1.7e+63)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (z * -9.0) * (y * 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_] := If[LessEqual[z, -5.8e+27], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+63], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $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 -5.8 \cdot 10^{+27}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+63}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if z < -5.8000000000000002e27Initial program 84.3%
sub-neg84.3%
sub-neg84.3%
associate-*l*91.2%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in a around 0 64.8%
*-commutative64.8%
sub-neg64.8%
+-commutative64.8%
*-commutative64.8%
distribute-rgt-neg-in64.8%
*-commutative64.8%
metadata-eval64.8%
associate-*r*64.8%
associate-*l*72.8%
Applied egg-rr72.8%
if -5.8000000000000002e27 < z < 1.6999999999999999e63Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 81.8%
if 1.6999999999999999e63 < z Initial program 94.1%
sub-neg94.1%
sub-neg94.1%
associate-*l*84.1%
associate-*l*84.2%
Simplified84.2%
Taylor expanded in y around inf 46.7%
associate-*r*46.7%
*-commutative46.7%
Simplified46.7%
add-sqr-sqrt25.6%
pow225.6%
*-commutative25.6%
associate-*l*25.5%
Applied egg-rr25.5%
unpow225.5%
add-sqr-sqrt42.7%
associate-*r*42.7%
associate-*r*42.6%
*-commutative42.6%
associate-*r*50.4%
*-commutative50.4%
associate-*r*50.4%
*-commutative50.4%
Applied egg-rr50.4%
Final simplification73.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* 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 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*94.5%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in x around inf 30.8%
Final simplification30.8%
(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 2024011
(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)))