
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* x 18.0) y)))
(if (<=
(- (+ (- (* (* z t_1) t) (* t (* a 4.0))) (* b c)) (* (* x 4.0) i))
INFINITY)
(fma
(* k -27.0)
j
(fma t (fma z t_1 (* a -4.0)) (fma b c (* x (* i -4.0)))))
(- (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) (* j (* k 27.0))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (x * 18.0) * y;
double tmp;
if ((((((z * t_1) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) <= ((double) INFINITY)) {
tmp = fma((k * -27.0), j, fma(t, fma(z, t_1, (a * -4.0)), fma(b, c, (x * (i * -4.0)))));
} else {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (j * (k * 27.0));
}
return tmp;
}
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(x * 18.0) * y) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(z * t_1) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) <= Inf) tmp = fma(Float64(k * -27.0), j, fma(t, fma(z, t_1, Float64(a * -4.0)), fma(b, c, Float64(x * Float64(i * -4.0))))); else tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - Float64(j * Float64(k * 27.0))); end return tmp end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(z * t$95$1), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(k * -27.0), $MachinePrecision] * j + N[(t * N[(z * t$95$1 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c + N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 18\right) \cdot y\\
\mathbf{if}\;\left(\left(\left(z \cdot t_1\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, \mathsf{fma}\left(t, \mathsf{fma}\left(z, t_1, a \cdot -4\right), \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - j \cdot \left(k \cdot 27\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) < +inf.0Initial program 94.8%
Simplified94.4%
+-commutative94.4%
*-commutative94.4%
fma-def95.7%
fma-udef95.7%
associate-*l*95.7%
associate-*r*95.7%
*-commutative95.7%
fma-def95.7%
*-commutative95.7%
*-commutative95.7%
Applied egg-rr95.7%
if +inf.0 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) Initial program 0.0%
associate-*l*0.0%
associate--l+0.0%
distribute-rgt-out--11.1%
associate-*l*22.2%
associate-*l*22.2%
Simplified22.2%
Taylor expanded in x around inf 77.8%
Final simplification93.8%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(-
(+ (- (* (* z (* (* x 18.0) y)) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* k (* j 27.0)))))
(if (<= t_1 INFINITY)
t_1
(- (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) (* j (* k 27.0))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((z * ((x * 18.0) * y)) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - (k * (j * 27.0));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (j * (k * 27.0));
}
return tmp;
}
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((z * ((x * 18.0) * y)) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - (k * (j * 27.0));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (j * (k * 27.0));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (((((z * ((x * 18.0) * y)) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - (k * (j * 27.0)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (j * (k * 27.0)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(z * Float64(Float64(x * 18.0) * y)) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(k * Float64(j * 27.0))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - Float64(j * Float64(k * 27.0))); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (((((z * ((x * 18.0) * y)) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - (k * (j * 27.0));
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (j * (k * 27.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(z * N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(\left(\left(\left(z \cdot \left(\left(x \cdot 18\right) \cdot y\right)\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - j \cdot \left(k \cdot 27\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) < +inf.0Initial program 96.5%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) Initial program 0.0%
associate-*l*0.0%
associate--l+0.0%
distribute-rgt-out--9.7%
associate-*l*19.4%
associate-*l*19.4%
Simplified19.4%
Taylor expanded in x around inf 67.7%
Final simplification93.0%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 27.0 (* k j))))
(t_2 (* (* k -27.0) j))
(t_3 (+ (* x (* i -4.0)) t_2))
(t_4 (+ t_2 (* -4.0 (* t a)))))
(if (<= (* b c) -1.25e-12)
t_1
(if (<= (* b c) -2.45e-275)
t_4
(if (<= (* b c) 1.65e-292)
t_3
(if (<= (* b c) 6.8e-136)
t_4
(if (<= (* b c) 1.42e+94)
t_3
(if (<= (* b c) 2.6e+120)
(* t (* 18.0 (* x (* y z))))
(if (<= (* b c) 6.2e+179) t_3 t_1)))))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (k * j));
double t_2 = (k * -27.0) * j;
double t_3 = (x * (i * -4.0)) + t_2;
double t_4 = t_2 + (-4.0 * (t * a));
double tmp;
if ((b * c) <= -1.25e-12) {
tmp = t_1;
} else if ((b * c) <= -2.45e-275) {
tmp = t_4;
} else if ((b * c) <= 1.65e-292) {
tmp = t_3;
} else if ((b * c) <= 6.8e-136) {
tmp = t_4;
} else if ((b * c) <= 1.42e+94) {
tmp = t_3;
} else if ((b * c) <= 2.6e+120) {
tmp = t * (18.0 * (x * (y * z)));
} else if ((b * c) <= 6.2e+179) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (b * c) - (27.0d0 * (k * j))
t_2 = (k * (-27.0d0)) * j
t_3 = (x * (i * (-4.0d0))) + t_2
t_4 = t_2 + ((-4.0d0) * (t * a))
if ((b * c) <= (-1.25d-12)) then
tmp = t_1
else if ((b * c) <= (-2.45d-275)) then
tmp = t_4
else if ((b * c) <= 1.65d-292) then
tmp = t_3
else if ((b * c) <= 6.8d-136) then
tmp = t_4
else if ((b * c) <= 1.42d+94) then
tmp = t_3
else if ((b * c) <= 2.6d+120) then
tmp = t * (18.0d0 * (x * (y * z)))
else if ((b * c) <= 6.2d+179) then
tmp = t_3
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (k * j));
double t_2 = (k * -27.0) * j;
double t_3 = (x * (i * -4.0)) + t_2;
double t_4 = t_2 + (-4.0 * (t * a));
double tmp;
if ((b * c) <= -1.25e-12) {
tmp = t_1;
} else if ((b * c) <= -2.45e-275) {
tmp = t_4;
} else if ((b * c) <= 1.65e-292) {
tmp = t_3;
} else if ((b * c) <= 6.8e-136) {
tmp = t_4;
} else if ((b * c) <= 1.42e+94) {
tmp = t_3;
} else if ((b * c) <= 2.6e+120) {
tmp = t * (18.0 * (x * (y * z)));
} else if ((b * c) <= 6.2e+179) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (27.0 * (k * j)) t_2 = (k * -27.0) * j t_3 = (x * (i * -4.0)) + t_2 t_4 = t_2 + (-4.0 * (t * a)) tmp = 0 if (b * c) <= -1.25e-12: tmp = t_1 elif (b * c) <= -2.45e-275: tmp = t_4 elif (b * c) <= 1.65e-292: tmp = t_3 elif (b * c) <= 6.8e-136: tmp = t_4 elif (b * c) <= 1.42e+94: tmp = t_3 elif (b * c) <= 2.6e+120: tmp = t * (18.0 * (x * (y * z))) elif (b * c) <= 6.2e+179: tmp = t_3 else: tmp = t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(27.0 * Float64(k * j))) t_2 = Float64(Float64(k * -27.0) * j) t_3 = Float64(Float64(x * Float64(i * -4.0)) + t_2) t_4 = Float64(t_2 + Float64(-4.0 * Float64(t * a))) tmp = 0.0 if (Float64(b * c) <= -1.25e-12) tmp = t_1; elseif (Float64(b * c) <= -2.45e-275) tmp = t_4; elseif (Float64(b * c) <= 1.65e-292) tmp = t_3; elseif (Float64(b * c) <= 6.8e-136) tmp = t_4; elseif (Float64(b * c) <= 1.42e+94) tmp = t_3; elseif (Float64(b * c) <= 2.6e+120) tmp = Float64(t * Float64(18.0 * Float64(x * Float64(y * z)))); elseif (Float64(b * c) <= 6.2e+179) tmp = t_3; else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (27.0 * (k * j));
t_2 = (k * -27.0) * j;
t_3 = (x * (i * -4.0)) + t_2;
t_4 = t_2 + (-4.0 * (t * a));
tmp = 0.0;
if ((b * c) <= -1.25e-12)
tmp = t_1;
elseif ((b * c) <= -2.45e-275)
tmp = t_4;
elseif ((b * c) <= 1.65e-292)
tmp = t_3;
elseif ((b * c) <= 6.8e-136)
tmp = t_4;
elseif ((b * c) <= 1.42e+94)
tmp = t_3;
elseif ((b * c) <= 2.6e+120)
tmp = t * (18.0 * (x * (y * z)));
elseif ((b * c) <= 6.2e+179)
tmp = t_3;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1.25e-12], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -2.45e-275], t$95$4, If[LessEqual[N[(b * c), $MachinePrecision], 1.65e-292], t$95$3, If[LessEqual[N[(b * c), $MachinePrecision], 6.8e-136], t$95$4, If[LessEqual[N[(b * c), $MachinePrecision], 1.42e+94], t$95$3, If[LessEqual[N[(b * c), $MachinePrecision], 2.6e+120], N[(t * N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 6.2e+179], t$95$3, t$95$1]]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(k \cdot j\right)\\
t_2 := \left(k \cdot -27\right) \cdot j\\
t_3 := x \cdot \left(i \cdot -4\right) + t_2\\
t_4 := t_2 + -4 \cdot \left(t \cdot a\right)\\
\mathbf{if}\;b \cdot c \leq -1.25 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -2.45 \cdot 10^{-275}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;b \cdot c \leq 1.65 \cdot 10^{-292}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \cdot c \leq 6.8 \cdot 10^{-136}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;b \cdot c \leq 1.42 \cdot 10^{+94}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \cdot c \leq 2.6 \cdot 10^{+120}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 6.2 \cdot 10^{+179}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 b c) < -1.24999999999999992e-12 or 6.2e179 < (*.f64 b c) Initial program 80.1%
associate-*l*80.1%
associate--l+80.1%
distribute-rgt-out--81.1%
associate-*l*82.9%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in t around 0 78.8%
Taylor expanded in i around 0 73.0%
if -1.24999999999999992e-12 < (*.f64 b c) < -2.44999999999999991e-275 or 1.64999999999999997e-292 < (*.f64 b c) < 6.8000000000000001e-136Initial program 86.6%
Simplified88.3%
Taylor expanded in a around inf 59.0%
*-commutative59.0%
Simplified59.0%
if -2.44999999999999991e-275 < (*.f64 b c) < 1.64999999999999997e-292 or 6.8000000000000001e-136 < (*.f64 b c) < 1.4200000000000001e94 or 2.5999999999999999e120 < (*.f64 b c) < 6.2e179Initial program 88.3%
Simplified91.9%
Taylor expanded in i around inf 66.3%
associate-*r*66.3%
*-commutative66.3%
Simplified66.3%
if 1.4200000000000001e94 < (*.f64 b c) < 2.5999999999999999e120Initial program 99.7%
associate-*l*99.7%
associate--l+99.7%
distribute-rgt-out--99.7%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in i around 0 100.0%
Taylor expanded in j around 0 100.0%
Taylor expanded in b around 0 100.0%
Taylor expanded in x around inf 84.2%
Final simplification67.8%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k 27.0))))
(if (or (<= t -6.2e+78) (not (<= t 2.4e+185)))
(- (+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))) t_1)
(-
(+
(- (* x (* (* y t) (* 18.0 z))) (* a (* t 4.0)))
(- (* b c) (* x (* 4.0 i))))
t_1))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double tmp;
if ((t <= -6.2e+78) || !(t <= 2.4e+185)) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
} else {
tmp = (((x * ((y * t) * (18.0 * z))) - (a * (t * 4.0))) + ((b * c) - (x * (4.0 * i)))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = j * (k * 27.0d0)
if ((t <= (-6.2d+78)) .or. (.not. (t <= 2.4d+185))) then
tmp = ((b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))) - t_1
else
tmp = (((x * ((y * t) * (18.0d0 * z))) - (a * (t * 4.0d0))) + ((b * c) - (x * (4.0d0 * i)))) - t_1
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double tmp;
if ((t <= -6.2e+78) || !(t <= 2.4e+185)) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
} else {
tmp = (((x * ((y * t) * (18.0 * z))) - (a * (t * 4.0))) + ((b * c) - (x * (4.0 * i)))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * 27.0) tmp = 0 if (t <= -6.2e+78) or not (t <= 2.4e+185): tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1 else: tmp = (((x * ((y * t) * (18.0 * z))) - (a * (t * 4.0))) + ((b * c) - (x * (4.0 * i)))) - t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * 27.0)) tmp = 0.0 if ((t <= -6.2e+78) || !(t <= 2.4e+185)) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))) - t_1); else tmp = Float64(Float64(Float64(Float64(x * Float64(Float64(y * t) * Float64(18.0 * z))) - Float64(a * Float64(t * 4.0))) + Float64(Float64(b * c) - Float64(x * Float64(4.0 * i)))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * 27.0);
tmp = 0.0;
if ((t <= -6.2e+78) || ~((t <= 2.4e+185)))
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
else
tmp = (((x * ((y * t) * (18.0 * z))) - (a * (t * 4.0))) + ((b * c) - (x * (4.0 * i)))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -6.2e+78], N[Not[LessEqual[t, 2.4e+185]], $MachinePrecision]], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(N[(x * N[(N[(y * t), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot 27\right)\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+78} \lor \neg \left(t \leq 2.4 \cdot 10^{+185}\right):\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot \left(\left(y \cdot t\right) \cdot \left(18 \cdot z\right)\right) - a \cdot \left(t \cdot 4\right)\right) + \left(b \cdot c - x \cdot \left(4 \cdot i\right)\right)\right) - t_1\\
\end{array}
\end{array}
if t < -6.2e78 or 2.39999999999999989e185 < t Initial program 75.3%
associate-*l*75.3%
associate--l+75.3%
distribute-rgt-out--79.6%
associate-*l*79.6%
associate-*l*79.6%
Simplified79.6%
Taylor expanded in i around 0 91.3%
if -6.2e78 < t < 2.39999999999999989e185Initial program 88.3%
associate-*l*87.9%
associate--l+87.9%
distribute-rgt-out--87.9%
associate-*l*89.4%
associate-*l*89.4%
Simplified89.4%
associate-*r*87.9%
distribute-rgt-out--87.9%
associate-*r*89.4%
*-commutative89.4%
associate-*r*87.9%
*-commutative87.9%
*-commutative87.9%
associate-*l*87.9%
Applied egg-rr87.9%
Taylor expanded in t around 0 89.4%
*-commutative89.4%
*-commutative89.4%
*-commutative89.4%
associate-*r*91.5%
associate-*r*92.8%
associate-*r*92.8%
associate-*r*90.6%
associate-*l*87.9%
*-commutative87.9%
associate-*r*89.4%
*-commutative89.4%
associate-*l*89.4%
associate-*l*91.5%
associate-*r*91.5%
*-commutative91.5%
*-commutative91.5%
*-commutative91.5%
associate-*r*92.5%
associate-*l*92.5%
*-commutative92.5%
Simplified92.5%
Final simplification92.2%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k 27.0))))
(if (or (<= x -1.6e+232) (not (<= x 2.2e+135)))
(- (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) t_1)
(-
(+
(- (* b c) (* x (* 4.0 i)))
(* t (- (* (* x 18.0) (* y z)) (* a 4.0))))
t_1))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double tmp;
if ((x <= -1.6e+232) || !(x <= 2.2e+135)) {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1;
} else {
tmp = (((b * c) - (x * (4.0 * i))) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = j * (k * 27.0d0)
if ((x <= (-1.6d+232)) .or. (.not. (x <= 2.2d+135))) then
tmp = (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))) - t_1
else
tmp = (((b * c) - (x * (4.0d0 * i))) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - t_1
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double tmp;
if ((x <= -1.6e+232) || !(x <= 2.2e+135)) {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1;
} else {
tmp = (((b * c) - (x * (4.0 * i))) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * 27.0) tmp = 0 if (x <= -1.6e+232) or not (x <= 2.2e+135): tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1 else: tmp = (((b * c) - (x * (4.0 * i))) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * 27.0)) tmp = 0.0 if ((x <= -1.6e+232) || !(x <= 2.2e+135)) tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - t_1); else tmp = Float64(Float64(Float64(Float64(b * c) - Float64(x * Float64(4.0 * i))) + Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * 27.0);
tmp = 0.0;
if ((x <= -1.6e+232) || ~((x <= 2.2e+135)))
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1;
else
tmp = (((b * c) - (x * (4.0 * i))) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -1.6e+232], N[Not[LessEqual[x, 2.2e+135]], $MachinePrecision]], N[(N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(N[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot 27\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+232} \lor \neg \left(x \leq 2.2 \cdot 10^{+135}\right):\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b \cdot c - x \cdot \left(4 \cdot i\right)\right) + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - t_1\\
\end{array}
\end{array}
if x < -1.6000000000000001e232 or 2.1999999999999999e135 < x Initial program 55.6%
associate-*l*55.6%
associate--l+55.6%
distribute-rgt-out--55.6%
associate-*l*60.0%
associate-*l*60.0%
Simplified60.0%
Taylor expanded in x around inf 81.2%
if -1.6000000000000001e232 < x < 2.1999999999999999e135Initial program 91.1%
associate-*l*90.6%
associate--l+90.6%
distribute-rgt-out--92.0%
associate-*l*92.5%
associate-*l*92.5%
Simplified92.5%
Final simplification90.5%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* (* x 4.0) i)))
(t_2 (- (* b c) (* 27.0 (* k j))))
(t_3 (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))
(t_4 (* (* k -27.0) j))
(t_5 (+ t_4 (* (* 18.0 t) (* z (* x y))))))
(if (<= t -5.5e+125)
t_3
(if (<= t -4.4e-29)
t_5
(if (<= t -3e-138)
t_1
(if (<= t -1.4e-178)
t_5
(if (<= t 6e-305)
t_1
(if (<= t 5.7e-255)
t_2
(if (<= t 1e-157)
t_1
(if (<= t 1.9e+51)
(+ (* x (* i -4.0)) t_4)
(if (<= t 4.5e+80) t_2 t_3)))))))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((x * 4.0) * i);
double t_2 = (b * c) - (27.0 * (k * j));
double t_3 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_4 = (k * -27.0) * j;
double t_5 = t_4 + ((18.0 * t) * (z * (x * y)));
double tmp;
if (t <= -5.5e+125) {
tmp = t_3;
} else if (t <= -4.4e-29) {
tmp = t_5;
} else if (t <= -3e-138) {
tmp = t_1;
} else if (t <= -1.4e-178) {
tmp = t_5;
} else if (t <= 6e-305) {
tmp = t_1;
} else if (t <= 5.7e-255) {
tmp = t_2;
} else if (t <= 1e-157) {
tmp = t_1;
} else if (t <= 1.9e+51) {
tmp = (x * (i * -4.0)) + t_4;
} else if (t <= 4.5e+80) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = (b * c) - ((x * 4.0d0) * i)
t_2 = (b * c) - (27.0d0 * (k * j))
t_3 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
t_4 = (k * (-27.0d0)) * j
t_5 = t_4 + ((18.0d0 * t) * (z * (x * y)))
if (t <= (-5.5d+125)) then
tmp = t_3
else if (t <= (-4.4d-29)) then
tmp = t_5
else if (t <= (-3d-138)) then
tmp = t_1
else if (t <= (-1.4d-178)) then
tmp = t_5
else if (t <= 6d-305) then
tmp = t_1
else if (t <= 5.7d-255) then
tmp = t_2
else if (t <= 1d-157) then
tmp = t_1
else if (t <= 1.9d+51) then
tmp = (x * (i * (-4.0d0))) + t_4
else if (t <= 4.5d+80) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((x * 4.0) * i);
double t_2 = (b * c) - (27.0 * (k * j));
double t_3 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_4 = (k * -27.0) * j;
double t_5 = t_4 + ((18.0 * t) * (z * (x * y)));
double tmp;
if (t <= -5.5e+125) {
tmp = t_3;
} else if (t <= -4.4e-29) {
tmp = t_5;
} else if (t <= -3e-138) {
tmp = t_1;
} else if (t <= -1.4e-178) {
tmp = t_5;
} else if (t <= 6e-305) {
tmp = t_1;
} else if (t <= 5.7e-255) {
tmp = t_2;
} else if (t <= 1e-157) {
tmp = t_1;
} else if (t <= 1.9e+51) {
tmp = (x * (i * -4.0)) + t_4;
} else if (t <= 4.5e+80) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - ((x * 4.0) * i) t_2 = (b * c) - (27.0 * (k * j)) t_3 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) t_4 = (k * -27.0) * j t_5 = t_4 + ((18.0 * t) * (z * (x * y))) tmp = 0 if t <= -5.5e+125: tmp = t_3 elif t <= -4.4e-29: tmp = t_5 elif t <= -3e-138: tmp = t_1 elif t <= -1.4e-178: tmp = t_5 elif t <= 6e-305: tmp = t_1 elif t <= 5.7e-255: tmp = t_2 elif t <= 1e-157: tmp = t_1 elif t <= 1.9e+51: tmp = (x * (i * -4.0)) + t_4 elif t <= 4.5e+80: tmp = t_2 else: tmp = t_3 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(Float64(x * 4.0) * i)) t_2 = Float64(Float64(b * c) - Float64(27.0 * Float64(k * j))) t_3 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) t_4 = Float64(Float64(k * -27.0) * j) t_5 = Float64(t_4 + Float64(Float64(18.0 * t) * Float64(z * Float64(x * y)))) tmp = 0.0 if (t <= -5.5e+125) tmp = t_3; elseif (t <= -4.4e-29) tmp = t_5; elseif (t <= -3e-138) tmp = t_1; elseif (t <= -1.4e-178) tmp = t_5; elseif (t <= 6e-305) tmp = t_1; elseif (t <= 5.7e-255) tmp = t_2; elseif (t <= 1e-157) tmp = t_1; elseif (t <= 1.9e+51) tmp = Float64(Float64(x * Float64(i * -4.0)) + t_4); elseif (t <= 4.5e+80) tmp = t_2; else tmp = t_3; end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - ((x * 4.0) * i);
t_2 = (b * c) - (27.0 * (k * j));
t_3 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
t_4 = (k * -27.0) * j;
t_5 = t_4 + ((18.0 * t) * (z * (x * y)));
tmp = 0.0;
if (t <= -5.5e+125)
tmp = t_3;
elseif (t <= -4.4e-29)
tmp = t_5;
elseif (t <= -3e-138)
tmp = t_1;
elseif (t <= -1.4e-178)
tmp = t_5;
elseif (t <= 6e-305)
tmp = t_1;
elseif (t <= 5.7e-255)
tmp = t_2;
elseif (t <= 1e-157)
tmp = t_1;
elseif (t <= 1.9e+51)
tmp = (x * (i * -4.0)) + t_4;
elseif (t <= 4.5e+80)
tmp = t_2;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 + N[(N[(18.0 * t), $MachinePrecision] * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.5e+125], t$95$3, If[LessEqual[t, -4.4e-29], t$95$5, If[LessEqual[t, -3e-138], t$95$1, If[LessEqual[t, -1.4e-178], t$95$5, If[LessEqual[t, 6e-305], t$95$1, If[LessEqual[t, 5.7e-255], t$95$2, If[LessEqual[t, 1e-157], t$95$1, If[LessEqual[t, 1.9e+51], N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision], If[LessEqual[t, 4.5e+80], t$95$2, t$95$3]]]]]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := b \cdot c - \left(x \cdot 4\right) \cdot i\\
t_2 := b \cdot c - 27 \cdot \left(k \cdot j\right)\\
t_3 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
t_4 := \left(k \cdot -27\right) \cdot j\\
t_5 := t_4 + \left(18 \cdot t\right) \cdot \left(z \cdot \left(x \cdot y\right)\right)\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{+125}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -4.4 \cdot 10^{-29}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;t \leq -3 \cdot 10^{-138}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-178}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-305}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.7 \cdot 10^{-255}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 10^{-157}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+51}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right) + t_4\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+80}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -5.49999999999999996e125 or 4.50000000000000007e80 < t Initial program 76.6%
associate-*l*76.6%
associate--l+76.6%
distribute-rgt-out--80.8%
associate-*l*80.8%
associate-*l*80.8%
Simplified80.8%
Taylor expanded in i around 0 86.4%
Taylor expanded in j around 0 77.5%
Taylor expanded in b around 0 73.7%
if -5.49999999999999996e125 < t < -4.39999999999999981e-29 or -3.0000000000000001e-138 < t < -1.4000000000000001e-178Initial program 95.4%
Simplified95.4%
Taylor expanded in y around inf 69.9%
associate-*r*69.9%
associate-*r*72.1%
Simplified72.1%
if -4.39999999999999981e-29 < t < -3.0000000000000001e-138 or -1.4000000000000001e-178 < t < 6.0000000000000002e-305 or 5.7000000000000002e-255 < t < 9.99999999999999943e-158Initial program 85.8%
associate-*l*85.8%
associate--l+85.7%
distribute-rgt-out--85.7%
associate-*l*88.4%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in t around 0 87.4%
Taylor expanded in i around inf 73.0%
*-commutative73.0%
associate-*r*73.0%
Simplified73.0%
if 6.0000000000000002e-305 < t < 5.7000000000000002e-255 or 1.8999999999999999e51 < t < 4.50000000000000007e80Initial program 82.4%
associate-*l*78.1%
associate--l+78.1%
distribute-rgt-out--78.1%
associate-*l*82.1%
associate-*l*82.1%
Simplified82.1%
Taylor expanded in t around 0 77.8%
Taylor expanded in i around 0 82.3%
if 9.99999999999999943e-158 < t < 1.8999999999999999e51Initial program 87.5%
Simplified95.0%
Taylor expanded in i around inf 64.4%
associate-*r*64.4%
*-commutative64.4%
Simplified64.4%
Final simplification72.5%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 27.0 (* k j))))
(t_2 (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))
(t_3 (+ (* x (* i -4.0)) (* (* k -27.0) j)))
(t_4 (- (* b c) (* (* x 4.0) i))))
(if (<= t -9.5e+81)
t_2
(if (<= t -1.4e+29)
t_3
(if (<= t -7.4e-6)
t_2
(if (<= t -8.2e-145)
t_4
(if (<= t 4.2e-257)
t_1
(if (<= t 1.1e-157)
t_4
(if (<= t 2.15e+49) t_3 (if (<= t 5e+82) t_1 t_2))))))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (k * j));
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_3 = (x * (i * -4.0)) + ((k * -27.0) * j);
double t_4 = (b * c) - ((x * 4.0) * i);
double tmp;
if (t <= -9.5e+81) {
tmp = t_2;
} else if (t <= -1.4e+29) {
tmp = t_3;
} else if (t <= -7.4e-6) {
tmp = t_2;
} else if (t <= -8.2e-145) {
tmp = t_4;
} else if (t <= 4.2e-257) {
tmp = t_1;
} else if (t <= 1.1e-157) {
tmp = t_4;
} else if (t <= 2.15e+49) {
tmp = t_3;
} else if (t <= 5e+82) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (b * c) - (27.0d0 * (k * j))
t_2 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
t_3 = (x * (i * (-4.0d0))) + ((k * (-27.0d0)) * j)
t_4 = (b * c) - ((x * 4.0d0) * i)
if (t <= (-9.5d+81)) then
tmp = t_2
else if (t <= (-1.4d+29)) then
tmp = t_3
else if (t <= (-7.4d-6)) then
tmp = t_2
else if (t <= (-8.2d-145)) then
tmp = t_4
else if (t <= 4.2d-257) then
tmp = t_1
else if (t <= 1.1d-157) then
tmp = t_4
else if (t <= 2.15d+49) then
tmp = t_3
else if (t <= 5d+82) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (k * j));
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_3 = (x * (i * -4.0)) + ((k * -27.0) * j);
double t_4 = (b * c) - ((x * 4.0) * i);
double tmp;
if (t <= -9.5e+81) {
tmp = t_2;
} else if (t <= -1.4e+29) {
tmp = t_3;
} else if (t <= -7.4e-6) {
tmp = t_2;
} else if (t <= -8.2e-145) {
tmp = t_4;
} else if (t <= 4.2e-257) {
tmp = t_1;
} else if (t <= 1.1e-157) {
tmp = t_4;
} else if (t <= 2.15e+49) {
tmp = t_3;
} else if (t <= 5e+82) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (27.0 * (k * j)) t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) t_3 = (x * (i * -4.0)) + ((k * -27.0) * j) t_4 = (b * c) - ((x * 4.0) * i) tmp = 0 if t <= -9.5e+81: tmp = t_2 elif t <= -1.4e+29: tmp = t_3 elif t <= -7.4e-6: tmp = t_2 elif t <= -8.2e-145: tmp = t_4 elif t <= 4.2e-257: tmp = t_1 elif t <= 1.1e-157: tmp = t_4 elif t <= 2.15e+49: tmp = t_3 elif t <= 5e+82: tmp = t_1 else: tmp = t_2 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(27.0 * Float64(k * j))) t_2 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) t_3 = Float64(Float64(x * Float64(i * -4.0)) + Float64(Float64(k * -27.0) * j)) t_4 = Float64(Float64(b * c) - Float64(Float64(x * 4.0) * i)) tmp = 0.0 if (t <= -9.5e+81) tmp = t_2; elseif (t <= -1.4e+29) tmp = t_3; elseif (t <= -7.4e-6) tmp = t_2; elseif (t <= -8.2e-145) tmp = t_4; elseif (t <= 4.2e-257) tmp = t_1; elseif (t <= 1.1e-157) tmp = t_4; elseif (t <= 2.15e+49) tmp = t_3; elseif (t <= 5e+82) tmp = t_1; else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (27.0 * (k * j));
t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
t_3 = (x * (i * -4.0)) + ((k * -27.0) * j);
t_4 = (b * c) - ((x * 4.0) * i);
tmp = 0.0;
if (t <= -9.5e+81)
tmp = t_2;
elseif (t <= -1.4e+29)
tmp = t_3;
elseif (t <= -7.4e-6)
tmp = t_2;
elseif (t <= -8.2e-145)
tmp = t_4;
elseif (t <= 4.2e-257)
tmp = t_1;
elseif (t <= 1.1e-157)
tmp = t_4;
elseif (t <= 2.15e+49)
tmp = t_3;
elseif (t <= 5e+82)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] + N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(b * c), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.5e+81], t$95$2, If[LessEqual[t, -1.4e+29], t$95$3, If[LessEqual[t, -7.4e-6], t$95$2, If[LessEqual[t, -8.2e-145], t$95$4, If[LessEqual[t, 4.2e-257], t$95$1, If[LessEqual[t, 1.1e-157], t$95$4, If[LessEqual[t, 2.15e+49], t$95$3, If[LessEqual[t, 5e+82], t$95$1, t$95$2]]]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(k \cdot j\right)\\
t_2 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
t_3 := x \cdot \left(i \cdot -4\right) + \left(k \cdot -27\right) \cdot j\\
t_4 := b \cdot c - \left(x \cdot 4\right) \cdot i\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{+81}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{+29}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -7.4 \cdot 10^{-6}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -8.2 \cdot 10^{-145}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-257}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-157}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{+49}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+82}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -9.50000000000000083e81 or -1.4e29 < t < -7.4000000000000003e-6 or 5.00000000000000015e82 < t Initial program 80.1%
associate-*l*80.2%
associate--l+80.2%
distribute-rgt-out--83.4%
associate-*l*83.4%
associate-*l*83.4%
Simplified83.4%
Taylor expanded in i around 0 88.4%
Taylor expanded in j around 0 79.1%
Taylor expanded in b around 0 74.9%
if -9.50000000000000083e81 < t < -1.4e29 or 1.10000000000000005e-157 < t < 2.15e49Initial program 89.2%
Simplified96.4%
Taylor expanded in i around inf 62.9%
associate-*r*62.9%
*-commutative62.9%
Simplified62.9%
if -7.4000000000000003e-6 < t < -8.1999999999999995e-145 or 4.2000000000000002e-257 < t < 1.10000000000000005e-157Initial program 87.7%
associate-*l*87.7%
associate--l+87.7%
distribute-rgt-out--87.7%
associate-*l*87.7%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in t around 0 81.7%
Taylor expanded in i around inf 69.0%
*-commutative69.0%
associate-*r*69.0%
Simplified69.0%
if -8.1999999999999995e-145 < t < 4.2000000000000002e-257 or 2.15e49 < t < 5.00000000000000015e82Initial program 85.3%
associate-*l*83.5%
associate--l+83.5%
distribute-rgt-out--83.5%
associate-*l*87.0%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in t around 0 86.4%
Taylor expanded in i around 0 72.3%
Final simplification70.4%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* k -27.0) j))
(t_2 (- (* b c) (* (* x 4.0) i)))
(t_3 (* x (* y z)))
(t_4 (* t (- (* 18.0 t_3) (* a 4.0))))
(t_5 (- (* b c) (* 27.0 (* k j)))))
(if (<= t -2.8e+125)
t_4
(if (<= t -0.00036)
(+ (* 18.0 (* t t_3)) t_1)
(if (<= t -3.1e-145)
t_2
(if (<= t 3e-258)
t_5
(if (<= t 1.3e-158)
t_2
(if (<= t 3.5e+49)
(+ (* x (* i -4.0)) t_1)
(if (<= t 1.05e+83) t_5 t_4)))))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (k * -27.0) * j;
double t_2 = (b * c) - ((x * 4.0) * i);
double t_3 = x * (y * z);
double t_4 = t * ((18.0 * t_3) - (a * 4.0));
double t_5 = (b * c) - (27.0 * (k * j));
double tmp;
if (t <= -2.8e+125) {
tmp = t_4;
} else if (t <= -0.00036) {
tmp = (18.0 * (t * t_3)) + t_1;
} else if (t <= -3.1e-145) {
tmp = t_2;
} else if (t <= 3e-258) {
tmp = t_5;
} else if (t <= 1.3e-158) {
tmp = t_2;
} else if (t <= 3.5e+49) {
tmp = (x * (i * -4.0)) + t_1;
} else if (t <= 1.05e+83) {
tmp = t_5;
} else {
tmp = t_4;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = (k * (-27.0d0)) * j
t_2 = (b * c) - ((x * 4.0d0) * i)
t_3 = x * (y * z)
t_4 = t * ((18.0d0 * t_3) - (a * 4.0d0))
t_5 = (b * c) - (27.0d0 * (k * j))
if (t <= (-2.8d+125)) then
tmp = t_4
else if (t <= (-0.00036d0)) then
tmp = (18.0d0 * (t * t_3)) + t_1
else if (t <= (-3.1d-145)) then
tmp = t_2
else if (t <= 3d-258) then
tmp = t_5
else if (t <= 1.3d-158) then
tmp = t_2
else if (t <= 3.5d+49) then
tmp = (x * (i * (-4.0d0))) + t_1
else if (t <= 1.05d+83) then
tmp = t_5
else
tmp = t_4
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (k * -27.0) * j;
double t_2 = (b * c) - ((x * 4.0) * i);
double t_3 = x * (y * z);
double t_4 = t * ((18.0 * t_3) - (a * 4.0));
double t_5 = (b * c) - (27.0 * (k * j));
double tmp;
if (t <= -2.8e+125) {
tmp = t_4;
} else if (t <= -0.00036) {
tmp = (18.0 * (t * t_3)) + t_1;
} else if (t <= -3.1e-145) {
tmp = t_2;
} else if (t <= 3e-258) {
tmp = t_5;
} else if (t <= 1.3e-158) {
tmp = t_2;
} else if (t <= 3.5e+49) {
tmp = (x * (i * -4.0)) + t_1;
} else if (t <= 1.05e+83) {
tmp = t_5;
} else {
tmp = t_4;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (k * -27.0) * j t_2 = (b * c) - ((x * 4.0) * i) t_3 = x * (y * z) t_4 = t * ((18.0 * t_3) - (a * 4.0)) t_5 = (b * c) - (27.0 * (k * j)) tmp = 0 if t <= -2.8e+125: tmp = t_4 elif t <= -0.00036: tmp = (18.0 * (t * t_3)) + t_1 elif t <= -3.1e-145: tmp = t_2 elif t <= 3e-258: tmp = t_5 elif t <= 1.3e-158: tmp = t_2 elif t <= 3.5e+49: tmp = (x * (i * -4.0)) + t_1 elif t <= 1.05e+83: tmp = t_5 else: tmp = t_4 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(k * -27.0) * j) t_2 = Float64(Float64(b * c) - Float64(Float64(x * 4.0) * i)) t_3 = Float64(x * Float64(y * z)) t_4 = Float64(t * Float64(Float64(18.0 * t_3) - Float64(a * 4.0))) t_5 = Float64(Float64(b * c) - Float64(27.0 * Float64(k * j))) tmp = 0.0 if (t <= -2.8e+125) tmp = t_4; elseif (t <= -0.00036) tmp = Float64(Float64(18.0 * Float64(t * t_3)) + t_1); elseif (t <= -3.1e-145) tmp = t_2; elseif (t <= 3e-258) tmp = t_5; elseif (t <= 1.3e-158) tmp = t_2; elseif (t <= 3.5e+49) tmp = Float64(Float64(x * Float64(i * -4.0)) + t_1); elseif (t <= 1.05e+83) tmp = t_5; else tmp = t_4; end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (k * -27.0) * j;
t_2 = (b * c) - ((x * 4.0) * i);
t_3 = x * (y * z);
t_4 = t * ((18.0 * t_3) - (a * 4.0));
t_5 = (b * c) - (27.0 * (k * j));
tmp = 0.0;
if (t <= -2.8e+125)
tmp = t_4;
elseif (t <= -0.00036)
tmp = (18.0 * (t * t_3)) + t_1;
elseif (t <= -3.1e-145)
tmp = t_2;
elseif (t <= 3e-258)
tmp = t_5;
elseif (t <= 1.3e-158)
tmp = t_2;
elseif (t <= 3.5e+49)
tmp = (x * (i * -4.0)) + t_1;
elseif (t <= 1.05e+83)
tmp = t_5;
else
tmp = t_4;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t * N[(N[(18.0 * t$95$3), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.8e+125], t$95$4, If[LessEqual[t, -0.00036], N[(N[(18.0 * N[(t * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, -3.1e-145], t$95$2, If[LessEqual[t, 3e-258], t$95$5, If[LessEqual[t, 1.3e-158], t$95$2, If[LessEqual[t, 3.5e+49], N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 1.05e+83], t$95$5, t$95$4]]]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(k \cdot -27\right) \cdot j\\
t_2 := b \cdot c - \left(x \cdot 4\right) \cdot i\\
t_3 := x \cdot \left(y \cdot z\right)\\
t_4 := t \cdot \left(18 \cdot t_3 - a \cdot 4\right)\\
t_5 := b \cdot c - 27 \cdot \left(k \cdot j\right)\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{+125}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq -0.00036:\\
\;\;\;\;18 \cdot \left(t \cdot t_3\right) + t_1\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-145}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-258}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-158}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right) + t_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+83}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
if t < -2.8000000000000001e125 or 1.05000000000000001e83 < t Initial program 76.6%
associate-*l*76.6%
associate--l+76.6%
distribute-rgt-out--80.8%
associate-*l*80.8%
associate-*l*80.8%
Simplified80.8%
Taylor expanded in i around 0 86.4%
Taylor expanded in j around 0 77.5%
Taylor expanded in b around 0 73.7%
if -2.8000000000000001e125 < t < -3.60000000000000023e-4Initial program 93.7%
Simplified96.8%
Taylor expanded in y around inf 74.0%
if -3.60000000000000023e-4 < t < -3.1e-145 or 3.00000000000000021e-258 < t < 1.3e-158Initial program 87.9%
associate-*l*87.9%
associate--l+87.9%
distribute-rgt-out--87.9%
associate-*l*88.0%
associate-*l*88.0%
Simplified88.0%
Taylor expanded in t around 0 80.3%
Taylor expanded in i around inf 67.8%
*-commutative67.8%
associate-*r*67.8%
Simplified67.8%
if -3.1e-145 < t < 3.00000000000000021e-258 or 3.49999999999999975e49 < t < 1.05000000000000001e83Initial program 85.3%
associate-*l*83.5%
associate--l+83.5%
distribute-rgt-out--83.5%
associate-*l*87.0%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in t around 0 86.4%
Taylor expanded in i around 0 72.3%
if 1.3e-158 < t < 3.49999999999999975e49Initial program 87.5%
Simplified95.0%
Taylor expanded in i around inf 64.4%
associate-*r*64.4%
*-commutative64.4%
Simplified64.4%
Final simplification70.7%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 4.0 (* x i)))
(t_2 (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))
(t_3 (* j (* k 27.0))))
(if (<= t -7e+126)
(+ (* b c) t_2)
(if (<= t -1.25e+31)
(- (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) t_3)
(if (<= t -4.4e-8)
(- t_2 t_1)
(if (<= t 1.1e+88)
(- (* b c) (+ t_1 (* 27.0 (* k j))))
(- t_2 t_3)))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 4.0 * (x * i);
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_3 = j * (k * 27.0);
double tmp;
if (t <= -7e+126) {
tmp = (b * c) + t_2;
} else if (t <= -1.25e+31) {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_3;
} else if (t <= -4.4e-8) {
tmp = t_2 - t_1;
} else if (t <= 1.1e+88) {
tmp = (b * c) - (t_1 + (27.0 * (k * j)));
} else {
tmp = t_2 - t_3;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 4.0d0 * (x * i)
t_2 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
t_3 = j * (k * 27.0d0)
if (t <= (-7d+126)) then
tmp = (b * c) + t_2
else if (t <= (-1.25d+31)) then
tmp = (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))) - t_3
else if (t <= (-4.4d-8)) then
tmp = t_2 - t_1
else if (t <= 1.1d+88) then
tmp = (b * c) - (t_1 + (27.0d0 * (k * j)))
else
tmp = t_2 - t_3
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 4.0 * (x * i);
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_3 = j * (k * 27.0);
double tmp;
if (t <= -7e+126) {
tmp = (b * c) + t_2;
} else if (t <= -1.25e+31) {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_3;
} else if (t <= -4.4e-8) {
tmp = t_2 - t_1;
} else if (t <= 1.1e+88) {
tmp = (b * c) - (t_1 + (27.0 * (k * j)));
} else {
tmp = t_2 - t_3;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 4.0 * (x * i) t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) t_3 = j * (k * 27.0) tmp = 0 if t <= -7e+126: tmp = (b * c) + t_2 elif t <= -1.25e+31: tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_3 elif t <= -4.4e-8: tmp = t_2 - t_1 elif t <= 1.1e+88: tmp = (b * c) - (t_1 + (27.0 * (k * j))) else: tmp = t_2 - t_3 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(4.0 * Float64(x * i)) t_2 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) t_3 = Float64(j * Float64(k * 27.0)) tmp = 0.0 if (t <= -7e+126) tmp = Float64(Float64(b * c) + t_2); elseif (t <= -1.25e+31) tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - t_3); elseif (t <= -4.4e-8) tmp = Float64(t_2 - t_1); elseif (t <= 1.1e+88) tmp = Float64(Float64(b * c) - Float64(t_1 + Float64(27.0 * Float64(k * j)))); else tmp = Float64(t_2 - t_3); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 4.0 * (x * i);
t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
t_3 = j * (k * 27.0);
tmp = 0.0;
if (t <= -7e+126)
tmp = (b * c) + t_2;
elseif (t <= -1.25e+31)
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_3;
elseif (t <= -4.4e-8)
tmp = t_2 - t_1;
elseif (t <= 1.1e+88)
tmp = (b * c) - (t_1 + (27.0 * (k * j)));
else
tmp = t_2 - t_3;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7e+126], N[(N[(b * c), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[t, -1.25e+31], N[(N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision], If[LessEqual[t, -4.4e-8], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[t, 1.1e+88], N[(N[(b * c), $MachinePrecision] - N[(t$95$1 + N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 - t$95$3), $MachinePrecision]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := 4 \cdot \left(x \cdot i\right)\\
t_2 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
t_3 := j \cdot \left(k \cdot 27\right)\\
\mathbf{if}\;t \leq -7 \cdot 10^{+126}:\\
\;\;\;\;b \cdot c + t_2\\
\mathbf{elif}\;t \leq -1.25 \cdot 10^{+31}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - t_3\\
\mathbf{elif}\;t \leq -4.4 \cdot 10^{-8}:\\
\;\;\;\;t_2 - t_1\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+88}:\\
\;\;\;\;b \cdot c - \left(t_1 + 27 \cdot \left(k \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 - t_3\\
\end{array}
\end{array}
if t < -7.0000000000000005e126Initial program 61.2%
associate-*l*61.2%
associate--l+61.2%
distribute-rgt-out--70.9%
associate-*l*71.0%
associate-*l*71.0%
Simplified71.0%
Taylor expanded in i around 0 83.9%
Taylor expanded in j around 0 80.9%
if -7.0000000000000005e126 < t < -1.25000000000000007e31Initial program 92.0%
associate-*l*92.2%
associate--l+92.2%
distribute-rgt-out--92.2%
associate-*l*92.2%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in x around inf 86.2%
if -1.25000000000000007e31 < t < -4.3999999999999997e-8Initial program 100.0%
associate-*l*100.0%
associate--l+100.0%
distribute-rgt-out--100.0%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in b around 0 98.7%
Taylor expanded in j around 0 98.7%
if -4.3999999999999997e-8 < t < 1.10000000000000004e88Initial program 86.9%
associate-*l*86.2%
associate--l+86.2%
distribute-rgt-out--86.2%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in t around 0 83.7%
if 1.10000000000000004e88 < t Initial program 87.7%
associate-*l*87.7%
associate--l+87.7%
distribute-rgt-out--87.7%
associate-*l*87.7%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in t around inf 88.1%
Final simplification84.8%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k 27.0)))
(t_2 (* x (* y z)))
(t_3 (* t (- (* 18.0 t_2) (* a 4.0))))
(t_4 (* 4.0 (* x i))))
(if (<= t -1.6e+148)
(+ (* b c) t_3)
(if (<= t -1.16e+31)
(- (+ (* b c) (* 18.0 (* t t_2))) t_1)
(if (<= t -0.000255)
(- t_3 t_4)
(if (<= t 1.9e+89)
(- (* b c) (+ t_4 (* 27.0 (* k j))))
(- t_3 t_1)))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double t_2 = x * (y * z);
double t_3 = t * ((18.0 * t_2) - (a * 4.0));
double t_4 = 4.0 * (x * i);
double tmp;
if (t <= -1.6e+148) {
tmp = (b * c) + t_3;
} else if (t <= -1.16e+31) {
tmp = ((b * c) + (18.0 * (t * t_2))) - t_1;
} else if (t <= -0.000255) {
tmp = t_3 - t_4;
} else if (t <= 1.9e+89) {
tmp = (b * c) - (t_4 + (27.0 * (k * j)));
} else {
tmp = t_3 - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = j * (k * 27.0d0)
t_2 = x * (y * z)
t_3 = t * ((18.0d0 * t_2) - (a * 4.0d0))
t_4 = 4.0d0 * (x * i)
if (t <= (-1.6d+148)) then
tmp = (b * c) + t_3
else if (t <= (-1.16d+31)) then
tmp = ((b * c) + (18.0d0 * (t * t_2))) - t_1
else if (t <= (-0.000255d0)) then
tmp = t_3 - t_4
else if (t <= 1.9d+89) then
tmp = (b * c) - (t_4 + (27.0d0 * (k * j)))
else
tmp = t_3 - t_1
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double t_2 = x * (y * z);
double t_3 = t * ((18.0 * t_2) - (a * 4.0));
double t_4 = 4.0 * (x * i);
double tmp;
if (t <= -1.6e+148) {
tmp = (b * c) + t_3;
} else if (t <= -1.16e+31) {
tmp = ((b * c) + (18.0 * (t * t_2))) - t_1;
} else if (t <= -0.000255) {
tmp = t_3 - t_4;
} else if (t <= 1.9e+89) {
tmp = (b * c) - (t_4 + (27.0 * (k * j)));
} else {
tmp = t_3 - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * 27.0) t_2 = x * (y * z) t_3 = t * ((18.0 * t_2) - (a * 4.0)) t_4 = 4.0 * (x * i) tmp = 0 if t <= -1.6e+148: tmp = (b * c) + t_3 elif t <= -1.16e+31: tmp = ((b * c) + (18.0 * (t * t_2))) - t_1 elif t <= -0.000255: tmp = t_3 - t_4 elif t <= 1.9e+89: tmp = (b * c) - (t_4 + (27.0 * (k * j))) else: tmp = t_3 - t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * 27.0)) t_2 = Float64(x * Float64(y * z)) t_3 = Float64(t * Float64(Float64(18.0 * t_2) - Float64(a * 4.0))) t_4 = Float64(4.0 * Float64(x * i)) tmp = 0.0 if (t <= -1.6e+148) tmp = Float64(Float64(b * c) + t_3); elseif (t <= -1.16e+31) tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(t * t_2))) - t_1); elseif (t <= -0.000255) tmp = Float64(t_3 - t_4); elseif (t <= 1.9e+89) tmp = Float64(Float64(b * c) - Float64(t_4 + Float64(27.0 * Float64(k * j)))); else tmp = Float64(t_3 - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * 27.0);
t_2 = x * (y * z);
t_3 = t * ((18.0 * t_2) - (a * 4.0));
t_4 = 4.0 * (x * i);
tmp = 0.0;
if (t <= -1.6e+148)
tmp = (b * c) + t_3;
elseif (t <= -1.16e+31)
tmp = ((b * c) + (18.0 * (t * t_2))) - t_1;
elseif (t <= -0.000255)
tmp = t_3 - t_4;
elseif (t <= 1.9e+89)
tmp = (b * c) - (t_4 + (27.0 * (k * j)));
else
tmp = t_3 - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(18.0 * t$95$2), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e+148], N[(N[(b * c), $MachinePrecision] + t$95$3), $MachinePrecision], If[LessEqual[t, -1.16e+31], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, -0.000255], N[(t$95$3 - t$95$4), $MachinePrecision], If[LessEqual[t, 1.9e+89], N[(N[(b * c), $MachinePrecision] - N[(t$95$4 + N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 - t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot 27\right)\\
t_2 := x \cdot \left(y \cdot z\right)\\
t_3 := t \cdot \left(18 \cdot t_2 - a \cdot 4\right)\\
t_4 := 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+148}:\\
\;\;\;\;b \cdot c + t_3\\
\mathbf{elif}\;t \leq -1.16 \cdot 10^{+31}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(t \cdot t_2\right)\right) - t_1\\
\mathbf{elif}\;t \leq -0.000255:\\
\;\;\;\;t_3 - t_4\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+89}:\\
\;\;\;\;b \cdot c - \left(t_4 + 27 \cdot \left(k \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3 - t_1\\
\end{array}
\end{array}
if t < -1.6e148Initial program 59.2%
associate-*l*59.2%
associate--l+59.2%
distribute-rgt-out--70.3%
associate-*l*70.4%
associate-*l*70.4%
Simplified70.4%
Taylor expanded in i around 0 81.5%
Taylor expanded in j around 0 81.6%
if -1.6e148 < t < -1.1599999999999999e31Initial program 89.8%
associate-*l*89.9%
associate--l+89.9%
distribute-rgt-out--89.9%
associate-*l*89.9%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in i around 0 90.4%
Taylor expanded in a around 0 87.4%
if -1.1599999999999999e31 < t < -2.55e-4Initial program 100.0%
associate-*l*100.0%
associate--l+100.0%
distribute-rgt-out--100.0%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in b around 0 98.7%
Taylor expanded in j around 0 98.7%
if -2.55e-4 < t < 1.90000000000000012e89Initial program 86.9%
associate-*l*86.2%
associate--l+86.2%
distribute-rgt-out--86.2%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in t around 0 83.7%
if 1.90000000000000012e89 < t Initial program 87.7%
associate-*l*87.7%
associate--l+87.7%
distribute-rgt-out--87.7%
associate-*l*87.7%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in t around inf 88.1%
Final simplification85.1%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k 27.0))))
(if (or (<= t -0.00062) (not (<= t 1.38e+85)))
(- (+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))) t_1)
(- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) t_1))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double tmp;
if ((t <= -0.00062) || !(t <= 1.38e+85)) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
} else {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = j * (k * 27.0d0)
if ((t <= (-0.00062d0)) .or. (.not. (t <= 1.38d+85))) then
tmp = ((b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))) - t_1
else
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - t_1
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double tmp;
if ((t <= -0.00062) || !(t <= 1.38e+85)) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
} else {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * 27.0) tmp = 0 if (t <= -0.00062) or not (t <= 1.38e+85): tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1 else: tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * 27.0)) tmp = 0.0 if ((t <= -0.00062) || !(t <= 1.38e+85)) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))) - t_1); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * 27.0);
tmp = 0.0;
if ((t <= -0.00062) || ~((t <= 1.38e+85)))
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
else
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -0.00062], N[Not[LessEqual[t, 1.38e+85]], $MachinePrecision]], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot 27\right)\\
\mathbf{if}\;t \leq -0.00062 \lor \neg \left(t \leq 1.38 \cdot 10^{+85}\right):\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - t_1\\
\end{array}
\end{array}
if t < -6.2e-4 or 1.3799999999999999e85 < t Initial program 81.8%
associate-*l*81.8%
associate--l+81.8%
distribute-rgt-out--84.7%
associate-*l*84.7%
associate-*l*84.7%
Simplified84.7%
Taylor expanded in i around 0 87.2%
if -6.2e-4 < t < 1.3799999999999999e85Initial program 86.9%
associate-*l*86.3%
associate--l+86.3%
distribute-rgt-out--86.3%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
associate-*r*86.3%
distribute-rgt-out--86.3%
associate-*r*88.2%
*-commutative88.2%
associate-*r*86.3%
*-commutative86.3%
*-commutative86.3%
associate-*l*86.3%
Applied egg-rr86.3%
Taylor expanded in z around 0 89.6%
distribute-lft-out89.6%
*-commutative89.6%
*-commutative89.6%
Simplified89.6%
Final simplification88.6%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (or (<= t -9.2e+86)
(and (not (<= t -2.9e+29)) (or (<= t -9e-5) (not (<= t 5.8e+87)))))
(+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))
(- (* b c) (+ (* 4.0 (* x i)) (* 27.0 (* k j))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -9.2e+86) || (!(t <= -2.9e+29) && ((t <= -9e-5) || !(t <= 5.8e+87)))) {
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
} else {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((t <= (-9.2d+86)) .or. (.not. (t <= (-2.9d+29))) .and. (t <= (-9d-5)) .or. (.not. (t <= 5.8d+87))) then
tmp = (b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))
else
tmp = (b * c) - ((4.0d0 * (x * i)) + (27.0d0 * (k * j)))
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -9.2e+86) || (!(t <= -2.9e+29) && ((t <= -9e-5) || !(t <= 5.8e+87)))) {
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
} else {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (t <= -9.2e+86) or (not (t <= -2.9e+29) and ((t <= -9e-5) or not (t <= 5.8e+87))): tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0))) else: tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j))) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -9.2e+86) || (!(t <= -2.9e+29) && ((t <= -9e-5) || !(t <= 5.8e+87)))) tmp = Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))); else tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(k * j)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((t <= -9.2e+86) || (~((t <= -2.9e+29)) && ((t <= -9e-5) || ~((t <= 5.8e+87)))))
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
else
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[t, -9.2e+86], And[N[Not[LessEqual[t, -2.9e+29]], $MachinePrecision], Or[LessEqual[t, -9e-5], N[Not[LessEqual[t, 5.8e+87]], $MachinePrecision]]]], N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{+86} \lor \neg \left(t \leq -2.9 \cdot 10^{+29}\right) \land \left(t \leq -9 \cdot 10^{-5} \lor \neg \left(t \leq 5.8 \cdot 10^{+87}\right)\right):\\
\;\;\;\;b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(k \cdot j\right)\right)\\
\end{array}
\end{array}
if t < -9.19999999999999958e86 or -2.8999999999999999e29 < t < -9.00000000000000057e-5 or 5.7999999999999996e87 < t Initial program 79.5%
associate-*l*79.5%
associate--l+79.5%
distribute-rgt-out--82.9%
associate-*l*82.9%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in i around 0 89.1%
Taylor expanded in j around 0 80.6%
if -9.19999999999999958e86 < t < -2.8999999999999999e29 or -9.00000000000000057e-5 < t < 5.7999999999999996e87Initial program 87.6%
associate-*l*87.1%
associate--l+87.1%
distribute-rgt-out--87.1%
associate-*l*88.8%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in t around 0 82.2%
Final simplification81.7%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (* y z)))
(t_2 (* t (- (* 18.0 t_1) (* a 4.0))))
(t_3 (* 4.0 (* x i)))
(t_4 (+ (* b c) t_2)))
(if (<= t -2.65e+125)
t_4
(if (<= t -1.5e+31)
(+ (* 18.0 (* t t_1)) (* (* k -27.0) j))
(if (<= t -1.12e-5)
(- t_2 t_3)
(if (<= t 1.38e+85) (- (* b c) (+ t_3 (* 27.0 (* k j)))) t_4))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * (y * z);
double t_2 = t * ((18.0 * t_1) - (a * 4.0));
double t_3 = 4.0 * (x * i);
double t_4 = (b * c) + t_2;
double tmp;
if (t <= -2.65e+125) {
tmp = t_4;
} else if (t <= -1.5e+31) {
tmp = (18.0 * (t * t_1)) + ((k * -27.0) * j);
} else if (t <= -1.12e-5) {
tmp = t_2 - t_3;
} else if (t <= 1.38e+85) {
tmp = (b * c) - (t_3 + (27.0 * (k * j)));
} else {
tmp = t_4;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = x * (y * z)
t_2 = t * ((18.0d0 * t_1) - (a * 4.0d0))
t_3 = 4.0d0 * (x * i)
t_4 = (b * c) + t_2
if (t <= (-2.65d+125)) then
tmp = t_4
else if (t <= (-1.5d+31)) then
tmp = (18.0d0 * (t * t_1)) + ((k * (-27.0d0)) * j)
else if (t <= (-1.12d-5)) then
tmp = t_2 - t_3
else if (t <= 1.38d+85) then
tmp = (b * c) - (t_3 + (27.0d0 * (k * j)))
else
tmp = t_4
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * (y * z);
double t_2 = t * ((18.0 * t_1) - (a * 4.0));
double t_3 = 4.0 * (x * i);
double t_4 = (b * c) + t_2;
double tmp;
if (t <= -2.65e+125) {
tmp = t_4;
} else if (t <= -1.5e+31) {
tmp = (18.0 * (t * t_1)) + ((k * -27.0) * j);
} else if (t <= -1.12e-5) {
tmp = t_2 - t_3;
} else if (t <= 1.38e+85) {
tmp = (b * c) - (t_3 + (27.0 * (k * j)));
} else {
tmp = t_4;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * (y * z) t_2 = t * ((18.0 * t_1) - (a * 4.0)) t_3 = 4.0 * (x * i) t_4 = (b * c) + t_2 tmp = 0 if t <= -2.65e+125: tmp = t_4 elif t <= -1.5e+31: tmp = (18.0 * (t * t_1)) + ((k * -27.0) * j) elif t <= -1.12e-5: tmp = t_2 - t_3 elif t <= 1.38e+85: tmp = (b * c) - (t_3 + (27.0 * (k * j))) else: tmp = t_4 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(y * z)) t_2 = Float64(t * Float64(Float64(18.0 * t_1) - Float64(a * 4.0))) t_3 = Float64(4.0 * Float64(x * i)) t_4 = Float64(Float64(b * c) + t_2) tmp = 0.0 if (t <= -2.65e+125) tmp = t_4; elseif (t <= -1.5e+31) tmp = Float64(Float64(18.0 * Float64(t * t_1)) + Float64(Float64(k * -27.0) * j)); elseif (t <= -1.12e-5) tmp = Float64(t_2 - t_3); elseif (t <= 1.38e+85) tmp = Float64(Float64(b * c) - Float64(t_3 + Float64(27.0 * Float64(k * j)))); else tmp = t_4; end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * (y * z);
t_2 = t * ((18.0 * t_1) - (a * 4.0));
t_3 = 4.0 * (x * i);
t_4 = (b * c) + t_2;
tmp = 0.0;
if (t <= -2.65e+125)
tmp = t_4;
elseif (t <= -1.5e+31)
tmp = (18.0 * (t * t_1)) + ((k * -27.0) * j);
elseif (t <= -1.12e-5)
tmp = t_2 - t_3;
elseif (t <= 1.38e+85)
tmp = (b * c) - (t_3 + (27.0 * (k * j)));
else
tmp = t_4;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(18.0 * t$95$1), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(b * c), $MachinePrecision] + t$95$2), $MachinePrecision]}, If[LessEqual[t, -2.65e+125], t$95$4, If[LessEqual[t, -1.5e+31], N[(N[(18.0 * N[(t * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.12e-5], N[(t$95$2 - t$95$3), $MachinePrecision], If[LessEqual[t, 1.38e+85], N[(N[(b * c), $MachinePrecision] - N[(t$95$3 + N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
t_2 := t \cdot \left(18 \cdot t_1 - a \cdot 4\right)\\
t_3 := 4 \cdot \left(x \cdot i\right)\\
t_4 := b \cdot c + t_2\\
\mathbf{if}\;t \leq -2.65 \cdot 10^{+125}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{+31}:\\
\;\;\;\;18 \cdot \left(t \cdot t_1\right) + \left(k \cdot -27\right) \cdot j\\
\mathbf{elif}\;t \leq -1.12 \cdot 10^{-5}:\\
\;\;\;\;t_2 - t_3\\
\mathbf{elif}\;t \leq 1.38 \cdot 10^{+85}:\\
\;\;\;\;b \cdot c - \left(t_3 + 27 \cdot \left(k \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
if t < -2.6500000000000001e125 or 1.3799999999999999e85 < t Initial program 76.3%
associate-*l*76.3%
associate--l+76.3%
distribute-rgt-out--80.5%
associate-*l*80.5%
associate-*l*80.5%
Simplified80.5%
Taylor expanded in i around 0 87.6%
Taylor expanded in j around 0 78.5%
if -2.6500000000000001e125 < t < -1.49999999999999995e31Initial program 92.0%
Simplified96.0%
Taylor expanded in y around inf 77.5%
if -1.49999999999999995e31 < t < -1.11999999999999995e-5Initial program 100.0%
associate-*l*100.0%
associate--l+100.0%
distribute-rgt-out--100.0%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in b around 0 98.7%
Taylor expanded in j around 0 98.7%
if -1.11999999999999995e-5 < t < 1.3799999999999999e85Initial program 86.9%
associate-*l*86.2%
associate--l+86.2%
distribute-rgt-out--86.2%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in t around 0 83.7%
Final simplification82.1%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))
(t_2 (* j (* k 27.0))))
(if (<= t -1.65e+127)
(+ (* b c) t_1)
(if (<= t -0.0052)
(- (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) t_2)
(if (<= t 4e+94)
(- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) t_2)
(- t_1 t_2))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_2 = j * (k * 27.0);
double tmp;
if (t <= -1.65e+127) {
tmp = (b * c) + t_1;
} else if (t <= -0.0052) {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_2;
} else if (t <= 4e+94) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_2;
} else {
tmp = t_1 - t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
t_2 = j * (k * 27.0d0)
if (t <= (-1.65d+127)) then
tmp = (b * c) + t_1
else if (t <= (-0.0052d0)) then
tmp = (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))) - t_2
else if (t <= 4d+94) then
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - t_2
else
tmp = t_1 - t_2
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_2 = j * (k * 27.0);
double tmp;
if (t <= -1.65e+127) {
tmp = (b * c) + t_1;
} else if (t <= -0.0052) {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_2;
} else if (t <= 4e+94) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_2;
} else {
tmp = t_1 - t_2;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) t_2 = j * (k * 27.0) tmp = 0 if t <= -1.65e+127: tmp = (b * c) + t_1 elif t <= -0.0052: tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_2 elif t <= 4e+94: tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_2 else: tmp = t_1 - t_2 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) t_2 = Float64(j * Float64(k * 27.0)) tmp = 0.0 if (t <= -1.65e+127) tmp = Float64(Float64(b * c) + t_1); elseif (t <= -0.0052) tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - t_2); elseif (t <= 4e+94) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - t_2); else tmp = Float64(t_1 - t_2); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
t_2 = j * (k * 27.0);
tmp = 0.0;
if (t <= -1.65e+127)
tmp = (b * c) + t_1;
elseif (t <= -0.0052)
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_2;
elseif (t <= 4e+94)
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_2;
else
tmp = t_1 - t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.65e+127], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, -0.0052], N[(N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[t, 4e+94], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], N[(t$95$1 - t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
t_2 := j \cdot \left(k \cdot 27\right)\\
\mathbf{if}\;t \leq -1.65 \cdot 10^{+127}:\\
\;\;\;\;b \cdot c + t_1\\
\mathbf{elif}\;t \leq -0.0052:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - t_2\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+94}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 - t_2\\
\end{array}
\end{array}
if t < -1.64999999999999988e127Initial program 61.2%
associate-*l*61.2%
associate--l+61.2%
distribute-rgt-out--70.9%
associate-*l*71.0%
associate-*l*71.0%
Simplified71.0%
Taylor expanded in i around 0 83.9%
Taylor expanded in j around 0 80.9%
if -1.64999999999999988e127 < t < -0.0051999999999999998Initial program 93.7%
associate-*l*93.8%
associate--l+93.8%
distribute-rgt-out--93.8%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in x around inf 85.1%
if -0.0051999999999999998 < t < 4.0000000000000001e94Initial program 86.9%
associate-*l*86.3%
associate--l+86.3%
distribute-rgt-out--86.3%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
associate-*r*86.3%
distribute-rgt-out--86.3%
associate-*r*88.2%
*-commutative88.2%
associate-*r*86.3%
*-commutative86.3%
*-commutative86.3%
associate-*l*86.3%
Applied egg-rr86.3%
Taylor expanded in z around 0 89.6%
distribute-lft-out89.6%
*-commutative89.6%
*-commutative89.6%
Simplified89.6%
if 4.0000000000000001e94 < t Initial program 87.7%
associate-*l*87.7%
associate--l+87.7%
distribute-rgt-out--87.7%
associate-*l*87.7%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in t around inf 88.1%
Final simplification87.7%
NOTE: y and z should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= t -1.1e-8) (not (<= t 1.1e+85))) (- (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) (* j (* k 27.0))) (- (* b c) (+ (* 4.0 (* x i)) (* 27.0 (* k j))))))
assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -1.1e-8) || !(t <= 1.1e+85)) {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - (j * (k * 27.0));
} else {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((t <= (-1.1d-8)) .or. (.not. (t <= 1.1d+85))) then
tmp = (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))) - (j * (k * 27.0d0))
else
tmp = (b * c) - ((4.0d0 * (x * i)) + (27.0d0 * (k * j)))
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -1.1e-8) || !(t <= 1.1e+85)) {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - (j * (k * 27.0));
} else {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (t <= -1.1e-8) or not (t <= 1.1e+85): tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - (j * (k * 27.0)) else: tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j))) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -1.1e-8) || !(t <= 1.1e+85)) tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) - Float64(j * Float64(k * 27.0))); else tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(k * j)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((t <= -1.1e-8) || ~((t <= 1.1e+85)))
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - (j * (k * 27.0));
else
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[t, -1.1e-8], N[Not[LessEqual[t, 1.1e+85]], $MachinePrecision]], N[(N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{-8} \lor \neg \left(t \leq 1.1 \cdot 10^{+85}\right):\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(k \cdot j\right)\right)\\
\end{array}
\end{array}
if t < -1.0999999999999999e-8 or 1.1000000000000001e85 < t Initial program 81.9%
associate-*l*82.0%
associate--l+82.0%
distribute-rgt-out--84.8%
associate-*l*84.8%
associate-*l*84.8%
Simplified84.8%
Taylor expanded in t around inf 80.8%
if -1.0999999999999999e-8 < t < 1.1000000000000001e85Initial program 86.9%
associate-*l*86.2%
associate--l+86.2%
distribute-rgt-out--86.2%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in t around 0 83.7%
Final simplification82.5%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (* y z))) (t_2 (* t (- (* 18.0 t_1) (* a 4.0)))))
(if (<= t -2.4e+126)
t_2
(if (<= t -0.0026)
(+ (* 18.0 (* t t_1)) (* (* k -27.0) j))
(if (<= t 3e+91)
(- (* b c) (+ (* 4.0 (* x i)) (* 27.0 (* k j))))
t_2)))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * (y * z);
double t_2 = t * ((18.0 * t_1) - (a * 4.0));
double tmp;
if (t <= -2.4e+126) {
tmp = t_2;
} else if (t <= -0.0026) {
tmp = (18.0 * (t * t_1)) + ((k * -27.0) * j);
} else if (t <= 3e+91) {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (y * z)
t_2 = t * ((18.0d0 * t_1) - (a * 4.0d0))
if (t <= (-2.4d+126)) then
tmp = t_2
else if (t <= (-0.0026d0)) then
tmp = (18.0d0 * (t * t_1)) + ((k * (-27.0d0)) * j)
else if (t <= 3d+91) then
tmp = (b * c) - ((4.0d0 * (x * i)) + (27.0d0 * (k * j)))
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * (y * z);
double t_2 = t * ((18.0 * t_1) - (a * 4.0));
double tmp;
if (t <= -2.4e+126) {
tmp = t_2;
} else if (t <= -0.0026) {
tmp = (18.0 * (t * t_1)) + ((k * -27.0) * j);
} else if (t <= 3e+91) {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * (y * z) t_2 = t * ((18.0 * t_1) - (a * 4.0)) tmp = 0 if t <= -2.4e+126: tmp = t_2 elif t <= -0.0026: tmp = (18.0 * (t * t_1)) + ((k * -27.0) * j) elif t <= 3e+91: tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j))) else: tmp = t_2 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(y * z)) t_2 = Float64(t * Float64(Float64(18.0 * t_1) - Float64(a * 4.0))) tmp = 0.0 if (t <= -2.4e+126) tmp = t_2; elseif (t <= -0.0026) tmp = Float64(Float64(18.0 * Float64(t * t_1)) + Float64(Float64(k * -27.0) * j)); elseif (t <= 3e+91) tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(k * j)))); else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * (y * z);
t_2 = t * ((18.0 * t_1) - (a * 4.0));
tmp = 0.0;
if (t <= -2.4e+126)
tmp = t_2;
elseif (t <= -0.0026)
tmp = (18.0 * (t * t_1)) + ((k * -27.0) * j);
elseif (t <= 3e+91)
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(18.0 * t$95$1), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.4e+126], t$95$2, If[LessEqual[t, -0.0026], N[(N[(18.0 * N[(t * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+91], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
t_2 := t \cdot \left(18 \cdot t_1 - a \cdot 4\right)\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{+126}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -0.0026:\\
\;\;\;\;18 \cdot \left(t \cdot t_1\right) + \left(k \cdot -27\right) \cdot j\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+91}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(k \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.40000000000000012e126 or 3.00000000000000006e91 < t Initial program 76.3%
associate-*l*76.3%
associate--l+76.3%
distribute-rgt-out--80.5%
associate-*l*80.5%
associate-*l*80.5%
Simplified80.5%
Taylor expanded in i around 0 87.6%
Taylor expanded in j around 0 78.5%
Taylor expanded in b around 0 74.6%
if -2.40000000000000012e126 < t < -0.0025999999999999999Initial program 93.7%
Simplified96.8%
Taylor expanded in y around inf 74.0%
if -0.0025999999999999999 < t < 3.00000000000000006e91Initial program 86.9%
associate-*l*86.3%
associate--l+86.3%
distribute-rgt-out--86.3%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in t around 0 83.2%
Final simplification79.6%
NOTE: y and z should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= (* b c) -3.2e-14) (not (<= (* b c) 3.2e+21))) (- (* b c) (* 27.0 (* k j))) (+ (* (* k -27.0) j) (* -4.0 (* t a)))))
assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (((b * c) <= -3.2e-14) || !((b * c) <= 3.2e+21)) {
tmp = (b * c) - (27.0 * (k * j));
} else {
tmp = ((k * -27.0) * j) + (-4.0 * (t * a));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (((b * c) <= (-3.2d-14)) .or. (.not. ((b * c) <= 3.2d+21))) then
tmp = (b * c) - (27.0d0 * (k * j))
else
tmp = ((k * (-27.0d0)) * j) + ((-4.0d0) * (t * a))
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (((b * c) <= -3.2e-14) || !((b * c) <= 3.2e+21)) {
tmp = (b * c) - (27.0 * (k * j));
} else {
tmp = ((k * -27.0) * j) + (-4.0 * (t * a));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if ((b * c) <= -3.2e-14) or not ((b * c) <= 3.2e+21): tmp = (b * c) - (27.0 * (k * j)) else: tmp = ((k * -27.0) * j) + (-4.0 * (t * a)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((Float64(b * c) <= -3.2e-14) || !(Float64(b * c) <= 3.2e+21)) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(k * j))); else tmp = Float64(Float64(Float64(k * -27.0) * j) + Float64(-4.0 * Float64(t * a))); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (((b * c) <= -3.2e-14) || ~(((b * c) <= 3.2e+21)))
tmp = (b * c) - (27.0 * (k * j));
else
tmp = ((k * -27.0) * j) + (-4.0 * (t * a));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[N[(b * c), $MachinePrecision], -3.2e-14], N[Not[LessEqual[N[(b * c), $MachinePrecision], 3.2e+21]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -3.2 \cdot 10^{-14} \lor \neg \left(b \cdot c \leq 3.2 \cdot 10^{+21}\right):\\
\;\;\;\;b \cdot c - 27 \cdot \left(k \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot -27\right) \cdot j + -4 \cdot \left(t \cdot a\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -3.2000000000000002e-14 or 3.2e21 < (*.f64 b c) Initial program 82.7%
associate-*l*82.0%
associate--l+82.0%
distribute-rgt-out--82.7%
associate-*l*84.9%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in t around 0 76.1%
Taylor expanded in i around 0 66.5%
if -3.2000000000000002e-14 < (*.f64 b c) < 3.2e21Initial program 87.1%
Simplified90.4%
Taylor expanded in a around inf 53.5%
*-commutative53.5%
Simplified53.5%
Final simplification60.2%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* (* x 4.0) i))))
(if (<= x -5.5e+93)
t_1
(if (<= x -3.6e+23)
(+ (* b c) (* (* k -27.0) j))
(if (or (<= x -1.4e-16) (not (<= x 1.85e+28)))
t_1
(- (* b c) (* 27.0 (* k j))))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((x * 4.0) * i);
double tmp;
if (x <= -5.5e+93) {
tmp = t_1;
} else if (x <= -3.6e+23) {
tmp = (b * c) + ((k * -27.0) * j);
} else if ((x <= -1.4e-16) || !(x <= 1.85e+28)) {
tmp = t_1;
} else {
tmp = (b * c) - (27.0 * (k * j));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (b * c) - ((x * 4.0d0) * i)
if (x <= (-5.5d+93)) then
tmp = t_1
else if (x <= (-3.6d+23)) then
tmp = (b * c) + ((k * (-27.0d0)) * j)
else if ((x <= (-1.4d-16)) .or. (.not. (x <= 1.85d+28))) then
tmp = t_1
else
tmp = (b * c) - (27.0d0 * (k * j))
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((x * 4.0) * i);
double tmp;
if (x <= -5.5e+93) {
tmp = t_1;
} else if (x <= -3.6e+23) {
tmp = (b * c) + ((k * -27.0) * j);
} else if ((x <= -1.4e-16) || !(x <= 1.85e+28)) {
tmp = t_1;
} else {
tmp = (b * c) - (27.0 * (k * j));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - ((x * 4.0) * i) tmp = 0 if x <= -5.5e+93: tmp = t_1 elif x <= -3.6e+23: tmp = (b * c) + ((k * -27.0) * j) elif (x <= -1.4e-16) or not (x <= 1.85e+28): tmp = t_1 else: tmp = (b * c) - (27.0 * (k * j)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(Float64(x * 4.0) * i)) tmp = 0.0 if (x <= -5.5e+93) tmp = t_1; elseif (x <= -3.6e+23) tmp = Float64(Float64(b * c) + Float64(Float64(k * -27.0) * j)); elseif ((x <= -1.4e-16) || !(x <= 1.85e+28)) tmp = t_1; else tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(k * j))); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - ((x * 4.0) * i);
tmp = 0.0;
if (x <= -5.5e+93)
tmp = t_1;
elseif (x <= -3.6e+23)
tmp = (b * c) + ((k * -27.0) * j);
elseif ((x <= -1.4e-16) || ~((x <= 1.85e+28)))
tmp = t_1;
else
tmp = (b * c) - (27.0 * (k * j));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e+93], t$95$1, If[LessEqual[x, -3.6e+23], N[(N[(b * c), $MachinePrecision] + N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.4e-16], N[Not[LessEqual[x, 1.85e+28]], $MachinePrecision]], t$95$1, N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := b \cdot c - \left(x \cdot 4\right) \cdot i\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{+93}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{+23}:\\
\;\;\;\;b \cdot c + \left(k \cdot -27\right) \cdot j\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-16} \lor \neg \left(x \leq 1.85 \cdot 10^{+28}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(k \cdot j\right)\\
\end{array}
\end{array}
if x < -5.5000000000000003e93 or -3.5999999999999998e23 < x < -1.4000000000000001e-16 or 1.85e28 < x Initial program 72.1%
associate-*l*72.2%
associate--l+72.2%
distribute-rgt-out--74.1%
associate-*l*77.9%
associate-*l*77.9%
Simplified77.9%
Taylor expanded in t around 0 58.0%
Taylor expanded in i around inf 54.3%
*-commutative54.3%
associate-*r*54.3%
Simplified54.3%
if -5.5000000000000003e93 < x < -3.5999999999999998e23Initial program 80.1%
Simplified89.7%
Taylor expanded in b around inf 74.6%
if -1.4000000000000001e-16 < x < 1.85e28Initial program 95.4%
associate-*l*94.7%
associate--l+94.7%
distribute-rgt-out--95.5%
associate-*l*93.3%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in t around 0 69.9%
Taylor expanded in i around 0 62.7%
Final simplification60.2%
NOTE: y and z should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= x -35000.0) (not (<= x 2.7e+17))) (* t (* 18.0 (* x (* y z)))) (* -27.0 (* k j))))
assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -35000.0) || !(x <= 2.7e+17)) {
tmp = t * (18.0 * (x * (y * z)));
} else {
tmp = -27.0 * (k * j);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-35000.0d0)) .or. (.not. (x <= 2.7d+17))) then
tmp = t * (18.0d0 * (x * (y * z)))
else
tmp = (-27.0d0) * (k * j)
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -35000.0) || !(x <= 2.7e+17)) {
tmp = t * (18.0 * (x * (y * z)));
} else {
tmp = -27.0 * (k * j);
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -35000.0) or not (x <= 2.7e+17): tmp = t * (18.0 * (x * (y * z))) else: tmp = -27.0 * (k * j) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -35000.0) || !(x <= 2.7e+17)) tmp = Float64(t * Float64(18.0 * Float64(x * Float64(y * z)))); else tmp = Float64(-27.0 * Float64(k * j)); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -35000.0) || ~((x <= 2.7e+17)))
tmp = t * (18.0 * (x * (y * z)));
else
tmp = -27.0 * (k * j);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -35000.0], N[Not[LessEqual[x, 2.7e+17]], $MachinePrecision]], N[(t * N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -35000 \lor \neg \left(x \leq 2.7 \cdot 10^{+17}\right):\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\end{array}
\end{array}
if x < -35000 or 2.7e17 < x Initial program 72.6%
associate-*l*72.6%
associate--l+72.6%
distribute-rgt-out--74.2%
associate-*l*79.0%
associate-*l*79.0%
Simplified79.0%
Taylor expanded in i around 0 67.4%
Taylor expanded in j around 0 58.7%
Taylor expanded in b around 0 46.7%
Taylor expanded in x around inf 38.5%
if -35000 < x < 2.7e17Initial program 96.1%
Simplified95.5%
Taylor expanded in j around inf 36.5%
Final simplification37.5%
NOTE: y and z should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= x -35000000000.0) (not (<= x 3.2e+16))) (* t (* y (* (* x 18.0) z))) (* -27.0 (* k j))))
assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -35000000000.0) || !(x <= 3.2e+16)) {
tmp = t * (y * ((x * 18.0) * z));
} else {
tmp = -27.0 * (k * j);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-35000000000.0d0)) .or. (.not. (x <= 3.2d+16))) then
tmp = t * (y * ((x * 18.0d0) * z))
else
tmp = (-27.0d0) * (k * j)
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -35000000000.0) || !(x <= 3.2e+16)) {
tmp = t * (y * ((x * 18.0) * z));
} else {
tmp = -27.0 * (k * j);
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -35000000000.0) or not (x <= 3.2e+16): tmp = t * (y * ((x * 18.0) * z)) else: tmp = -27.0 * (k * j) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -35000000000.0) || !(x <= 3.2e+16)) tmp = Float64(t * Float64(y * Float64(Float64(x * 18.0) * z))); else tmp = Float64(-27.0 * Float64(k * j)); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -35000000000.0) || ~((x <= 3.2e+16)))
tmp = t * (y * ((x * 18.0) * z));
else
tmp = -27.0 * (k * j);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -35000000000.0], N[Not[LessEqual[x, 3.2e+16]], $MachinePrecision]], N[(t * N[(y * N[(N[(x * 18.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -35000000000 \lor \neg \left(x \leq 3.2 \cdot 10^{+16}\right):\\
\;\;\;\;t \cdot \left(y \cdot \left(\left(x \cdot 18\right) \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\end{array}
\end{array}
if x < -3.5e10 or 3.2e16 < x Initial program 72.6%
associate-*l*72.6%
associate--l+72.6%
distribute-rgt-out--74.2%
associate-*l*79.0%
associate-*l*79.0%
Simplified79.0%
Taylor expanded in i around 0 67.4%
Taylor expanded in j around 0 58.7%
Taylor expanded in b around 0 46.7%
Taylor expanded in x around inf 38.5%
associate-*r*38.5%
*-commutative38.5%
associate-*l*40.8%
Simplified40.8%
if -3.5e10 < x < 3.2e16Initial program 96.1%
Simplified95.5%
Taylor expanded in j around inf 36.5%
Final simplification38.6%
NOTE: y and z should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= x 7.8e+17) (+ (* b c) (* (* k -27.0) j)) (* t (* y (* (* x 18.0) z)))))
assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= 7.8e+17) {
tmp = (b * c) + ((k * -27.0) * j);
} else {
tmp = t * (y * ((x * 18.0) * z));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= 7.8d+17) then
tmp = (b * c) + ((k * (-27.0d0)) * j)
else
tmp = t * (y * ((x * 18.0d0) * z))
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= 7.8e+17) {
tmp = (b * c) + ((k * -27.0) * j);
} else {
tmp = t * (y * ((x * 18.0) * z));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= 7.8e+17: tmp = (b * c) + ((k * -27.0) * j) else: tmp = t * (y * ((x * 18.0) * z)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= 7.8e+17) tmp = Float64(Float64(b * c) + Float64(Float64(k * -27.0) * j)); else tmp = Float64(t * Float64(y * Float64(Float64(x * 18.0) * z))); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= 7.8e+17)
tmp = (b * c) + ((k * -27.0) * j);
else
tmp = t * (y * ((x * 18.0) * z));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, 7.8e+17], N[(N[(b * c), $MachinePrecision] + N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * N[(N[(x * 18.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 7.8 \cdot 10^{+17}:\\
\;\;\;\;b \cdot c + \left(k \cdot -27\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(\left(x \cdot 18\right) \cdot z\right)\right)\\
\end{array}
\end{array}
if x < 7.8e17Initial program 88.3%
Simplified91.3%
Taylor expanded in b around inf 56.8%
if 7.8e17 < x Initial program 73.5%
associate-*l*73.5%
associate--l+73.5%
distribute-rgt-out--75.2%
associate-*l*78.5%
associate-*l*78.5%
Simplified78.5%
Taylor expanded in i around 0 60.9%
Taylor expanded in j around 0 53.0%
Taylor expanded in b around 0 48.0%
Taylor expanded in x around inf 39.7%
associate-*r*39.7%
*-commutative39.7%
associate-*l*41.3%
Simplified41.3%
Final simplification53.2%
NOTE: y and z should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= x 7.8e+17) (- (* b c) (* 27.0 (* k j))) (* t (* y (* (* x 18.0) z)))))
assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= 7.8e+17) {
tmp = (b * c) - (27.0 * (k * j));
} else {
tmp = t * (y * ((x * 18.0) * z));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= 7.8d+17) then
tmp = (b * c) - (27.0d0 * (k * j))
else
tmp = t * (y * ((x * 18.0d0) * z))
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= 7.8e+17) {
tmp = (b * c) - (27.0 * (k * j));
} else {
tmp = t * (y * ((x * 18.0) * z));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= 7.8e+17: tmp = (b * c) - (27.0 * (k * j)) else: tmp = t * (y * ((x * 18.0) * z)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= 7.8e+17) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(k * j))); else tmp = Float64(t * Float64(y * Float64(Float64(x * 18.0) * z))); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= 7.8e+17)
tmp = (b * c) - (27.0 * (k * j));
else
tmp = t * (y * ((x * 18.0) * z));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, 7.8e+17], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * N[(N[(x * 18.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 7.8 \cdot 10^{+17}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(k \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(\left(x \cdot 18\right) \cdot z\right)\right)\\
\end{array}
\end{array}
if x < 7.8e17Initial program 88.3%
associate-*l*87.8%
associate--l+87.8%
distribute-rgt-out--88.8%
associate-*l*89.3%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in t around 0 69.3%
Taylor expanded in i around 0 57.3%
if 7.8e17 < x Initial program 73.5%
associate-*l*73.5%
associate--l+73.5%
distribute-rgt-out--75.2%
associate-*l*78.5%
associate-*l*78.5%
Simplified78.5%
Taylor expanded in i around 0 60.9%
Taylor expanded in j around 0 53.0%
Taylor expanded in b around 0 48.0%
Taylor expanded in x around inf 39.7%
associate-*r*39.7%
*-commutative39.7%
associate-*l*41.3%
Simplified41.3%
Final simplification53.6%
NOTE: y and z should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= t -7.5e+125) (not (<= t 9.6e+154))) (* t (* a -4.0)) (* -27.0 (* k j))))
assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -7.5e+125) || !(t <= 9.6e+154)) {
tmp = t * (a * -4.0);
} else {
tmp = -27.0 * (k * j);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((t <= (-7.5d+125)) .or. (.not. (t <= 9.6d+154))) then
tmp = t * (a * (-4.0d0))
else
tmp = (-27.0d0) * (k * j)
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -7.5e+125) || !(t <= 9.6e+154)) {
tmp = t * (a * -4.0);
} else {
tmp = -27.0 * (k * j);
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (t <= -7.5e+125) or not (t <= 9.6e+154): tmp = t * (a * -4.0) else: tmp = -27.0 * (k * j) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -7.5e+125) || !(t <= 9.6e+154)) tmp = Float64(t * Float64(a * -4.0)); else tmp = Float64(-27.0 * Float64(k * j)); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((t <= -7.5e+125) || ~((t <= 9.6e+154)))
tmp = t * (a * -4.0);
else
tmp = -27.0 * (k * j);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[t, -7.5e+125], N[Not[LessEqual[t, 9.6e+154]], $MachinePrecision]], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+125} \lor \neg \left(t \leq 9.6 \cdot 10^{+154}\right):\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\end{array}
\end{array}
if t < -7.5000000000000006e125 or 9.60000000000000059e154 < t Initial program 73.7%
associate-*l*73.7%
associate--l+73.7%
distribute-rgt-out--78.6%
associate-*l*78.6%
associate-*l*78.6%
Simplified78.6%
Taylor expanded in i around 0 88.5%
Taylor expanded in j around 0 82.5%
Taylor expanded in b around 0 77.8%
Taylor expanded in x around 0 44.4%
*-commutative44.4%
Simplified44.4%
if -7.5000000000000006e125 < t < 9.60000000000000059e154Initial program 88.3%
Simplified91.4%
Taylor expanded in j around inf 30.2%
Final simplification33.6%
NOTE: y and z should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (* -27.0 (* k j)))
assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return -27.0 * (k * j);
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (-27.0d0) * (k * j)
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return -27.0 * (k * j);
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): return -27.0 * (k * j)
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(-27.0 * Float64(k * j)) end
y, z = num2cell(sort([y, z])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = -27.0 * (k * j);
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
-27 \cdot \left(k \cdot j\right)
\end{array}
Initial program 84.8%
Simplified89.5%
Taylor expanded in j around inf 26.2%
Final simplification26.2%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
(t_2
(-
(- (* (* 18.0 t) (* (* x y) z)) t_1)
(- (* (* k j) 27.0) (* c b)))))
(if (< t -1.6210815397541398e-69)
t_2
(if (< t 165.68027943805222)
(+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((a * t) + (i * x)) * 4.0d0
t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
if (t < (-1.6210815397541398d-69)) then
tmp = t_2
else if (t < 165.68027943805222d0) then
tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((a * t) + (i * x)) * 4.0 t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)) tmp = 0 if t < -1.6210815397541398e-69: tmp = t_2 elif t < 165.68027943805222: tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0) t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b))) tmp = 0.0 if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = ((a * t) + (i * x)) * 4.0; t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)); tmp = 0.0; if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
\mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t < 165.68027943805222:\\
\;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2023318
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
:herbie-target
(if (< t -1.6210815397541398e-69) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b))) (if (< t 165.68027943805222) (+ (- (* (* 18.0 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4.0)) (- (* c b) (* 27.0 (* k j)))) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b)))))
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))