
(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 21 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 (* t (* a 4.0)))
(t_2
(-
(- (+ (- (* (* (* (* x 18.0) y) z) t) t_1) (* b c)) (* (* x 4.0) i))
(* (* j 27.0) k))))
(if (<= t_2 (- INFINITY))
(-
(+ (- (* 18.0 (* z (* x (* y t)))) t_1) (- (* b c) (* x (* 4.0 i))))
(* j (* 27.0 k)))
(if (<= t_2 INFINITY) t_2 (* t (- (* 18.0 (* x (* y z))) (* a 4.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 = t * (a * 4.0);
double t_2 = (((((((x * 18.0) * y) * z) * t) - t_1) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (((18.0 * (z * (x * (y * t)))) - t_1) + ((b * c) - (x * (4.0 * i)))) - (j * (27.0 * k));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.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 = t * (a * 4.0);
double t_2 = (((((((x * 18.0) * y) * z) * t) - t_1) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (((18.0 * (z * (x * (y * t)))) - t_1) + ((b * c) - (x * (4.0 * i)))) - (j * (27.0 * k));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * (a * 4.0) t_2 = (((((((x * 18.0) * y) * z) * t) - t_1) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k) tmp = 0 if t_2 <= -math.inf: tmp = (((18.0 * (z * (x * (y * t)))) - t_1) + ((b * c) - (x * (4.0 * i)))) - (j * (27.0 * k)) elif t_2 <= math.inf: tmp = t_2 else: tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(a * 4.0)) t_2 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - t_1) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(18.0 * Float64(z * Float64(x * Float64(y * t)))) - t_1) + Float64(Float64(b * c) - Float64(x * Float64(4.0 * i)))) - Float64(j * Float64(27.0 * k))); elseif (t_2 <= Inf) tmp = t_2; else tmp = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.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 = t * (a * 4.0);
t_2 = (((((((x * 18.0) * y) * z) * t) - t_1) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
tmp = 0.0;
if (t_2 <= -Inf)
tmp = (((18.0 * (z * (x * (y * t)))) - t_1) + ((b * c) - (x * (4.0 * i)))) - (j * (27.0 * k));
elseif (t_2 <= Inf)
tmp = t_2;
else
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.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[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[(N[(18.0 * N[(z * N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$2, N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot 4\right)\\
t_2 := \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t_1\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\left(\left(18 \cdot \left(z \cdot \left(x \cdot \left(y \cdot t\right)\right)\right) - t_1\right) + \left(b \cdot c - x \cdot \left(4 \cdot i\right)\right)\right) - j \cdot \left(27 \cdot k\right)\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\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 85.6%
associate-*l*85.6%
associate--l+85.6%
distribute-rgt-out--85.6%
associate-*l*87.7%
associate-*l*87.7%
Simplified87.7%
associate-*r*85.6%
distribute-rgt-out--85.6%
associate-*l*95.6%
associate-*l*95.7%
*-commutative95.7%
Applied egg-rr95.7%
Taylor expanded in x around 0 87.7%
*-commutative87.7%
associate-*l*93.9%
*-commutative93.9%
associate-*r*95.7%
associate-*r*95.7%
Simplified95.7%
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)) < +inf.0Initial program 97.1%
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%
Taylor expanded in j around 0 3.0%
Taylor expanded in t around inf 67.0%
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 (* j (* 27.0 k))) (t_2 (- (* b c) (* x (* 4.0 i)))))
(if (<= t -2.6e+99)
(- (+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))) (* 4.0 (* x i)))
(if (<= t 2e+56)
(- (+ (- (* 18.0 (* z (* x (* y t)))) (* t (* a 4.0))) t_2) t_1)
(- (+ t_2 (* 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 * (27.0 * k);
double t_2 = (b * c) - (x * (4.0 * i));
double tmp;
if (t <= -2.6e+99) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (4.0 * (x * i));
} else if (t <= 2e+56) {
tmp = (((18.0 * (z * (x * (y * t)))) - (t * (a * 4.0))) + t_2) - t_1;
} else {
tmp = (t_2 + (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) :: t_2
real(8) :: tmp
t_1 = j * (27.0d0 * k)
t_2 = (b * c) - (x * (4.0d0 * i))
if (t <= (-2.6d+99)) then
tmp = ((b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))) - (4.0d0 * (x * i))
else if (t <= 2d+56) then
tmp = (((18.0d0 * (z * (x * (y * t)))) - (t * (a * 4.0d0))) + t_2) - t_1
else
tmp = (t_2 + (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 * (27.0 * k);
double t_2 = (b * c) - (x * (4.0 * i));
double tmp;
if (t <= -2.6e+99) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (4.0 * (x * i));
} else if (t <= 2e+56) {
tmp = (((18.0 * (z * (x * (y * t)))) - (t * (a * 4.0))) + t_2) - t_1;
} else {
tmp = (t_2 + (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 * (27.0 * k) t_2 = (b * c) - (x * (4.0 * i)) tmp = 0 if t <= -2.6e+99: tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (4.0 * (x * i)) elif t <= 2e+56: tmp = (((18.0 * (z * (x * (y * t)))) - (t * (a * 4.0))) + t_2) - t_1 else: tmp = (t_2 + (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(27.0 * k)) t_2 = Float64(Float64(b * c) - Float64(x * Float64(4.0 * i))) tmp = 0.0 if (t <= -2.6e+99) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))) - Float64(4.0 * Float64(x * i))); elseif (t <= 2e+56) tmp = Float64(Float64(Float64(Float64(18.0 * Float64(z * Float64(x * Float64(y * t)))) - Float64(t * Float64(a * 4.0))) + t_2) - t_1); else tmp = Float64(Float64(t_2 + 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 * (27.0 * k);
t_2 = (b * c) - (x * (4.0 * i));
tmp = 0.0;
if (t <= -2.6e+99)
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (4.0 * (x * i));
elseif (t <= 2e+56)
tmp = (((18.0 * (z * (x * (y * t)))) - (t * (a * 4.0))) + t_2) - t_1;
else
tmp = (t_2 + (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[(27.0 * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.6e+99], 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] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+56], N[(N[(N[(N[(18.0 * N[(z * N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(t$95$2 + 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(27 \cdot k\right)\\
t_2 := b \cdot c - x \cdot \left(4 \cdot i\right)\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{+99}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\right) - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+56}:\\
\;\;\;\;\left(\left(18 \cdot \left(z \cdot \left(x \cdot \left(y \cdot t\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + t_2\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(t_2 + 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 t < -2.6e99Initial program 77.1%
Taylor expanded in j around 0 72.2%
Taylor expanded in t around 0 84.4%
if -2.6e99 < t < 2.00000000000000018e56Initial program 87.1%
associate-*l*87.1%
associate--l+87.1%
distribute-rgt-out--87.1%
associate-*l*82.9%
associate-*l*82.9%
Simplified82.9%
associate-*r*87.1%
distribute-rgt-out--87.1%
associate-*l*93.0%
associate-*l*92.5%
*-commutative92.5%
Applied egg-rr92.5%
Taylor expanded in x around 0 82.9%
*-commutative82.9%
associate-*l*85.2%
*-commutative85.2%
associate-*r*91.3%
associate-*r*94.8%
Simplified94.8%
if 2.00000000000000018e56 < t Initial program 71.7%
associate-*l*71.7%
associate--l+71.7%
distribute-rgt-out--81.9%
associate-*l*82.0%
associate-*l*82.0%
Simplified82.0%
Final simplification90.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
(let* ((t_1 (* j (* 27.0 k)))
(t_2 (* 4.0 (* x i)))
(t_3 (- (* b c) t_2))
(t_4 (- t_3 t_1))
(t_5 (- (* t (- (* (* y z) (* x (- -18.0))) (* a 4.0))) t_1)))
(if (<= t -3.2e+99)
(- (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) t_2)
(if (<= t 3.8e-91)
t_4
(if (<= t 0.00042)
t_5
(if (<= t 8.5e+28)
t_4
(if (<= t 1.04e+155)
(- (+ (* b c) (* (* t a) -4.0)) (* 27.0 (* j k)))
(if (<= t 1.55e+161) t_3 t_5))))))))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 * (27.0 * k);
double t_2 = 4.0 * (x * i);
double t_3 = (b * c) - t_2;
double t_4 = t_3 - t_1;
double t_5 = (t * (((y * z) * (x * -(-18.0))) - (a * 4.0))) - t_1;
double tmp;
if (t <= -3.2e+99) {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_2;
} else if (t <= 3.8e-91) {
tmp = t_4;
} else if (t <= 0.00042) {
tmp = t_5;
} else if (t <= 8.5e+28) {
tmp = t_4;
} else if (t <= 1.04e+155) {
tmp = ((b * c) + ((t * a) * -4.0)) - (27.0 * (j * k));
} else if (t <= 1.55e+161) {
tmp = t_3;
} else {
tmp = t_5;
}
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 = j * (27.0d0 * k)
t_2 = 4.0d0 * (x * i)
t_3 = (b * c) - t_2
t_4 = t_3 - t_1
t_5 = (t * (((y * z) * (x * -(-18.0d0))) - (a * 4.0d0))) - t_1
if (t <= (-3.2d+99)) then
tmp = (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))) - t_2
else if (t <= 3.8d-91) then
tmp = t_4
else if (t <= 0.00042d0) then
tmp = t_5
else if (t <= 8.5d+28) then
tmp = t_4
else if (t <= 1.04d+155) then
tmp = ((b * c) + ((t * a) * (-4.0d0))) - (27.0d0 * (j * k))
else if (t <= 1.55d+161) then
tmp = t_3
else
tmp = t_5
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 * (27.0 * k);
double t_2 = 4.0 * (x * i);
double t_3 = (b * c) - t_2;
double t_4 = t_3 - t_1;
double t_5 = (t * (((y * z) * (x * -(-18.0))) - (a * 4.0))) - t_1;
double tmp;
if (t <= -3.2e+99) {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_2;
} else if (t <= 3.8e-91) {
tmp = t_4;
} else if (t <= 0.00042) {
tmp = t_5;
} else if (t <= 8.5e+28) {
tmp = t_4;
} else if (t <= 1.04e+155) {
tmp = ((b * c) + ((t * a) * -4.0)) - (27.0 * (j * k));
} else if (t <= 1.55e+161) {
tmp = t_3;
} else {
tmp = t_5;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (27.0 * k) t_2 = 4.0 * (x * i) t_3 = (b * c) - t_2 t_4 = t_3 - t_1 t_5 = (t * (((y * z) * (x * -(-18.0))) - (a * 4.0))) - t_1 tmp = 0 if t <= -3.2e+99: tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_2 elif t <= 3.8e-91: tmp = t_4 elif t <= 0.00042: tmp = t_5 elif t <= 8.5e+28: tmp = t_4 elif t <= 1.04e+155: tmp = ((b * c) + ((t * a) * -4.0)) - (27.0 * (j * k)) elif t <= 1.55e+161: tmp = t_3 else: tmp = t_5 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(27.0 * k)) t_2 = Float64(4.0 * Float64(x * i)) t_3 = Float64(Float64(b * c) - t_2) t_4 = Float64(t_3 - t_1) t_5 = Float64(Float64(t * Float64(Float64(Float64(y * z) * Float64(x * Float64(-(-18.0)))) - Float64(a * 4.0))) - t_1) tmp = 0.0 if (t <= -3.2e+99) tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) - t_2); elseif (t <= 3.8e-91) tmp = t_4; elseif (t <= 0.00042) tmp = t_5; elseif (t <= 8.5e+28) tmp = t_4; elseif (t <= 1.04e+155) tmp = Float64(Float64(Float64(b * c) + Float64(Float64(t * a) * -4.0)) - Float64(27.0 * Float64(j * k))); elseif (t <= 1.55e+161) tmp = t_3; else tmp = t_5; 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 * (27.0 * k);
t_2 = 4.0 * (x * i);
t_3 = (b * c) - t_2;
t_4 = t_3 - t_1;
t_5 = (t * (((y * z) * (x * -(-18.0))) - (a * 4.0))) - t_1;
tmp = 0.0;
if (t <= -3.2e+99)
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_2;
elseif (t <= 3.8e-91)
tmp = t_4;
elseif (t <= 0.00042)
tmp = t_5;
elseif (t <= 8.5e+28)
tmp = t_4;
elseif (t <= 1.04e+155)
tmp = ((b * c) + ((t * a) * -4.0)) - (27.0 * (j * k));
elseif (t <= 1.55e+161)
tmp = t_3;
else
tmp = t_5;
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[(27.0 * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] - t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t * N[(N[(N[(y * z), $MachinePrecision] * N[(x * (--18.0)), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[t, -3.2e+99], N[(N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[t, 3.8e-91], t$95$4, If[LessEqual[t, 0.00042], t$95$5, If[LessEqual[t, 8.5e+28], t$95$4, If[LessEqual[t, 1.04e+155], N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e+161], t$95$3, t$95$5]]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(27 \cdot k\right)\\
t_2 := 4 \cdot \left(x \cdot i\right)\\
t_3 := b \cdot c - t_2\\
t_4 := t_3 - t_1\\
t_5 := t \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot \left(--18\right)\right) - a \cdot 4\right) - t_1\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+99}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - t_2\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-91}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 0.00042:\\
\;\;\;\;t_5\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+28}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 1.04 \cdot 10^{+155}:\\
\;\;\;\;\left(b \cdot c + \left(t \cdot a\right) \cdot -4\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+161}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_5\\
\end{array}
\end{array}
if t < -3.19999999999999999e99Initial program 76.7%
Taylor expanded in j around 0 73.4%
Taylor expanded in t around 0 85.9%
Taylor expanded in b around 0 79.2%
if -3.19999999999999999e99 < t < 3.79999999999999978e-91 or 4.2000000000000002e-4 < t < 8.49999999999999954e28Initial program 85.7%
associate-*l*85.8%
associate--l+85.8%
distribute-rgt-out--85.8%
associate-*l*81.5%
associate-*l*81.5%
Simplified81.5%
Taylor expanded in t around 0 77.4%
if 3.79999999999999978e-91 < t < 4.2000000000000002e-4 or 1.55000000000000003e161 < t Initial program 76.0%
associate-*l*76.1%
associate--l+76.1%
distribute-rgt-out--85.6%
associate-*l*83.5%
associate-*l*83.5%
Simplified83.5%
associate-*r*85.6%
distribute-rgt-out--76.1%
associate-*l*71.3%
associate-*l*71.3%
*-commutative71.3%
Applied egg-rr71.3%
Taylor expanded in t around -inf 80.8%
associate-*r*80.8%
neg-mul-180.8%
cancel-sign-sub-inv80.8%
associate-*r*80.9%
metadata-eval80.9%
Simplified80.9%
if 8.49999999999999954e28 < t < 1.03999999999999996e155Initial program 88.1%
associate-*l*88.1%
associate--l+88.1%
distribute-rgt-out--88.1%
associate-*l*82.7%
associate-*l*82.7%
Simplified82.7%
Taylor expanded in x around 0 76.7%
if 1.03999999999999996e155 < t < 1.55000000000000003e161Initial program 100.0%
associate-*l*100.0%
associate--l+100.0%
distribute-rgt-out--100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
Taylor expanded in j around 0 100.0%
Final simplification78.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
(let* ((t_1 (* j (* 27.0 k)))
(t_2 (* 4.0 (* x i)))
(t_3 (- (* b c) t_2))
(t_4 (- t_3 t_1))
(t_5 (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))
(t_6 (- t_5 t_1)))
(if (<= t -2.8e+99)
(- t_5 t_2)
(if (<= t 4.4e-91)
t_4
(if (<= t 0.00037)
t_6
(if (<= t 1.35e+29)
t_4
(if (<= t 1.04e+155)
(- (+ (* b c) (* (* t a) -4.0)) (* 27.0 (* j k)))
(if (<= t 1.55e+161) t_3 t_6))))))))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 * (27.0 * k);
double t_2 = 4.0 * (x * i);
double t_3 = (b * c) - t_2;
double t_4 = t_3 - t_1;
double t_5 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_6 = t_5 - t_1;
double tmp;
if (t <= -2.8e+99) {
tmp = t_5 - t_2;
} else if (t <= 4.4e-91) {
tmp = t_4;
} else if (t <= 0.00037) {
tmp = t_6;
} else if (t <= 1.35e+29) {
tmp = t_4;
} else if (t <= 1.04e+155) {
tmp = ((b * c) + ((t * a) * -4.0)) - (27.0 * (j * k));
} else if (t <= 1.55e+161) {
tmp = t_3;
} else {
tmp = t_6;
}
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) :: t_6
real(8) :: tmp
t_1 = j * (27.0d0 * k)
t_2 = 4.0d0 * (x * i)
t_3 = (b * c) - t_2
t_4 = t_3 - t_1
t_5 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
t_6 = t_5 - t_1
if (t <= (-2.8d+99)) then
tmp = t_5 - t_2
else if (t <= 4.4d-91) then
tmp = t_4
else if (t <= 0.00037d0) then
tmp = t_6
else if (t <= 1.35d+29) then
tmp = t_4
else if (t <= 1.04d+155) then
tmp = ((b * c) + ((t * a) * (-4.0d0))) - (27.0d0 * (j * k))
else if (t <= 1.55d+161) then
tmp = t_3
else
tmp = t_6
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 * (27.0 * k);
double t_2 = 4.0 * (x * i);
double t_3 = (b * c) - t_2;
double t_4 = t_3 - t_1;
double t_5 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_6 = t_5 - t_1;
double tmp;
if (t <= -2.8e+99) {
tmp = t_5 - t_2;
} else if (t <= 4.4e-91) {
tmp = t_4;
} else if (t <= 0.00037) {
tmp = t_6;
} else if (t <= 1.35e+29) {
tmp = t_4;
} else if (t <= 1.04e+155) {
tmp = ((b * c) + ((t * a) * -4.0)) - (27.0 * (j * k));
} else if (t <= 1.55e+161) {
tmp = t_3;
} else {
tmp = t_6;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (27.0 * k) t_2 = 4.0 * (x * i) t_3 = (b * c) - t_2 t_4 = t_3 - t_1 t_5 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) t_6 = t_5 - t_1 tmp = 0 if t <= -2.8e+99: tmp = t_5 - t_2 elif t <= 4.4e-91: tmp = t_4 elif t <= 0.00037: tmp = t_6 elif t <= 1.35e+29: tmp = t_4 elif t <= 1.04e+155: tmp = ((b * c) + ((t * a) * -4.0)) - (27.0 * (j * k)) elif t <= 1.55e+161: tmp = t_3 else: tmp = t_6 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(27.0 * k)) t_2 = Float64(4.0 * Float64(x * i)) t_3 = Float64(Float64(b * c) - t_2) t_4 = Float64(t_3 - t_1) t_5 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) t_6 = Float64(t_5 - t_1) tmp = 0.0 if (t <= -2.8e+99) tmp = Float64(t_5 - t_2); elseif (t <= 4.4e-91) tmp = t_4; elseif (t <= 0.00037) tmp = t_6; elseif (t <= 1.35e+29) tmp = t_4; elseif (t <= 1.04e+155) tmp = Float64(Float64(Float64(b * c) + Float64(Float64(t * a) * -4.0)) - Float64(27.0 * Float64(j * k))); elseif (t <= 1.55e+161) tmp = t_3; else tmp = t_6; 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 * (27.0 * k);
t_2 = 4.0 * (x * i);
t_3 = (b * c) - t_2;
t_4 = t_3 - t_1;
t_5 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
t_6 = t_5 - t_1;
tmp = 0.0;
if (t <= -2.8e+99)
tmp = t_5 - t_2;
elseif (t <= 4.4e-91)
tmp = t_4;
elseif (t <= 0.00037)
tmp = t_6;
elseif (t <= 1.35e+29)
tmp = t_4;
elseif (t <= 1.04e+155)
tmp = ((b * c) + ((t * a) * -4.0)) - (27.0 * (j * k));
elseif (t <= 1.55e+161)
tmp = t_3;
else
tmp = t_6;
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[(27.0 * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] - t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 - t$95$1), $MachinePrecision]}, If[LessEqual[t, -2.8e+99], N[(t$95$5 - t$95$2), $MachinePrecision], If[LessEqual[t, 4.4e-91], t$95$4, If[LessEqual[t, 0.00037], t$95$6, If[LessEqual[t, 1.35e+29], t$95$4, If[LessEqual[t, 1.04e+155], N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e+161], t$95$3, t$95$6]]]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(27 \cdot k\right)\\
t_2 := 4 \cdot \left(x \cdot i\right)\\
t_3 := b \cdot c - t_2\\
t_4 := t_3 - t_1\\
t_5 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
t_6 := t_5 - t_1\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{+99}:\\
\;\;\;\;t_5 - t_2\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-91}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 0.00037:\\
\;\;\;\;t_6\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+29}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 1.04 \cdot 10^{+155}:\\
\;\;\;\;\left(b \cdot c + \left(t \cdot a\right) \cdot -4\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+161}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_6\\
\end{array}
\end{array}
if t < -2.8e99Initial program 76.7%
Taylor expanded in j around 0 73.4%
Taylor expanded in t around 0 85.9%
Taylor expanded in b around 0 79.2%
if -2.8e99 < t < 4.4000000000000002e-91 or 3.6999999999999999e-4 < t < 1.35e29Initial program 85.7%
associate-*l*85.8%
associate--l+85.8%
distribute-rgt-out--85.8%
associate-*l*81.5%
associate-*l*81.5%
Simplified81.5%
Taylor expanded in t around 0 77.4%
if 4.4000000000000002e-91 < t < 3.6999999999999999e-4 or 1.55000000000000003e161 < t Initial program 76.0%
associate-*l*76.1%
associate--l+76.1%
distribute-rgt-out--85.6%
associate-*l*83.5%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in t around inf 80.8%
if 1.35e29 < t < 1.03999999999999996e155Initial program 88.1%
associate-*l*88.1%
associate--l+88.1%
distribute-rgt-out--88.1%
associate-*l*82.7%
associate-*l*82.7%
Simplified82.7%
Taylor expanded in x around 0 76.7%
if 1.03999999999999996e155 < t < 1.55000000000000003e161Initial program 100.0%
associate-*l*100.0%
associate--l+100.0%
distribute-rgt-out--100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
Taylor expanded in j around 0 100.0%
Final simplification78.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 (* j (* 27.0 k)))
(t_3 (* 4.0 (* x i)))
(t_4 (- (- (+ (* b c) (* (* t a) -4.0)) t_3) t_2)))
(if (<= t -3.8e+99)
(- (+ (* b c) (* t (- (* 18.0 t_1) (* a 4.0)))) t_3)
(if (<= t 1.2e-66)
t_4
(if (<= t 1.02e+63)
(- (+ (* b c) (* 18.0 (* t t_1))) (+ t_3 (* 4.0 (* t a))))
(if (<= t 2e+161)
t_4
(- (* t (- (* (* y z) (* x (- -18.0))) (* a 4.0))) 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 = j * (27.0 * k);
double t_3 = 4.0 * (x * i);
double t_4 = (((b * c) + ((t * a) * -4.0)) - t_3) - t_2;
double tmp;
if (t <= -3.8e+99) {
tmp = ((b * c) + (t * ((18.0 * t_1) - (a * 4.0)))) - t_3;
} else if (t <= 1.2e-66) {
tmp = t_4;
} else if (t <= 1.02e+63) {
tmp = ((b * c) + (18.0 * (t * t_1))) - (t_3 + (4.0 * (t * a)));
} else if (t <= 2e+161) {
tmp = t_4;
} else {
tmp = (t * (((y * z) * (x * -(-18.0))) - (a * 4.0))) - 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 = x * (y * z)
t_2 = j * (27.0d0 * k)
t_3 = 4.0d0 * (x * i)
t_4 = (((b * c) + ((t * a) * (-4.0d0))) - t_3) - t_2
if (t <= (-3.8d+99)) then
tmp = ((b * c) + (t * ((18.0d0 * t_1) - (a * 4.0d0)))) - t_3
else if (t <= 1.2d-66) then
tmp = t_4
else if (t <= 1.02d+63) then
tmp = ((b * c) + (18.0d0 * (t * t_1))) - (t_3 + (4.0d0 * (t * a)))
else if (t <= 2d+161) then
tmp = t_4
else
tmp = (t * (((y * z) * (x * -(-18.0d0))) - (a * 4.0d0))) - 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 = j * (27.0 * k);
double t_3 = 4.0 * (x * i);
double t_4 = (((b * c) + ((t * a) * -4.0)) - t_3) - t_2;
double tmp;
if (t <= -3.8e+99) {
tmp = ((b * c) + (t * ((18.0 * t_1) - (a * 4.0)))) - t_3;
} else if (t <= 1.2e-66) {
tmp = t_4;
} else if (t <= 1.02e+63) {
tmp = ((b * c) + (18.0 * (t * t_1))) - (t_3 + (4.0 * (t * a)));
} else if (t <= 2e+161) {
tmp = t_4;
} else {
tmp = (t * (((y * z) * (x * -(-18.0))) - (a * 4.0))) - 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 = j * (27.0 * k) t_3 = 4.0 * (x * i) t_4 = (((b * c) + ((t * a) * -4.0)) - t_3) - t_2 tmp = 0 if t <= -3.8e+99: tmp = ((b * c) + (t * ((18.0 * t_1) - (a * 4.0)))) - t_3 elif t <= 1.2e-66: tmp = t_4 elif t <= 1.02e+63: tmp = ((b * c) + (18.0 * (t * t_1))) - (t_3 + (4.0 * (t * a))) elif t <= 2e+161: tmp = t_4 else: tmp = (t * (((y * z) * (x * -(-18.0))) - (a * 4.0))) - 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(j * Float64(27.0 * k)) t_3 = Float64(4.0 * Float64(x * i)) t_4 = Float64(Float64(Float64(Float64(b * c) + Float64(Float64(t * a) * -4.0)) - t_3) - t_2) tmp = 0.0 if (t <= -3.8e+99) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * t_1) - Float64(a * 4.0)))) - t_3); elseif (t <= 1.2e-66) tmp = t_4; elseif (t <= 1.02e+63) tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(t * t_1))) - Float64(t_3 + Float64(4.0 * Float64(t * a)))); elseif (t <= 2e+161) tmp = t_4; else tmp = Float64(Float64(t * Float64(Float64(Float64(y * z) * Float64(x * Float64(-(-18.0)))) - Float64(a * 4.0))) - 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 = j * (27.0 * k);
t_3 = 4.0 * (x * i);
t_4 = (((b * c) + ((t * a) * -4.0)) - t_3) - t_2;
tmp = 0.0;
if (t <= -3.8e+99)
tmp = ((b * c) + (t * ((18.0 * t_1) - (a * 4.0)))) - t_3;
elseif (t <= 1.2e-66)
tmp = t_4;
elseif (t <= 1.02e+63)
tmp = ((b * c) + (18.0 * (t * t_1))) - (t_3 + (4.0 * (t * a)));
elseif (t <= 2e+161)
tmp = t_4;
else
tmp = (t * (((y * z) * (x * -(-18.0))) - (a * 4.0))) - 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[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[t, -3.8e+99], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * t$95$1), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision], If[LessEqual[t, 1.2e-66], t$95$4, If[LessEqual[t, 1.02e+63], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$3 + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+161], t$95$4, N[(N[(t * N[(N[(N[(y * z), $MachinePrecision] * N[(x * (--18.0)), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
t_2 := j \cdot \left(27 \cdot k\right)\\
t_3 := 4 \cdot \left(x \cdot i\right)\\
t_4 := \left(\left(b \cdot c + \left(t \cdot a\right) \cdot -4\right) - t_3\right) - t_2\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{+99}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot t_1 - a \cdot 4\right)\right) - t_3\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-66}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{+63}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(t \cdot t_1\right)\right) - \left(t_3 + 4 \cdot \left(t \cdot a\right)\right)\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+161}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot \left(--18\right)\right) - a \cdot 4\right) - t_2\\
\end{array}
\end{array}
if t < -3.8e99Initial program 76.7%
Taylor expanded in j around 0 73.4%
Taylor expanded in t around 0 85.9%
if -3.8e99 < t < 1.20000000000000013e-66 or 1.02e63 < t < 2.0000000000000001e161Initial program 85.1%
associate-*l*85.2%
associate--l+85.2%
distribute-rgt-out--85.2%
associate-*l*81.1%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in y around 0 83.7%
if 1.20000000000000013e-66 < t < 1.02e63Initial program 96.2%
Taylor expanded in j around 0 86.1%
if 2.0000000000000001e161 < t Initial program 66.5%
associate-*l*66.6%
associate--l+66.6%
distribute-rgt-out--81.4%
associate-*l*81.4%
associate-*l*81.4%
Simplified81.4%
associate-*r*81.4%
distribute-rgt-out--66.6%
associate-*l*59.1%
associate-*l*59.1%
*-commutative59.1%
Applied egg-rr59.1%
Taylor expanded in t around -inf 89.0%
associate-*r*89.0%
neg-mul-189.0%
cancel-sign-sub-inv89.0%
associate-*r*89.1%
metadata-eval89.1%
Simplified89.1%
Final simplification85.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
(if (<= b -1.18e+269)
(- (* b c) (* 4.0 (* t a)))
(-
(+ (- (* b c) (* x (* 4.0 i))) (* t (- (* (* x 18.0) (* y z)) (* a 4.0))))
(* j (* 27.0 k)))))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 <= -1.18e+269) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = (((b * c) - (x * (4.0 * i))) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - (j * (27.0 * k));
}
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 <= (-1.18d+269)) then
tmp = (b * c) - (4.0d0 * (t * a))
else
tmp = (((b * c) - (x * (4.0d0 * i))) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - (j * (27.0d0 * k))
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 <= -1.18e+269) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = (((b * c) - (x * (4.0 * i))) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - (j * (27.0 * k));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if b <= -1.18e+269: tmp = (b * c) - (4.0 * (t * a)) else: tmp = (((b * c) - (x * (4.0 * i))) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - (j * (27.0 * k)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (b <= -1.18e+269) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); 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)))) - Float64(j * Float64(27.0 * k))); 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 <= -1.18e+269)
tmp = (b * c) - (4.0 * (t * a));
else
tmp = (((b * c) - (x * (4.0 * i))) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - (j * (27.0 * k));
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[b, -1.18e+269], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $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] - N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.18 \cdot 10^{+269}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\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) - j \cdot \left(27 \cdot k\right)\\
\end{array}
\end{array}
if b < -1.17999999999999993e269Initial program 26.0%
Taylor expanded in j around 0 26.0%
Taylor expanded in x around 0 52.0%
if -1.17999999999999993e269 < b Initial program 83.4%
associate-*l*83.4%
associate--l+83.4%
distribute-rgt-out--86.6%
associate-*l*83.9%
associate-*l*83.9%
Simplified83.9%
Final simplification83.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 (* j (* 27.0 k)))
(t_2 (* 4.0 (* x i)))
(t_3 (- (- (+ (* b c) (* (* t a) -4.0)) t_2) t_1))
(t_4 (- (+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))) t_2)))
(if (<= t -6.5e+100)
t_4
(if (<= t 2.05e-67)
t_3
(if (<= t 2.45e+67)
t_4
(if (<= t 1.75e+161)
t_3
(- (* t (- (* (* y z) (* x (- -18.0))) (* 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 * (27.0 * k);
double t_2 = 4.0 * (x * i);
double t_3 = (((b * c) + ((t * a) * -4.0)) - t_2) - t_1;
double t_4 = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_2;
double tmp;
if (t <= -6.5e+100) {
tmp = t_4;
} else if (t <= 2.05e-67) {
tmp = t_3;
} else if (t <= 2.45e+67) {
tmp = t_4;
} else if (t <= 1.75e+161) {
tmp = t_3;
} else {
tmp = (t * (((y * z) * (x * -(-18.0))) - (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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = j * (27.0d0 * k)
t_2 = 4.0d0 * (x * i)
t_3 = (((b * c) + ((t * a) * (-4.0d0))) - t_2) - t_1
t_4 = ((b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))) - t_2
if (t <= (-6.5d+100)) then
tmp = t_4
else if (t <= 2.05d-67) then
tmp = t_3
else if (t <= 2.45d+67) then
tmp = t_4
else if (t <= 1.75d+161) then
tmp = t_3
else
tmp = (t * (((y * z) * (x * -(-18.0d0))) - (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 * (27.0 * k);
double t_2 = 4.0 * (x * i);
double t_3 = (((b * c) + ((t * a) * -4.0)) - t_2) - t_1;
double t_4 = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_2;
double tmp;
if (t <= -6.5e+100) {
tmp = t_4;
} else if (t <= 2.05e-67) {
tmp = t_3;
} else if (t <= 2.45e+67) {
tmp = t_4;
} else if (t <= 1.75e+161) {
tmp = t_3;
} else {
tmp = (t * (((y * z) * (x * -(-18.0))) - (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 * (27.0 * k) t_2 = 4.0 * (x * i) t_3 = (((b * c) + ((t * a) * -4.0)) - t_2) - t_1 t_4 = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_2 tmp = 0 if t <= -6.5e+100: tmp = t_4 elif t <= 2.05e-67: tmp = t_3 elif t <= 2.45e+67: tmp = t_4 elif t <= 1.75e+161: tmp = t_3 else: tmp = (t * (((y * z) * (x * -(-18.0))) - (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(27.0 * k)) t_2 = Float64(4.0 * Float64(x * i)) t_3 = Float64(Float64(Float64(Float64(b * c) + Float64(Float64(t * a) * -4.0)) - t_2) - t_1) t_4 = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))) - t_2) tmp = 0.0 if (t <= -6.5e+100) tmp = t_4; elseif (t <= 2.05e-67) tmp = t_3; elseif (t <= 2.45e+67) tmp = t_4; elseif (t <= 1.75e+161) tmp = t_3; else tmp = Float64(Float64(t * Float64(Float64(Float64(y * z) * Float64(x * Float64(-(-18.0)))) - 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 * (27.0 * k);
t_2 = 4.0 * (x * i);
t_3 = (((b * c) + ((t * a) * -4.0)) - t_2) - t_1;
t_4 = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_2;
tmp = 0.0;
if (t <= -6.5e+100)
tmp = t_4;
elseif (t <= 2.05e-67)
tmp = t_3;
elseif (t <= 2.45e+67)
tmp = t_4;
elseif (t <= 1.75e+161)
tmp = t_3;
else
tmp = (t * (((y * z) * (x * -(-18.0))) - (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[(27.0 * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$4 = 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$2), $MachinePrecision]}, If[LessEqual[t, -6.5e+100], t$95$4, If[LessEqual[t, 2.05e-67], t$95$3, If[LessEqual[t, 2.45e+67], t$95$4, If[LessEqual[t, 1.75e+161], t$95$3, N[(N[(t * N[(N[(N[(y * z), $MachinePrecision] * N[(x * (--18.0)), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(27 \cdot k\right)\\
t_2 := 4 \cdot \left(x \cdot i\right)\\
t_3 := \left(\left(b \cdot c + \left(t \cdot a\right) \cdot -4\right) - t_2\right) - t_1\\
t_4 := \left(b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\right) - t_2\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{+100}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{-67}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 2.45 \cdot 10^{+67}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+161}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot \left(--18\right)\right) - a \cdot 4\right) - t_1\\
\end{array}
\end{array}
if t < -6.50000000000000001e100 or 2.0499999999999999e-67 < t < 2.44999999999999995e67Initial program 83.0%
Taylor expanded in j around 0 77.6%
Taylor expanded in t around 0 86.0%
if -6.50000000000000001e100 < t < 2.0499999999999999e-67 or 2.44999999999999995e67 < t < 1.74999999999999994e161Initial program 85.1%
associate-*l*85.2%
associate--l+85.2%
distribute-rgt-out--85.2%
associate-*l*81.1%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in y around 0 83.7%
if 1.74999999999999994e161 < t Initial program 66.5%
associate-*l*66.6%
associate--l+66.6%
distribute-rgt-out--81.4%
associate-*l*81.4%
associate-*l*81.4%
Simplified81.4%
associate-*r*81.4%
distribute-rgt-out--66.6%
associate-*l*59.1%
associate-*l*59.1%
*-commutative59.1%
Applied egg-rr59.1%
Taylor expanded in t around -inf 89.0%
associate-*r*89.0%
neg-mul-189.0%
cancel-sign-sub-inv89.0%
associate-*r*89.1%
metadata-eval89.1%
Simplified89.1%
Final simplification85.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 (* j (* 27.0 k))))
(if (<= t -2.9e+210)
(* t (- (* 18.0 (* x (* y z))) (* a 4.0)))
(if (<= t 1.7e+163)
(- (- (+ (* b c) (* (* t a) -4.0)) (* 4.0 (* x i))) t_1)
(- (* t (- (* (* y z) (* x (- -18.0))) (* 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 * (27.0 * k);
double tmp;
if (t <= -2.9e+210) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else if (t <= 1.7e+163) {
tmp = (((b * c) + ((t * a) * -4.0)) - (4.0 * (x * i))) - t_1;
} else {
tmp = (t * (((y * z) * (x * -(-18.0))) - (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 * (27.0d0 * k)
if (t <= (-2.9d+210)) then
tmp = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
else if (t <= 1.7d+163) then
tmp = (((b * c) + ((t * a) * (-4.0d0))) - (4.0d0 * (x * i))) - t_1
else
tmp = (t * (((y * z) * (x * -(-18.0d0))) - (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 * (27.0 * k);
double tmp;
if (t <= -2.9e+210) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else if (t <= 1.7e+163) {
tmp = (((b * c) + ((t * a) * -4.0)) - (4.0 * (x * i))) - t_1;
} else {
tmp = (t * (((y * z) * (x * -(-18.0))) - (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 * (27.0 * k) tmp = 0 if t <= -2.9e+210: tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0)) elif t <= 1.7e+163: tmp = (((b * c) + ((t * a) * -4.0)) - (4.0 * (x * i))) - t_1 else: tmp = (t * (((y * z) * (x * -(-18.0))) - (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(27.0 * k)) tmp = 0.0 if (t <= -2.9e+210) tmp = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))); elseif (t <= 1.7e+163) tmp = Float64(Float64(Float64(Float64(b * c) + Float64(Float64(t * a) * -4.0)) - Float64(4.0 * Float64(x * i))) - t_1); else tmp = Float64(Float64(t * Float64(Float64(Float64(y * z) * Float64(x * Float64(-(-18.0)))) - 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 * (27.0 * k);
tmp = 0.0;
if (t <= -2.9e+210)
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
elseif (t <= 1.7e+163)
tmp = (((b * c) + ((t * a) * -4.0)) - (4.0 * (x * i))) - t_1;
else
tmp = (t * (((y * z) * (x * -(-18.0))) - (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[(27.0 * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.9e+210], N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e+163], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(t * N[(N[(N[(y * z), $MachinePrecision] * N[(x * (--18.0)), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(27 \cdot k\right)\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{+210}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+163}:\\
\;\;\;\;\left(\left(b \cdot c + \left(t \cdot a\right) \cdot -4\right) - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot \left(--18\right)\right) - a \cdot 4\right) - t_1\\
\end{array}
\end{array}
if t < -2.89999999999999992e210Initial program 63.0%
Taylor expanded in j around 0 59.6%
Taylor expanded in t around inf 82.4%
if -2.89999999999999992e210 < t < 1.7000000000000001e163Initial program 87.2%
associate-*l*87.3%
associate--l+87.3%
distribute-rgt-out--87.8%
associate-*l*83.9%
associate-*l*83.9%
Simplified83.9%
Taylor expanded in y around 0 81.4%
if 1.7000000000000001e163 < t Initial program 66.5%
associate-*l*66.6%
associate--l+66.6%
distribute-rgt-out--81.4%
associate-*l*81.4%
associate-*l*81.4%
Simplified81.4%
associate-*r*81.4%
distribute-rgt-out--66.6%
associate-*l*59.1%
associate-*l*59.1%
*-commutative59.1%
Applied egg-rr59.1%
Taylor expanded in t around -inf 89.0%
associate-*r*89.0%
neg-mul-189.0%
cancel-sign-sub-inv89.0%
associate-*r*89.1%
metadata-eval89.1%
Simplified89.1%
Final simplification82.3%
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 (* j -27.0)))
(t_2 (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))))
(if (<= t -2.8e+99)
t_2
(if (<= t -3.2e-57)
(+ (* x (* i -4.0)) t_1)
(if (<= t -2e-182)
(+ (* b c) t_1)
(if (<= t 1e-65)
(- (* b c) (* 27.0 (* j k)))
(if (<= t 4.5e+161) (- (* b c) (* 4.0 (* t a))) 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 = k * (j * -27.0);
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -2.8e+99) {
tmp = t_2;
} else if (t <= -3.2e-57) {
tmp = (x * (i * -4.0)) + t_1;
} else if (t <= -2e-182) {
tmp = (b * c) + t_1;
} else if (t <= 1e-65) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t <= 4.5e+161) {
tmp = (b * c) - (4.0 * (t * a));
} 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 = k * (j * (-27.0d0))
t_2 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
if (t <= (-2.8d+99)) then
tmp = t_2
else if (t <= (-3.2d-57)) then
tmp = (x * (i * (-4.0d0))) + t_1
else if (t <= (-2d-182)) then
tmp = (b * c) + t_1
else if (t <= 1d-65) then
tmp = (b * c) - (27.0d0 * (j * k))
else if (t <= 4.5d+161) then
tmp = (b * c) - (4.0d0 * (t * a))
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 = k * (j * -27.0);
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -2.8e+99) {
tmp = t_2;
} else if (t <= -3.2e-57) {
tmp = (x * (i * -4.0)) + t_1;
} else if (t <= -2e-182) {
tmp = (b * c) + t_1;
} else if (t <= 1e-65) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t <= 4.5e+161) {
tmp = (b * c) - (4.0 * (t * a));
} 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 = k * (j * -27.0) t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) tmp = 0 if t <= -2.8e+99: tmp = t_2 elif t <= -3.2e-57: tmp = (x * (i * -4.0)) + t_1 elif t <= -2e-182: tmp = (b * c) + t_1 elif t <= 1e-65: tmp = (b * c) - (27.0 * (j * k)) elif t <= 4.5e+161: tmp = (b * c) - (4.0 * (t * a)) 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(k * Float64(j * -27.0)) t_2 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -2.8e+99) tmp = t_2; elseif (t <= -3.2e-57) tmp = Float64(Float64(x * Float64(i * -4.0)) + t_1); elseif (t <= -2e-182) tmp = Float64(Float64(b * c) + t_1); elseif (t <= 1e-65) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); elseif (t <= 4.5e+161) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); 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 = k * (j * -27.0);
t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -2.8e+99)
tmp = t_2;
elseif (t <= -3.2e-57)
tmp = (x * (i * -4.0)) + t_1;
elseif (t <= -2e-182)
tmp = (b * c) + t_1;
elseif (t <= 1e-65)
tmp = (b * c) - (27.0 * (j * k));
elseif (t <= 4.5e+161)
tmp = (b * c) - (4.0 * (t * a));
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[(k * N[(j * -27.0), $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]}, If[LessEqual[t, -2.8e+99], t$95$2, If[LessEqual[t, -3.2e-57], N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, -2e-182], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 1e-65], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e+161], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot -27\right)\\
t_2 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{+99}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -3.2 \cdot 10^{-57}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right) + t_1\\
\mathbf{elif}\;t \leq -2 \cdot 10^{-182}:\\
\;\;\;\;b \cdot c + t_1\\
\mathbf{elif}\;t \leq 10^{-65}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+161}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.8e99 or 4.49999999999999992e161 < t Initial program 73.4%
Taylor expanded in j around 0 69.6%
Taylor expanded in t around inf 80.3%
if -2.8e99 < t < -3.2000000000000001e-57Initial program 92.3%
Simplified78.1%
Taylor expanded in i around inf 53.0%
associate-*r*53.0%
*-commutative53.0%
Simplified53.0%
if -3.2000000000000001e-57 < t < -2.0000000000000001e-182Initial program 84.3%
Simplified77.7%
Taylor expanded in b around inf 65.6%
if -2.0000000000000001e-182 < t < 9.99999999999999923e-66Initial program 83.4%
associate-*l*83.5%
associate--l+83.5%
distribute-rgt-out--83.5%
associate-*l*83.5%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in t around 0 81.2%
Taylor expanded in i around 0 65.6%
if 9.99999999999999923e-66 < t < 4.49999999999999992e161Initial program 92.1%
Taylor expanded in j around 0 79.7%
Taylor expanded in x around 0 54.2%
Final simplification67.3%
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) (+ (* 4.0 (* x i)) (* 4.0 (* t a)))))
(t_2 (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))))
(if (<= t -5e+210)
t_2
(if (<= t -9.5e-52)
t_1
(if (<= t 1.32e-95)
(- (* b c) (* 27.0 (* j k)))
(if (<= t 2.3e+161) 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) - ((4.0 * (x * i)) + (4.0 * (t * a)));
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -5e+210) {
tmp = t_2;
} else if (t <= -9.5e-52) {
tmp = t_1;
} else if (t <= 1.32e-95) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t <= 2.3e+161) {
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) :: tmp
t_1 = (b * c) - ((4.0d0 * (x * i)) + (4.0d0 * (t * a)))
t_2 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
if (t <= (-5d+210)) then
tmp = t_2
else if (t <= (-9.5d-52)) then
tmp = t_1
else if (t <= 1.32d-95) then
tmp = (b * c) - (27.0d0 * (j * k))
else if (t <= 2.3d+161) 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) - ((4.0 * (x * i)) + (4.0 * (t * a)));
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -5e+210) {
tmp = t_2;
} else if (t <= -9.5e-52) {
tmp = t_1;
} else if (t <= 1.32e-95) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t <= 2.3e+161) {
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) - ((4.0 * (x * i)) + (4.0 * (t * a))) t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) tmp = 0 if t <= -5e+210: tmp = t_2 elif t <= -9.5e-52: tmp = t_1 elif t <= 1.32e-95: tmp = (b * c) - (27.0 * (j * k)) elif t <= 2.3e+161: 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(Float64(4.0 * Float64(x * i)) + Float64(4.0 * Float64(t * a)))) t_2 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -5e+210) tmp = t_2; elseif (t <= -9.5e-52) tmp = t_1; elseif (t <= 1.32e-95) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); elseif (t <= 2.3e+161) 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) - ((4.0 * (x * i)) + (4.0 * (t * a)));
t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -5e+210)
tmp = t_2;
elseif (t <= -9.5e-52)
tmp = t_1;
elseif (t <= 1.32e-95)
tmp = (b * c) - (27.0 * (j * k));
elseif (t <= 2.3e+161)
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[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(t * a), $MachinePrecision]), $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]}, If[LessEqual[t, -5e+210], t$95$2, If[LessEqual[t, -9.5e-52], t$95$1, If[LessEqual[t, 1.32e-95], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e+161], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 4 \cdot \left(t \cdot a\right)\right)\\
t_2 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -5 \cdot 10^{+210}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -9.5 \cdot 10^{-52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.32 \cdot 10^{-95}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+161}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -4.9999999999999998e210 or 2.2999999999999999e161 < t Initial program 64.7%
Taylor expanded in j around 0 60.6%
Taylor expanded in t around inf 83.1%
if -4.9999999999999998e210 < t < -9.50000000000000007e-52 or 1.31999999999999996e-95 < t < 2.2999999999999999e161Initial program 91.5%
Taylor expanded in j around 0 76.7%
Taylor expanded in y around 0 66.5%
if -9.50000000000000007e-52 < t < 1.31999999999999996e-95Initial program 83.4%
associate-*l*83.4%
associate--l+83.4%
distribute-rgt-out--83.4%
associate-*l*80.6%
associate-*l*80.6%
Simplified80.6%
Taylor expanded in t around 0 79.8%
Taylor expanded in i around 0 67.0%
Final simplification70.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 (* k (* j -27.0))))
(if (<= (* b c) -5.2e+99)
(+ (* b c) t_1)
(if (<= (* b c) -0.0145)
(- (* b c) (* 4.0 (* x i)))
(if (<= (* b c) 1.85e+79)
(+ (* (* t a) -4.0) t_1)
(- (* b c) (* 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 t_1 = k * (j * -27.0);
double tmp;
if ((b * c) <= -5.2e+99) {
tmp = (b * c) + t_1;
} else if ((b * c) <= -0.0145) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= 1.85e+79) {
tmp = ((t * a) * -4.0) + t_1;
} else {
tmp = (b * c) - (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) :: t_1
real(8) :: tmp
t_1 = k * (j * (-27.0d0))
if ((b * c) <= (-5.2d+99)) then
tmp = (b * c) + t_1
else if ((b * c) <= (-0.0145d0)) then
tmp = (b * c) - (4.0d0 * (x * i))
else if ((b * c) <= 1.85d+79) then
tmp = ((t * a) * (-4.0d0)) + t_1
else
tmp = (b * c) - (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 t_1 = k * (j * -27.0);
double tmp;
if ((b * c) <= -5.2e+99) {
tmp = (b * c) + t_1;
} else if ((b * c) <= -0.0145) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= 1.85e+79) {
tmp = ((t * a) * -4.0) + t_1;
} else {
tmp = (b * c) - (4.0 * (t * a));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = k * (j * -27.0) tmp = 0 if (b * c) <= -5.2e+99: tmp = (b * c) + t_1 elif (b * c) <= -0.0145: tmp = (b * c) - (4.0 * (x * i)) elif (b * c) <= 1.85e+79: tmp = ((t * a) * -4.0) + t_1 else: tmp = (b * c) - (4.0 * (t * a)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(k * Float64(j * -27.0)) tmp = 0.0 if (Float64(b * c) <= -5.2e+99) tmp = Float64(Float64(b * c) + t_1); elseif (Float64(b * c) <= -0.0145) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (Float64(b * c) <= 1.85e+79) tmp = Float64(Float64(Float64(t * a) * -4.0) + t_1); else tmp = Float64(Float64(b * c) - 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)
t_1 = k * (j * -27.0);
tmp = 0.0;
if ((b * c) <= -5.2e+99)
tmp = (b * c) + t_1;
elseif ((b * c) <= -0.0145)
tmp = (b * c) - (4.0 * (x * i));
elseif ((b * c) <= 1.85e+79)
tmp = ((t * a) * -4.0) + t_1;
else
tmp = (b * c) - (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_] := Block[{t$95$1 = N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -5.2e+99], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -0.0145], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.85e+79], N[(N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot -27\right)\\
\mathbf{if}\;b \cdot c \leq -5.2 \cdot 10^{+99}:\\
\;\;\;\;b \cdot c + t_1\\
\mathbf{elif}\;b \cdot c \leq -0.0145:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 1.85 \cdot 10^{+79}:\\
\;\;\;\;\left(t \cdot a\right) \cdot -4 + t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -5.1999999999999999e99Initial program 74.3%
Simplified79.4%
Taylor expanded in b around inf 69.4%
if -5.1999999999999999e99 < (*.f64 b c) < -0.0145000000000000007Initial program 76.3%
associate-*l*76.3%
associate--l+76.3%
distribute-rgt-out--81.1%
associate-*l*81.1%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in t around 0 57.3%
Taylor expanded in j around 0 52.9%
if -0.0145000000000000007 < (*.f64 b c) < 1.85000000000000005e79Initial program 84.7%
Simplified84.1%
Taylor expanded in a around inf 55.7%
*-commutative55.7%
Simplified55.7%
if 1.85000000000000005e79 < (*.f64 b c) Initial program 85.2%
Taylor expanded in j around 0 79.1%
Taylor expanded in x around 0 73.5%
Final simplification61.3%
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)))))
(if (<= t -4.2e+100)
t_1
(if (<= t -3.5e-47)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(if (<= t 1e-65)
(- (* b c) (* 27.0 (* j k)))
(if (<= t 1.75e+161) (- (* b c) (* 4.0 (* t a))) 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 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -4.2e+100) {
tmp = t_1;
} else if (t <= -3.5e-47) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (t <= 1e-65) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t <= 1.75e+161) {
tmp = (b * c) - (4.0 * (t * a));
} 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) :: tmp
t_1 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
if (t <= (-4.2d+100)) then
tmp = t_1
else if (t <= (-3.5d-47)) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else if (t <= 1d-65) then
tmp = (b * c) - (27.0d0 * (j * k))
else if (t <= 1.75d+161) then
tmp = (b * c) - (4.0d0 * (t * a))
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 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -4.2e+100) {
tmp = t_1;
} else if (t <= -3.5e-47) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (t <= 1e-65) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t <= 1.75e+161) {
tmp = (b * c) - (4.0 * (t * a));
} 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 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) tmp = 0 if t <= -4.2e+100: tmp = t_1 elif t <= -3.5e-47: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) elif t <= 1e-65: tmp = (b * c) - (27.0 * (j * k)) elif t <= 1.75e+161: tmp = (b * c) - (4.0 * (t * a)) 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(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -4.2e+100) tmp = t_1; elseif (t <= -3.5e-47) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); elseif (t <= 1e-65) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); elseif (t <= 1.75e+161) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); 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 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -4.2e+100)
tmp = t_1;
elseif (t <= -3.5e-47)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
elseif (t <= 1e-65)
tmp = (b * c) - (27.0 * (j * k));
elseif (t <= 1.75e+161)
tmp = (b * c) - (4.0 * (t * a));
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[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.2e+100], t$95$1, If[LessEqual[t, -3.5e-47], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-65], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e+161], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\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)\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -3.5 \cdot 10^{-47}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;t \leq 10^{-65}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+161}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.1999999999999997e100 or 1.74999999999999994e161 < t Initial program 73.4%
Taylor expanded in j around 0 69.6%
Taylor expanded in t around inf 80.3%
if -4.1999999999999997e100 < t < -3.4999999999999998e-47Initial program 90.6%
Taylor expanded in j around 0 64.5%
Taylor expanded in x around inf 55.9%
if -3.4999999999999998e-47 < t < 9.99999999999999923e-66Initial program 84.4%
associate-*l*84.4%
associate--l+84.4%
distribute-rgt-out--84.4%
associate-*l*80.9%
associate-*l*80.9%
Simplified80.9%
Taylor expanded in t around 0 78.5%
Taylor expanded in i around 0 64.5%
if 9.99999999999999923e-66 < t < 1.74999999999999994e161Initial program 92.1%
Taylor expanded in j around 0 79.7%
Taylor expanded in x around 0 54.2%
Final simplification67.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 (* 4.0 (* x i))) (t_2 (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))))
(if (<= t -1.7e+100)
t_2
(if (<= t 1e-65)
(- (- (* b c) t_1) (* j (* 27.0 k)))
(if (<= t 1.25e+162) (- (* b c) (+ t_1 (* 4.0 (* t a)))) 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 = 4.0 * (x * i);
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -1.7e+100) {
tmp = t_2;
} else if (t <= 1e-65) {
tmp = ((b * c) - t_1) - (j * (27.0 * k));
} else if (t <= 1.25e+162) {
tmp = (b * c) - (t_1 + (4.0 * (t * a)));
} 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 = 4.0d0 * (x * i)
t_2 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
if (t <= (-1.7d+100)) then
tmp = t_2
else if (t <= 1d-65) then
tmp = ((b * c) - t_1) - (j * (27.0d0 * k))
else if (t <= 1.25d+162) then
tmp = (b * c) - (t_1 + (4.0d0 * (t * a)))
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 = 4.0 * (x * i);
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -1.7e+100) {
tmp = t_2;
} else if (t <= 1e-65) {
tmp = ((b * c) - t_1) - (j * (27.0 * k));
} else if (t <= 1.25e+162) {
tmp = (b * c) - (t_1 + (4.0 * (t * a)));
} 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 = 4.0 * (x * i) t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) tmp = 0 if t <= -1.7e+100: tmp = t_2 elif t <= 1e-65: tmp = ((b * c) - t_1) - (j * (27.0 * k)) elif t <= 1.25e+162: tmp = (b * c) - (t_1 + (4.0 * (t * a))) 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(4.0 * Float64(x * i)) t_2 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -1.7e+100) tmp = t_2; elseif (t <= 1e-65) tmp = Float64(Float64(Float64(b * c) - t_1) - Float64(j * Float64(27.0 * k))); elseif (t <= 1.25e+162) tmp = Float64(Float64(b * c) - Float64(t_1 + Float64(4.0 * Float64(t * a)))); 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 = 4.0 * (x * i);
t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -1.7e+100)
tmp = t_2;
elseif (t <= 1e-65)
tmp = ((b * c) - t_1) - (j * (27.0 * k));
elseif (t <= 1.25e+162)
tmp = (b * c) - (t_1 + (4.0 * (t * a)));
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[(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]}, If[LessEqual[t, -1.7e+100], t$95$2, If[LessEqual[t, 1e-65], N[(N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+162], N[(N[(b * c), $MachinePrecision] - N[(t$95$1 + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\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)\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+100}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 10^{-65}:\\
\;\;\;\;\left(b \cdot c - t_1\right) - j \cdot \left(27 \cdot k\right)\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+162}:\\
\;\;\;\;b \cdot c - \left(t_1 + 4 \cdot \left(t \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.69999999999999997e100 or 1.2499999999999999e162 < t Initial program 73.4%
Taylor expanded in j around 0 69.6%
Taylor expanded in t around inf 80.3%
if -1.69999999999999997e100 < t < 9.99999999999999923e-66Initial program 85.4%
associate-*l*85.5%
associate--l+85.5%
distribute-rgt-out--85.5%
associate-*l*81.1%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in t around 0 76.0%
if 9.99999999999999923e-66 < t < 1.2499999999999999e162Initial program 92.1%
Taylor expanded in j around 0 79.7%
Taylor expanded in y around 0 67.0%
Final simplification76.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 (* 4.0 (* x i))) (t_2 (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))))
(if (<= t -8e+99)
(- t_2 t_1)
(if (<= t 9.6e-66)
(- (- (* b c) t_1) (* j (* 27.0 k)))
(if (<= t 8.8e+163) (- (* b c) (+ t_1 (* 4.0 (* t a)))) 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 = 4.0 * (x * i);
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -8e+99) {
tmp = t_2 - t_1;
} else if (t <= 9.6e-66) {
tmp = ((b * c) - t_1) - (j * (27.0 * k));
} else if (t <= 8.8e+163) {
tmp = (b * c) - (t_1 + (4.0 * (t * a)));
} 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 = 4.0d0 * (x * i)
t_2 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
if (t <= (-8d+99)) then
tmp = t_2 - t_1
else if (t <= 9.6d-66) then
tmp = ((b * c) - t_1) - (j * (27.0d0 * k))
else if (t <= 8.8d+163) then
tmp = (b * c) - (t_1 + (4.0d0 * (t * a)))
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 = 4.0 * (x * i);
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -8e+99) {
tmp = t_2 - t_1;
} else if (t <= 9.6e-66) {
tmp = ((b * c) - t_1) - (j * (27.0 * k));
} else if (t <= 8.8e+163) {
tmp = (b * c) - (t_1 + (4.0 * (t * a)));
} 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 = 4.0 * (x * i) t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) tmp = 0 if t <= -8e+99: tmp = t_2 - t_1 elif t <= 9.6e-66: tmp = ((b * c) - t_1) - (j * (27.0 * k)) elif t <= 8.8e+163: tmp = (b * c) - (t_1 + (4.0 * (t * a))) 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(4.0 * Float64(x * i)) t_2 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -8e+99) tmp = Float64(t_2 - t_1); elseif (t <= 9.6e-66) tmp = Float64(Float64(Float64(b * c) - t_1) - Float64(j * Float64(27.0 * k))); elseif (t <= 8.8e+163) tmp = Float64(Float64(b * c) - Float64(t_1 + Float64(4.0 * Float64(t * a)))); 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 = 4.0 * (x * i);
t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -8e+99)
tmp = t_2 - t_1;
elseif (t <= 9.6e-66)
tmp = ((b * c) - t_1) - (j * (27.0 * k));
elseif (t <= 8.8e+163)
tmp = (b * c) - (t_1 + (4.0 * (t * a)));
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[(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]}, If[LessEqual[t, -8e+99], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[t, 9.6e-66], N[(N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.8e+163], N[(N[(b * c), $MachinePrecision] - N[(t$95$1 + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\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)\\
\mathbf{if}\;t \leq -8 \cdot 10^{+99}:\\
\;\;\;\;t_2 - t_1\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{-66}:\\
\;\;\;\;\left(b \cdot c - t_1\right) - j \cdot \left(27 \cdot k\right)\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{+163}:\\
\;\;\;\;b \cdot c - \left(t_1 + 4 \cdot \left(t \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -7.9999999999999997e99Initial program 76.7%
Taylor expanded in j around 0 73.4%
Taylor expanded in t around 0 85.9%
Taylor expanded in b around 0 79.2%
if -7.9999999999999997e99 < t < 9.60000000000000103e-66Initial program 85.4%
associate-*l*85.5%
associate--l+85.5%
distribute-rgt-out--85.5%
associate-*l*81.1%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in t around 0 76.0%
if 9.60000000000000103e-66 < t < 8.79999999999999945e163Initial program 92.1%
Taylor expanded in j around 0 79.7%
Taylor expanded in y around 0 67.0%
if 8.79999999999999945e163 < t Initial program 66.5%
Taylor expanded in j around 0 61.7%
Taylor expanded in t around inf 83.9%
Final simplification76.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 (<= t -1.1e+162) (not (<= t 2.45e+163))) (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) (- (+ (* b c) (* (* t a) -4.0)) (* 27.0 (* j k)))))
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+162) || !(t <= 2.45e+163)) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = ((b * c) + ((t * a) * -4.0)) - (27.0 * (j * k));
}
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+162)) .or. (.not. (t <= 2.45d+163))) then
tmp = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
else
tmp = ((b * c) + ((t * a) * (-4.0d0))) - (27.0d0 * (j * k))
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+162) || !(t <= 2.45e+163)) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = ((b * c) + ((t * a) * -4.0)) - (27.0 * (j * k));
}
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+162) or not (t <= 2.45e+163): tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0)) else: tmp = ((b * c) + ((t * a) * -4.0)) - (27.0 * (j * k)) 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+162) || !(t <= 2.45e+163)) tmp = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))); else tmp = Float64(Float64(Float64(b * c) + Float64(Float64(t * a) * -4.0)) - Float64(27.0 * Float64(j * k))); 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+162) || ~((t <= 2.45e+163)))
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
else
tmp = ((b * c) + ((t * a) * -4.0)) - (27.0 * (j * k));
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+162], N[Not[LessEqual[t, 2.45e+163]], $MachinePrecision]], N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+162} \lor \neg \left(t \leq 2.45 \cdot 10^{+163}\right):\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + \left(t \cdot a\right) \cdot -4\right) - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if t < -1.1000000000000001e162 or 2.45e163 < t Initial program 69.0%
Taylor expanded in j around 0 65.7%
Taylor expanded in t around inf 80.8%
if -1.1000000000000001e162 < t < 2.45e163Initial program 87.4%
associate-*l*87.4%
associate--l+87.4%
distribute-rgt-out--87.9%
associate-*l*83.8%
associate-*l*83.8%
Simplified83.8%
Taylor expanded in x around 0 67.1%
Final simplification70.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
(if (<= t -7e+209)
(* t (* x (* 18.0 (* y z))))
(if (or (<= t -1.75e+99) (not (<= t 9e+161)))
(* t (* a -4.0))
(+ (* b c) (* k (* j -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 tmp;
if (t <= -7e+209) {
tmp = t * (x * (18.0 * (y * z)));
} else if ((t <= -1.75e+99) || !(t <= 9e+161)) {
tmp = t * (a * -4.0);
} else {
tmp = (b * c) + (k * (j * -27.0));
}
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 <= (-7d+209)) then
tmp = t * (x * (18.0d0 * (y * z)))
else if ((t <= (-1.75d+99)) .or. (.not. (t <= 9d+161))) then
tmp = t * (a * (-4.0d0))
else
tmp = (b * c) + (k * (j * (-27.0d0)))
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 <= -7e+209) {
tmp = t * (x * (18.0 * (y * z)));
} else if ((t <= -1.75e+99) || !(t <= 9e+161)) {
tmp = t * (a * -4.0);
} else {
tmp = (b * c) + (k * (j * -27.0));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if t <= -7e+209: tmp = t * (x * (18.0 * (y * z))) elif (t <= -1.75e+99) or not (t <= 9e+161): tmp = t * (a * -4.0) else: tmp = (b * c) + (k * (j * -27.0)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (t <= -7e+209) tmp = Float64(t * Float64(x * Float64(18.0 * Float64(y * z)))); elseif ((t <= -1.75e+99) || !(t <= 9e+161)) tmp = Float64(t * Float64(a * -4.0)); else tmp = Float64(Float64(b * c) + Float64(k * Float64(j * -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)
tmp = 0.0;
if (t <= -7e+209)
tmp = t * (x * (18.0 * (y * z)));
elseif ((t <= -1.75e+99) || ~((t <= 9e+161)))
tmp = t * (a * -4.0);
else
tmp = (b * c) + (k * (j * -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_] := If[LessEqual[t, -7e+209], N[(t * N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.75e+99], N[Not[LessEqual[t, 9e+161]], $MachinePrecision]], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+209}:\\
\;\;\;\;t \cdot \left(x \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;t \leq -1.75 \cdot 10^{+99} \lor \neg \left(t \leq 9 \cdot 10^{+161}\right):\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + k \cdot \left(j \cdot -27\right)\\
\end{array}
\end{array}
if t < -7.0000000000000005e209Initial program 64.3%
Taylor expanded in j around 0 61.0%
Taylor expanded in t around inf 79.5%
Taylor expanded in x around inf 51.1%
associate-*r*51.1%
*-commutative51.1%
associate-*l*51.1%
Simplified51.1%
if -7.0000000000000005e209 < t < -1.7499999999999999e99 or 8.99999999999999984e161 < t Initial program 78.4%
Taylor expanded in j around 0 72.7%
Taylor expanded in t around inf 79.3%
Taylor expanded in x around 0 55.1%
*-commutative55.1%
Simplified55.1%
if -1.7499999999999999e99 < t < 8.99999999999999984e161Initial program 86.8%
Simplified82.9%
Taylor expanded in b around inf 56.7%
Final simplification55.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 -8e+98) (not (<= t 9.6e-66))) (- (* b c) (* 4.0 (* t a))) (+ (* b c) (* k (* j -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 tmp;
if ((t <= -8e+98) || !(t <= 9.6e-66)) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = (b * c) + (k * (j * -27.0));
}
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 <= (-8d+98)) .or. (.not. (t <= 9.6d-66))) then
tmp = (b * c) - (4.0d0 * (t * a))
else
tmp = (b * c) + (k * (j * (-27.0d0)))
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 <= -8e+98) || !(t <= 9.6e-66)) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = (b * c) + (k * (j * -27.0));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (t <= -8e+98) or not (t <= 9.6e-66): tmp = (b * c) - (4.0 * (t * a)) else: tmp = (b * c) + (k * (j * -27.0)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -8e+98) || !(t <= 9.6e-66)) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); else tmp = Float64(Float64(b * c) + Float64(k * Float64(j * -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)
tmp = 0.0;
if ((t <= -8e+98) || ~((t <= 9.6e-66)))
tmp = (b * c) - (4.0 * (t * a));
else
tmp = (b * c) + (k * (j * -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_] := If[Or[LessEqual[t, -8e+98], N[Not[LessEqual[t, 9.6e-66]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+98} \lor \neg \left(t \leq 9.6 \cdot 10^{-66}\right):\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + k \cdot \left(j \cdot -27\right)\\
\end{array}
\end{array}
if t < -7.99999999999999998e98 or 9.60000000000000103e-66 < t Initial program 79.4%
Taylor expanded in j around 0 72.2%
Taylor expanded in x around 0 54.5%
if -7.99999999999999998e98 < t < 9.60000000000000103e-66Initial program 85.3%
Simplified81.6%
Taylor expanded in b around inf 60.5%
Final simplification57.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 -8e+98) (not (<= t 9.5e-66))) (- (* b c) (* 4.0 (* t a))) (- (* b c) (* 27.0 (* j k)))))
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 <= -8e+98) || !(t <= 9.5e-66)) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = (b * c) - (27.0 * (j * k));
}
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 <= (-8d+98)) .or. (.not. (t <= 9.5d-66))) then
tmp = (b * c) - (4.0d0 * (t * a))
else
tmp = (b * c) - (27.0d0 * (j * k))
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 <= -8e+98) || !(t <= 9.5e-66)) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = (b * c) - (27.0 * (j * k));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (t <= -8e+98) or not (t <= 9.5e-66): tmp = (b * c) - (4.0 * (t * a)) else: tmp = (b * c) - (27.0 * (j * k)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -8e+98) || !(t <= 9.5e-66)) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); else tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); 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 <= -8e+98) || ~((t <= 9.5e-66)))
tmp = (b * c) - (4.0 * (t * a));
else
tmp = (b * c) - (27.0 * (j * k));
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, -8e+98], N[Not[LessEqual[t, 9.5e-66]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+98} \lor \neg \left(t \leq 9.5 \cdot 10^{-66}\right):\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if t < -7.99999999999999998e98 or 9.5000000000000004e-66 < t Initial program 79.4%
Taylor expanded in j around 0 72.2%
Taylor expanded in x around 0 54.5%
if -7.99999999999999998e98 < t < 9.5000000000000004e-66Initial program 85.3%
associate-*l*85.3%
associate--l+85.3%
distribute-rgt-out--85.3%
associate-*l*81.7%
associate-*l*81.7%
Simplified81.7%
Taylor expanded in t around 0 76.6%
Taylor expanded in i around 0 60.5%
Final simplification57.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 (<= t -6.8e+208)
(* t (* x (* 18.0 (* y z))))
(if (or (<= t -1.1e+99) (not (<= t 1.75e-60)))
(* t (* a -4.0))
(* 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 tmp;
if (t <= -6.8e+208) {
tmp = t * (x * (18.0 * (y * z)));
} else if ((t <= -1.1e+99) || !(t <= 1.75e-60)) {
tmp = t * (a * -4.0);
} else {
tmp = j * (k * -27.0);
}
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 <= (-6.8d+208)) then
tmp = t * (x * (18.0d0 * (y * z)))
else if ((t <= (-1.1d+99)) .or. (.not. (t <= 1.75d-60))) then
tmp = t * (a * (-4.0d0))
else
tmp = j * (k * (-27.0d0))
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 <= -6.8e+208) {
tmp = t * (x * (18.0 * (y * z)));
} else if ((t <= -1.1e+99) || !(t <= 1.75e-60)) {
tmp = t * (a * -4.0);
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if t <= -6.8e+208: tmp = t * (x * (18.0 * (y * z))) elif (t <= -1.1e+99) or not (t <= 1.75e-60): tmp = t * (a * -4.0) else: tmp = j * (k * -27.0) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (t <= -6.8e+208) tmp = Float64(t * Float64(x * Float64(18.0 * Float64(y * z)))); elseif ((t <= -1.1e+99) || !(t <= 1.75e-60)) tmp = Float64(t * Float64(a * -4.0)); else tmp = 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)
tmp = 0.0;
if (t <= -6.8e+208)
tmp = t * (x * (18.0 * (y * z)));
elseif ((t <= -1.1e+99) || ~((t <= 1.75e-60)))
tmp = t * (a * -4.0);
else
tmp = 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_] := If[LessEqual[t, -6.8e+208], N[(t * N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.1e+99], N[Not[LessEqual[t, 1.75e-60]], $MachinePrecision]], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{+208}:\\
\;\;\;\;t \cdot \left(x \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{+99} \lor \neg \left(t \leq 1.75 \cdot 10^{-60}\right):\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if t < -6.7999999999999997e208Initial program 64.3%
Taylor expanded in j around 0 61.0%
Taylor expanded in t around inf 79.5%
Taylor expanded in x around inf 51.1%
associate-*r*51.1%
*-commutative51.1%
associate-*l*51.1%
Simplified51.1%
if -6.7999999999999997e208 < t < -1.09999999999999989e99 or 1.74999999999999988e-60 < t Initial program 83.6%
Taylor expanded in j around 0 75.0%
Taylor expanded in t around inf 63.1%
Taylor expanded in x around 0 43.0%
*-commutative43.0%
Simplified43.0%
if -1.09999999999999989e99 < t < 1.74999999999999988e-60Initial program 85.5%
associate-*l*85.6%
associate--l+85.6%
distribute-rgt-out--85.6%
associate-*l*81.9%
associate-*l*81.9%
Simplified81.9%
associate-*r*85.6%
distribute-rgt-out--85.6%
associate-*l*92.5%
associate-*l*91.9%
*-commutative91.9%
Applied egg-rr91.9%
Taylor expanded in j around inf 34.2%
*-commutative34.2%
associate-*r*34.1%
Simplified34.1%
Final simplification39.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 (<= t -1.5e+99) (not (<= t 1.1e-59))) (* t (* a -4.0)) (* 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 tmp;
if ((t <= -1.5e+99) || !(t <= 1.1e-59)) {
tmp = t * (a * -4.0);
} else {
tmp = j * (k * -27.0);
}
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.5d+99)) .or. (.not. (t <= 1.1d-59))) then
tmp = t * (a * (-4.0d0))
else
tmp = j * (k * (-27.0d0))
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.5e+99) || !(t <= 1.1e-59)) {
tmp = t * (a * -4.0);
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (t <= -1.5e+99) or not (t <= 1.1e-59): tmp = t * (a * -4.0) else: tmp = j * (k * -27.0) 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.5e+99) || !(t <= 1.1e-59)) tmp = Float64(t * Float64(a * -4.0)); else tmp = 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)
tmp = 0.0;
if ((t <= -1.5e+99) || ~((t <= 1.1e-59)))
tmp = t * (a * -4.0);
else
tmp = 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_] := If[Or[LessEqual[t, -1.5e+99], N[Not[LessEqual[t, 1.1e-59]], $MachinePrecision]], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+99} \lor \neg \left(t \leq 1.1 \cdot 10^{-59}\right):\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if t < -1.50000000000000007e99 or 1.0999999999999999e-59 < t Initial program 79.1%
Taylor expanded in j around 0 71.7%
Taylor expanded in t around inf 66.9%
Taylor expanded in x around 0 41.0%
*-commutative41.0%
Simplified41.0%
if -1.50000000000000007e99 < t < 1.0999999999999999e-59Initial program 85.5%
associate-*l*85.6%
associate--l+85.6%
distribute-rgt-out--85.6%
associate-*l*81.9%
associate-*l*81.9%
Simplified81.9%
associate-*r*85.6%
distribute-rgt-out--85.6%
associate-*l*92.5%
associate-*l*91.9%
*-commutative91.9%
Applied egg-rr91.9%
Taylor expanded in j around inf 34.2%
*-commutative34.2%
associate-*r*34.1%
Simplified34.1%
Final simplification37.3%
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 (* (* 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) {
return (j * k) * -27.0;
}
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 = (j * k) * (-27.0d0)
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 (j * k) * -27.0;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): return (j * k) * -27.0
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(j * k) * -27.0) end
y, z = num2cell(sort([y, z])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = (j * k) * -27.0;
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[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\left(j \cdot k\right) \cdot -27
\end{array}
Initial program 82.5%
Simplified83.0%
Taylor expanded in k around inf 24.0%
Final simplification24.0%
(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 2023320
(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)))