
(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 23 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
(if (or (<= t -2.9e-65) (not (<= t 8e-156)))
(fma
(* j -27.0)
k
(fma t (fma x (* (* z 18.0) y) (* a -4.0)) (fma b c (* -4.0 (* x i)))))
(+ (fma x (fma -4.0 i (* t (* z (* 18.0 y)))) (* b c)) (* (* 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 ((t <= -2.9e-65) || !(t <= 8e-156)) {
tmp = fma((j * -27.0), k, fma(t, fma(x, ((z * 18.0) * y), (a * -4.0)), fma(b, c, (-4.0 * (x * i)))));
} else {
tmp = fma(x, fma(-4.0, i, (t * (z * (18.0 * y)))), (b * c)) + ((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 ((t <= -2.9e-65) || !(t <= 8e-156)) tmp = fma(Float64(j * -27.0), k, fma(t, fma(x, Float64(Float64(z * 18.0) * y), Float64(a * -4.0)), fma(b, c, Float64(-4.0 * Float64(x * i))))); else tmp = Float64(fma(x, fma(-4.0, i, Float64(t * Float64(z * Float64(18.0 * y)))), Float64(b * c)) + Float64(Float64(j * -27.0) * k)); end return tmp end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[t, -2.9e-65], N[Not[LessEqual[t, 8e-156]], $MachinePrecision]], N[(N[(j * -27.0), $MachinePrecision] * k + N[(t * N[(x * N[(N[(z * 18.0), $MachinePrecision] * y), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-4.0 * i + N[(t * N[(z * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] + N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-65} \lor \neg \left(t \leq 8 \cdot 10^{-156}\right):\\
\;\;\;\;\mathsf{fma}\left(j \cdot -27, k, \mathsf{fma}\left(t, \mathsf{fma}\left(x, \left(z \cdot 18\right) \cdot y, a \cdot -4\right), \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(z \cdot \left(18 \cdot y\right)\right)\right), b \cdot c\right) + \left(j \cdot -27\right) \cdot k\\
\end{array}
\end{array}
if t < -2.8999999999999998e-65 or 8.00000000000000032e-156 < t Initial program 84.8%
Simplified89.0%
+-commutative89.0%
*-commutative89.0%
fma-def91.9%
associate-*r*91.9%
associate-*r*91.9%
Applied egg-rr91.9%
if -2.8999999999999998e-65 < t < 8.00000000000000032e-156Initial program 76.9%
Simplified76.9%
Taylor expanded in a around 0 78.1%
Simplified89.6%
Final simplification91.2%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(-
(+ (* b c) (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))))
(* i (* x 4.0)))
(* k (* j 27.0)))))
(if (<= t_1 1e+299)
t_1
(fma -27.0 (* j k) (fma x (fma -4.0 i (* t (* z (* 18.0 y)))) (* b c))))))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) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0));
double tmp;
if (t_1 <= 1e+299) {
tmp = t_1;
} else {
tmp = fma(-27.0, (j * k), fma(x, fma(-4.0, i, (t * (z * (18.0 * y)))), (b * c)));
}
return tmp;
}
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(Float64(b * c) + Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0)))) - Float64(i * Float64(x * 4.0))) - Float64(k * Float64(j * 27.0))) tmp = 0.0 if (t_1 <= 1e+299) tmp = t_1; else tmp = fma(-27.0, Float64(j * k), fma(x, fma(-4.0, i, Float64(t * Float64(z * Float64(18.0 * y)))), Float64(b * c))); end return tmp end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+299], t$95$1, N[(-27.0 * N[(j * k), $MachinePrecision] + N[(x * N[(-4.0 * i + N[(t * N[(z * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(\left(b \cdot c + \left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right)\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t_1 \leq 10^{+299}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27, j \cdot k, \mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(z \cdot \left(18 \cdot y\right)\right)\right), b \cdot c\right)\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)) < 1.0000000000000001e299Initial program 95.7%
if 1.0000000000000001e299 < (-.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 59.0%
Simplified69.7%
Taylor expanded in a around 0 63.4%
Simplified79.2%
Final simplification89.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
(-
(-
(+ (* b c) (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))))
(* i (* x 4.0)))
(* k (* j 27.0)))))
(if (<= t_1 1e+299)
t_1
(- (* (* j -27.0) k) (* x (fma i 4.0 (* z (* y (* t -18.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 = (((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0));
double tmp;
if (t_1 <= 1e+299) {
tmp = t_1;
} else {
tmp = ((j * -27.0) * k) - (x * fma(i, 4.0, (z * (y * (t * -18.0)))));
}
return tmp;
}
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(Float64(b * c) + Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0)))) - Float64(i * Float64(x * 4.0))) - Float64(k * Float64(j * 27.0))) tmp = 0.0 if (t_1 <= 1e+299) tmp = t_1; else tmp = Float64(Float64(Float64(j * -27.0) * k) - Float64(x * fma(i, 4.0, Float64(z * Float64(y * Float64(t * -18.0)))))); end return tmp end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+299], t$95$1, N[(N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision] - N[(x * N[(i * 4.0 + N[(z * N[(y * N[(t * -18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(\left(b \cdot c + \left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right)\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t_1 \leq 10^{+299}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot -27\right) \cdot k - x \cdot \mathsf{fma}\left(i, 4, z \cdot \left(y \cdot \left(t \cdot -18\right)\right)\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)) < 1.0000000000000001e299Initial program 95.7%
if 1.0000000000000001e299 < (-.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 59.0%
Simplified69.7%
Taylor expanded in x around -inf 73.3%
mul-1-neg73.3%
metadata-eval73.3%
cancel-sign-sub-inv73.3%
*-commutative73.3%
distribute-rgt-neg-in73.3%
cancel-sign-sub-inv73.3%
metadata-eval73.3%
+-commutative73.3%
*-commutative73.3%
fma-def74.4%
associate-*r*74.4%
associate-*r*77.3%
*-commutative77.3%
Simplified77.3%
Final simplification88.9%
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 c) (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))))
(* i (* x 4.0)))
(* k (* j 27.0)))
INFINITY)
(-
(+ (* t (- (* (* x 18.0) (* z y)) (* a 4.0))) (- (* b c) (* x (* i 4.0))))
(* j (* k 27.0)))
(fma (* j -27.0) k (* (* t 18.0) (* x (* z y))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (((((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0))) <= ((double) INFINITY)) {
tmp = ((t * (((x * 18.0) * (z * y)) - (a * 4.0))) + ((b * c) - (x * (i * 4.0)))) - (j * (k * 27.0));
} else {
tmp = fma((j * -27.0), k, ((t * 18.0) * (x * (z * y))));
}
return tmp;
}
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(b * c) + Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0)))) - Float64(i * Float64(x * 4.0))) - Float64(k * Float64(j * 27.0))) <= Inf) tmp = Float64(Float64(Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(z * y)) - Float64(a * 4.0))) + Float64(Float64(b * c) - Float64(x * Float64(i * 4.0)))) - Float64(j * Float64(k * 27.0))); else tmp = fma(Float64(j * -27.0), k, Float64(Float64(t * 18.0) * Float64(x * Float64(z * y)))); end return tmp end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] - N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * -27.0), $MachinePrecision] * k + N[(N[(t * 18.0), $MachinePrecision] * N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(b \cdot c + \left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right)\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right) \leq \infty:\\
\;\;\;\;\left(t \cdot \left(\left(x \cdot 18\right) \cdot \left(z \cdot y\right) - a \cdot 4\right) + \left(b \cdot c - x \cdot \left(i \cdot 4\right)\right)\right) - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot -27, k, \left(t \cdot 18\right) \cdot \left(x \cdot \left(z \cdot y\right)\right)\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 93.2%
associate-*l*93.2%
associate--l+93.2%
distribute-rgt-out--93.2%
associate-*l*92.8%
associate-*l*92.8%
Simplified92.8%
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%
Simplified30.0%
Taylor expanded in z around inf 40.5%
+-commutative40.5%
*-commutative40.5%
fma-def50.5%
associate-*r*50.5%
*-commutative50.5%
Applied egg-rr50.5%
Final simplification87.9%
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 c) (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))))
(* i (* x 4.0)))
(* k (* j 27.0)))
INFINITY)
(-
(+ (* t (- (* (* x 18.0) (* z y)) (* a 4.0))) (- (* b c) (* x (* i 4.0))))
(* j (* k 27.0)))
(+ (* b c) (* t (- (* 18.0 (* x (* z y))) (* 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 tmp;
if (((((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0))) <= ((double) INFINITY)) {
tmp = ((t * (((x * 18.0) * (z * y)) - (a * 4.0))) + ((b * c) - (x * (i * 4.0)))) - (j * (k * 27.0));
} else {
tmp = (b * c) + (t * ((18.0 * (x * (z * y))) - (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 tmp;
if (((((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0))) <= Double.POSITIVE_INFINITY) {
tmp = ((t * (((x * 18.0) * (z * y)) - (a * 4.0))) + ((b * c) - (x * (i * 4.0)))) - (j * (k * 27.0));
} else {
tmp = (b * c) + (t * ((18.0 * (x * (z * y))) - (a * 4.0)));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if ((((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0))) <= math.inf: tmp = ((t * (((x * 18.0) * (z * y)) - (a * 4.0))) + ((b * c) - (x * (i * 4.0)))) - (j * (k * 27.0)) else: tmp = (b * c) + (t * ((18.0 * (x * (z * y))) - (a * 4.0))) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(b * c) + Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0)))) - Float64(i * Float64(x * 4.0))) - Float64(k * Float64(j * 27.0))) <= Inf) tmp = Float64(Float64(Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(z * y)) - Float64(a * 4.0))) + Float64(Float64(b * c) - Float64(x * Float64(i * 4.0)))) - Float64(j * Float64(k * 27.0))); else tmp = Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(z * y))) - 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)
tmp = 0.0;
if (((((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0))) <= Inf)
tmp = ((t * (((x * 18.0) * (z * y)) - (a * 4.0))) + ((b * c) - (x * (i * 4.0)))) - (j * (k * 27.0));
else
tmp = (b * c) + (t * ((18.0 * (x * (z * y))) - (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_] := If[LessEqual[N[(N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] - N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(b \cdot c + \left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right)\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right) \leq \infty:\\
\;\;\;\;\left(t \cdot \left(\left(x \cdot 18\right) \cdot \left(z \cdot y\right) - a \cdot 4\right) + \left(b \cdot c - x \cdot \left(i \cdot 4\right)\right)\right) - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(z \cdot y\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 93.2%
associate-*l*93.2%
associate--l+93.2%
distribute-rgt-out--93.2%
associate-*l*92.8%
associate-*l*92.8%
Simplified92.8%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) Initial program 0.0%
associate-*l*0.0%
associate--l+0.0%
distribute-rgt-out--13.3%
associate-*l*13.3%
associate-*l*13.3%
Simplified13.3%
Taylor expanded in i around 0 33.3%
Taylor expanded in j around 0 43.3%
Final simplification87.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 (+ t_1 (* 18.0 (* t (* x (* z y)))))))
(if (<= (* b c) -8e+30)
(- (* b c) (* 4.0 (* x i)))
(if (<= (* b c) -3.3e-168)
t_2
(if (<= (* b c) 5.2e-282)
(+ t_1 (* x (* -4.0 i)))
(if (<= (* b c) 1.85e+40) t_2 (- (* 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 t_1 = (j * -27.0) * k;
double t_2 = t_1 + (18.0 * (t * (x * (z * y))));
double tmp;
if ((b * c) <= -8e+30) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= -3.3e-168) {
tmp = t_2;
} else if ((b * c) <= 5.2e-282) {
tmp = t_1 + (x * (-4.0 * i));
} else if ((b * c) <= 1.85e+40) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (j * (-27.0d0)) * k
t_2 = t_1 + (18.0d0 * (t * (x * (z * y))))
if ((b * c) <= (-8d+30)) then
tmp = (b * c) - (4.0d0 * (x * i))
else if ((b * c) <= (-3.3d-168)) then
tmp = t_2
else if ((b * c) <= 5.2d-282) then
tmp = t_1 + (x * ((-4.0d0) * i))
else if ((b * c) <= 1.85d+40) then
tmp = t_2
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 t_1 = (j * -27.0) * k;
double t_2 = t_1 + (18.0 * (t * (x * (z * y))));
double tmp;
if ((b * c) <= -8e+30) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= -3.3e-168) {
tmp = t_2;
} else if ((b * c) <= 5.2e-282) {
tmp = t_1 + (x * (-4.0 * i));
} else if ((b * c) <= 1.85e+40) {
tmp = t_2;
} 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): t_1 = (j * -27.0) * k t_2 = t_1 + (18.0 * (t * (x * (z * y)))) tmp = 0 if (b * c) <= -8e+30: tmp = (b * c) - (4.0 * (x * i)) elif (b * c) <= -3.3e-168: tmp = t_2 elif (b * c) <= 5.2e-282: tmp = t_1 + (x * (-4.0 * i)) elif (b * c) <= 1.85e+40: tmp = t_2 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) t_1 = Float64(Float64(j * -27.0) * k) t_2 = Float64(t_1 + Float64(18.0 * Float64(t * Float64(x * Float64(z * y))))) tmp = 0.0 if (Float64(b * c) <= -8e+30) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (Float64(b * c) <= -3.3e-168) tmp = t_2; elseif (Float64(b * c) <= 5.2e-282) tmp = Float64(t_1 + Float64(x * Float64(-4.0 * i))); elseif (Float64(b * c) <= 1.85e+40) tmp = t_2; 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)
t_1 = (j * -27.0) * k;
t_2 = t_1 + (18.0 * (t * (x * (z * y))));
tmp = 0.0;
if ((b * c) <= -8e+30)
tmp = (b * c) - (4.0 * (x * i));
elseif ((b * c) <= -3.3e-168)
tmp = t_2;
elseif ((b * c) <= 5.2e-282)
tmp = t_1 + (x * (-4.0 * i));
elseif ((b * c) <= 1.85e+40)
tmp = t_2;
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_] := Block[{t$95$1 = N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(18.0 * N[(t * N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -8e+30], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -3.3e-168], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], 5.2e-282], N[(t$95$1 + N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.85e+40], t$95$2, 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}
t_1 := \left(j \cdot -27\right) \cdot k\\
t_2 := t_1 + 18 \cdot \left(t \cdot \left(x \cdot \left(z \cdot y\right)\right)\right)\\
\mathbf{if}\;b \cdot c \leq -8 \cdot 10^{+30}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq -3.3 \cdot 10^{-168}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot c \leq 5.2 \cdot 10^{-282}:\\
\;\;\;\;t_1 + x \cdot \left(-4 \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 1.85 \cdot 10^{+40}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -8.0000000000000002e30Initial program 75.4%
associate-*l*75.5%
associate--l+75.5%
distribute-rgt-out--75.5%
associate-*l*74.2%
associate-*l*74.2%
Simplified74.2%
Taylor expanded in t around 0 71.3%
Taylor expanded in j around 0 66.9%
if -8.0000000000000002e30 < (*.f64 b c) < -3.3000000000000001e-168 or 5.20000000000000025e-282 < (*.f64 b c) < 1.85e40Initial program 83.5%
Simplified86.9%
Taylor expanded in z around inf 65.6%
if -3.3000000000000001e-168 < (*.f64 b c) < 5.20000000000000025e-282Initial program 87.7%
Simplified88.1%
Taylor expanded in i around inf 58.9%
associate-*r*58.9%
*-commutative58.9%
Simplified58.9%
if 1.85e40 < (*.f64 b c) Initial program 84.2%
associate-*l*84.1%
associate--l+84.1%
distribute-rgt-out--86.1%
associate-*l*86.1%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in i around 0 77.7%
Taylor expanded in t around 0 57.8%
Final simplification63.2%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j -27.0) k)))
(if (<= (* b c) -5.9e+32)
(- (* b c) (* 4.0 (* x i)))
(if (<= (* b c) -1.85e-167)
(+ t_1 (* 18.0 (* t (* y (* x z)))))
(if (<= (* b c) 2.75e-283)
(+ t_1 (* x (* -4.0 i)))
(if (<= (* b c) 1.05e+40)
(+ t_1 (* 18.0 (* t (* x (* z y)))))
(- (* 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 t_1 = (j * -27.0) * k;
double tmp;
if ((b * c) <= -5.9e+32) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= -1.85e-167) {
tmp = t_1 + (18.0 * (t * (y * (x * z))));
} else if ((b * c) <= 2.75e-283) {
tmp = t_1 + (x * (-4.0 * i));
} else if ((b * c) <= 1.05e+40) {
tmp = t_1 + (18.0 * (t * (x * (z * y))));
} 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) :: t_1
real(8) :: tmp
t_1 = (j * (-27.0d0)) * k
if ((b * c) <= (-5.9d+32)) then
tmp = (b * c) - (4.0d0 * (x * i))
else if ((b * c) <= (-1.85d-167)) then
tmp = t_1 + (18.0d0 * (t * (y * (x * z))))
else if ((b * c) <= 2.75d-283) then
tmp = t_1 + (x * ((-4.0d0) * i))
else if ((b * c) <= 1.05d+40) then
tmp = t_1 + (18.0d0 * (t * (x * (z * y))))
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 t_1 = (j * -27.0) * k;
double tmp;
if ((b * c) <= -5.9e+32) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= -1.85e-167) {
tmp = t_1 + (18.0 * (t * (y * (x * z))));
} else if ((b * c) <= 2.75e-283) {
tmp = t_1 + (x * (-4.0 * i));
} else if ((b * c) <= 1.05e+40) {
tmp = t_1 + (18.0 * (t * (x * (z * y))));
} 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): t_1 = (j * -27.0) * k tmp = 0 if (b * c) <= -5.9e+32: tmp = (b * c) - (4.0 * (x * i)) elif (b * c) <= -1.85e-167: tmp = t_1 + (18.0 * (t * (y * (x * z)))) elif (b * c) <= 2.75e-283: tmp = t_1 + (x * (-4.0 * i)) elif (b * c) <= 1.05e+40: tmp = t_1 + (18.0 * (t * (x * (z * y)))) 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) t_1 = Float64(Float64(j * -27.0) * k) tmp = 0.0 if (Float64(b * c) <= -5.9e+32) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (Float64(b * c) <= -1.85e-167) tmp = Float64(t_1 + Float64(18.0 * Float64(t * Float64(y * Float64(x * z))))); elseif (Float64(b * c) <= 2.75e-283) tmp = Float64(t_1 + Float64(x * Float64(-4.0 * i))); elseif (Float64(b * c) <= 1.05e+40) tmp = Float64(t_1 + Float64(18.0 * Float64(t * Float64(x * Float64(z * y))))); 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)
t_1 = (j * -27.0) * k;
tmp = 0.0;
if ((b * c) <= -5.9e+32)
tmp = (b * c) - (4.0 * (x * i));
elseif ((b * c) <= -1.85e-167)
tmp = t_1 + (18.0 * (t * (y * (x * z))));
elseif ((b * c) <= 2.75e-283)
tmp = t_1 + (x * (-4.0 * i));
elseif ((b * c) <= 1.05e+40)
tmp = t_1 + (18.0 * (t * (x * (z * y))));
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_] := Block[{t$95$1 = N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -5.9e+32], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.85e-167], N[(t$95$1 + N[(18.0 * N[(t * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.75e-283], N[(t$95$1 + N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.05e+40], N[(t$95$1 + N[(18.0 * N[(t * N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision]), $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}
t_1 := \left(j \cdot -27\right) \cdot k\\
\mathbf{if}\;b \cdot c \leq -5.9 \cdot 10^{+32}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq -1.85 \cdot 10^{-167}:\\
\;\;\;\;t_1 + 18 \cdot \left(t \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 2.75 \cdot 10^{-283}:\\
\;\;\;\;t_1 + x \cdot \left(-4 \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 1.05 \cdot 10^{+40}:\\
\;\;\;\;t_1 + 18 \cdot \left(t \cdot \left(x \cdot \left(z \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -5.89999999999999965e32Initial program 75.4%
associate-*l*75.5%
associate--l+75.5%
distribute-rgt-out--75.5%
associate-*l*74.2%
associate-*l*74.2%
Simplified74.2%
Taylor expanded in t around 0 71.3%
Taylor expanded in j around 0 66.9%
if -5.89999999999999965e32 < (*.f64 b c) < -1.8500000000000001e-167Initial program 83.0%
Simplified87.9%
Taylor expanded in z around inf 62.7%
expm1-log1p-u47.6%
expm1-udef46.8%
*-commutative46.8%
Applied egg-rr46.8%
expm1-def47.6%
expm1-log1p62.7%
associate-*r*62.6%
Simplified62.6%
if -1.8500000000000001e-167 < (*.f64 b c) < 2.74999999999999976e-283Initial program 87.7%
Simplified88.1%
Taylor expanded in i around inf 58.9%
associate-*r*58.9%
*-commutative58.9%
Simplified58.9%
if 2.74999999999999976e-283 < (*.f64 b c) < 1.05000000000000005e40Initial program 84.0%
Simplified86.1%
Taylor expanded in z around inf 68.1%
if 1.05000000000000005e40 < (*.f64 b c) Initial program 84.2%
associate-*l*84.1%
associate--l+84.1%
distribute-rgt-out--86.1%
associate-*l*86.1%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in i around 0 77.7%
Taylor expanded in t around 0 57.8%
Final simplification63.2%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j -27.0) k)) (t_2 (+ t_1 (* 18.0 (* x (* t (* z y)))))))
(if (<= (* b c) -4.2e+32)
(- (* b c) (* 4.0 (* x i)))
(if (<= (* b c) -2.7e-166)
t_2
(if (<= (* b c) 4.3e-308)
(+ t_1 (* x (* -4.0 i)))
(if (<= (* b c) 2.85e+107) t_2 (+ (* b c) 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 = t_1 + (18.0 * (x * (t * (z * y))));
double tmp;
if ((b * c) <= -4.2e+32) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= -2.7e-166) {
tmp = t_2;
} else if ((b * c) <= 4.3e-308) {
tmp = t_1 + (x * (-4.0 * i));
} else if ((b * c) <= 2.85e+107) {
tmp = t_2;
} else {
tmp = (b * c) + 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 = t_1 + (18.0d0 * (x * (t * (z * y))))
if ((b * c) <= (-4.2d+32)) then
tmp = (b * c) - (4.0d0 * (x * i))
else if ((b * c) <= (-2.7d-166)) then
tmp = t_2
else if ((b * c) <= 4.3d-308) then
tmp = t_1 + (x * ((-4.0d0) * i))
else if ((b * c) <= 2.85d+107) then
tmp = t_2
else
tmp = (b * c) + 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 = t_1 + (18.0 * (x * (t * (z * y))));
double tmp;
if ((b * c) <= -4.2e+32) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= -2.7e-166) {
tmp = t_2;
} else if ((b * c) <= 4.3e-308) {
tmp = t_1 + (x * (-4.0 * i));
} else if ((b * c) <= 2.85e+107) {
tmp = t_2;
} else {
tmp = (b * c) + 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 = t_1 + (18.0 * (x * (t * (z * y)))) tmp = 0 if (b * c) <= -4.2e+32: tmp = (b * c) - (4.0 * (x * i)) elif (b * c) <= -2.7e-166: tmp = t_2 elif (b * c) <= 4.3e-308: tmp = t_1 + (x * (-4.0 * i)) elif (b * c) <= 2.85e+107: tmp = t_2 else: tmp = (b * c) + t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * -27.0) * k) t_2 = Float64(t_1 + Float64(18.0 * Float64(x * Float64(t * Float64(z * y))))) tmp = 0.0 if (Float64(b * c) <= -4.2e+32) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (Float64(b * c) <= -2.7e-166) tmp = t_2; elseif (Float64(b * c) <= 4.3e-308) tmp = Float64(t_1 + Float64(x * Float64(-4.0 * i))); elseif (Float64(b * c) <= 2.85e+107) tmp = t_2; else tmp = Float64(Float64(b * c) + 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 = t_1 + (18.0 * (x * (t * (z * y))));
tmp = 0.0;
if ((b * c) <= -4.2e+32)
tmp = (b * c) - (4.0 * (x * i));
elseif ((b * c) <= -2.7e-166)
tmp = t_2;
elseif ((b * c) <= 4.3e-308)
tmp = t_1 + (x * (-4.0 * i));
elseif ((b * c) <= 2.85e+107)
tmp = t_2;
else
tmp = (b * c) + t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(18.0 * N[(x * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -4.2e+32], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -2.7e-166], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], 4.3e-308], N[(t$95$1 + N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.85e+107], t$95$2, N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot -27\right) \cdot k\\
t_2 := t_1 + 18 \cdot \left(x \cdot \left(t \cdot \left(z \cdot y\right)\right)\right)\\
\mathbf{if}\;b \cdot c \leq -4.2 \cdot 10^{+32}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq -2.7 \cdot 10^{-166}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot c \leq 4.3 \cdot 10^{-308}:\\
\;\;\;\;t_1 + x \cdot \left(-4 \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 2.85 \cdot 10^{+107}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t_1\\
\end{array}
\end{array}
if (*.f64 b c) < -4.2000000000000001e32Initial program 75.4%
associate-*l*75.5%
associate--l+75.5%
distribute-rgt-out--75.5%
associate-*l*74.2%
associate-*l*74.2%
Simplified74.2%
Taylor expanded in t around 0 71.3%
Taylor expanded in j around 0 66.9%
if -4.2000000000000001e32 < (*.f64 b c) < -2.70000000000000006e-166 or 4.3000000000000002e-308 < (*.f64 b c) < 2.84999999999999986e107Initial program 83.0%
Simplified86.7%
Taylor expanded in z around inf 60.4%
expm1-log1p-u44.2%
expm1-udef43.9%
*-commutative43.9%
Applied egg-rr43.9%
expm1-def44.2%
expm1-log1p60.4%
*-commutative60.4%
associate-*l*63.9%
*-commutative63.9%
*-commutative63.9%
Simplified63.9%
if -2.70000000000000006e-166 < (*.f64 b c) < 4.3000000000000002e-308Initial program 88.8%
Simplified89.2%
Taylor expanded in i around inf 59.4%
associate-*r*59.4%
*-commutative59.4%
Simplified59.4%
if 2.84999999999999986e107 < (*.f64 b c) Initial program 85.2%
Simplified91.1%
Taylor expanded in b around inf 67.7%
Final simplification64.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 (* (* j -27.0) k)))
(if (<= (* b c) -5.2e+32)
(- (* b c) (* 4.0 (* x i)))
(if (<= (* b c) -1.7e-166)
(+ t_1 (* 18.0 (* x (* y (* t z)))))
(if (<= (* b c) 1.26e-307)
(+ t_1 (* x (* -4.0 i)))
(if (<= (* b c) 1.75e+107)
(+ t_1 (* 18.0 (* x (* t (* z y)))))
(+ (* b c) 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 ((b * c) <= -5.2e+32) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= -1.7e-166) {
tmp = t_1 + (18.0 * (x * (y * (t * z))));
} else if ((b * c) <= 1.26e-307) {
tmp = t_1 + (x * (-4.0 * i));
} else if ((b * c) <= 1.75e+107) {
tmp = t_1 + (18.0 * (x * (t * (z * y))));
} else {
tmp = (b * c) + 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 ((b * c) <= (-5.2d+32)) then
tmp = (b * c) - (4.0d0 * (x * i))
else if ((b * c) <= (-1.7d-166)) then
tmp = t_1 + (18.0d0 * (x * (y * (t * z))))
else if ((b * c) <= 1.26d-307) then
tmp = t_1 + (x * ((-4.0d0) * i))
else if ((b * c) <= 1.75d+107) then
tmp = t_1 + (18.0d0 * (x * (t * (z * y))))
else
tmp = (b * c) + 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 ((b * c) <= -5.2e+32) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= -1.7e-166) {
tmp = t_1 + (18.0 * (x * (y * (t * z))));
} else if ((b * c) <= 1.26e-307) {
tmp = t_1 + (x * (-4.0 * i));
} else if ((b * c) <= 1.75e+107) {
tmp = t_1 + (18.0 * (x * (t * (z * y))));
} else {
tmp = (b * c) + 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 (b * c) <= -5.2e+32: tmp = (b * c) - (4.0 * (x * i)) elif (b * c) <= -1.7e-166: tmp = t_1 + (18.0 * (x * (y * (t * z)))) elif (b * c) <= 1.26e-307: tmp = t_1 + (x * (-4.0 * i)) elif (b * c) <= 1.75e+107: tmp = t_1 + (18.0 * (x * (t * (z * y)))) else: tmp = (b * c) + t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * -27.0) * k) tmp = 0.0 if (Float64(b * c) <= -5.2e+32) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (Float64(b * c) <= -1.7e-166) tmp = Float64(t_1 + Float64(18.0 * Float64(x * Float64(y * Float64(t * z))))); elseif (Float64(b * c) <= 1.26e-307) tmp = Float64(t_1 + Float64(x * Float64(-4.0 * i))); elseif (Float64(b * c) <= 1.75e+107) tmp = Float64(t_1 + Float64(18.0 * Float64(x * Float64(t * Float64(z * y))))); else tmp = Float64(Float64(b * c) + 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 ((b * c) <= -5.2e+32)
tmp = (b * c) - (4.0 * (x * i));
elseif ((b * c) <= -1.7e-166)
tmp = t_1 + (18.0 * (x * (y * (t * z))));
elseif ((b * c) <= 1.26e-307)
tmp = t_1 + (x * (-4.0 * i));
elseif ((b * c) <= 1.75e+107)
tmp = t_1 + (18.0 * (x * (t * (z * y))));
else
tmp = (b * c) + t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -5.2e+32], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.7e-166], N[(t$95$1 + N[(18.0 * N[(x * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.26e-307], N[(t$95$1 + N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.75e+107], N[(t$95$1 + N[(18.0 * N[(x * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot -27\right) \cdot k\\
\mathbf{if}\;b \cdot c \leq -5.2 \cdot 10^{+32}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq -1.7 \cdot 10^{-166}:\\
\;\;\;\;t_1 + 18 \cdot \left(x \cdot \left(y \cdot \left(t \cdot z\right)\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 1.26 \cdot 10^{-307}:\\
\;\;\;\;t_1 + x \cdot \left(-4 \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 1.75 \cdot 10^{+107}:\\
\;\;\;\;t_1 + 18 \cdot \left(x \cdot \left(t \cdot \left(z \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t_1\\
\end{array}
\end{array}
if (*.f64 b c) < -5.2000000000000004e32Initial program 75.4%
associate-*l*75.5%
associate--l+75.5%
distribute-rgt-out--75.5%
associate-*l*74.2%
associate-*l*74.2%
Simplified74.2%
Taylor expanded in t around 0 71.3%
Taylor expanded in j around 0 66.9%
if -5.2000000000000004e32 < (*.f64 b c) < -1.6999999999999999e-166Initial program 83.0%
Simplified87.9%
Taylor expanded in z around inf 62.7%
expm1-log1p-u47.6%
expm1-udef46.8%
*-commutative46.8%
Applied egg-rr46.8%
expm1-def47.6%
expm1-log1p62.7%
*-commutative62.7%
associate-*l*62.8%
*-commutative62.8%
*-commutative62.8%
Simplified62.8%
expm1-log1p-u48.1%
expm1-udef47.6%
associate-*r*49.8%
Applied egg-rr49.8%
expm1-def50.2%
expm1-log1p65.0%
*-commutative65.0%
associate-*r*65.1%
Simplified65.1%
if -1.6999999999999999e-166 < (*.f64 b c) < 1.2599999999999999e-307Initial program 88.8%
Simplified89.2%
Taylor expanded in i around inf 59.4%
associate-*r*59.4%
*-commutative59.4%
Simplified59.4%
if 1.2599999999999999e-307 < (*.f64 b c) < 1.7499999999999999e107Initial program 83.0%
Simplified86.0%
Taylor expanded in z around inf 59.1%
expm1-log1p-u42.2%
expm1-udef42.2%
*-commutative42.2%
Applied egg-rr42.2%
expm1-def42.2%
expm1-log1p59.1%
*-commutative59.1%
associate-*l*64.6%
*-commutative64.6%
*-commutative64.6%
Simplified64.6%
if 1.7499999999999999e107 < (*.f64 b c) Initial program 85.2%
Simplified91.1%
Taylor expanded in b around inf 67.7%
Final simplification64.8%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j -27.0) k)))
(if (<= (* b c) -6.2e+32)
(- (* b c) (* 4.0 (* x i)))
(if (<= (* b c) -3e-166)
(+ t_1 (* 18.0 (* (* x z) (* t y))))
(if (<= (* b c) 3.2e-308)
(+ t_1 (* x (* -4.0 i)))
(if (<= (* b c) 4.2e+106)
(+ t_1 (* 18.0 (* x (* t (* z y)))))
(+ (* b c) 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 ((b * c) <= -6.2e+32) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= -3e-166) {
tmp = t_1 + (18.0 * ((x * z) * (t * y)));
} else if ((b * c) <= 3.2e-308) {
tmp = t_1 + (x * (-4.0 * i));
} else if ((b * c) <= 4.2e+106) {
tmp = t_1 + (18.0 * (x * (t * (z * y))));
} else {
tmp = (b * c) + 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 ((b * c) <= (-6.2d+32)) then
tmp = (b * c) - (4.0d0 * (x * i))
else if ((b * c) <= (-3d-166)) then
tmp = t_1 + (18.0d0 * ((x * z) * (t * y)))
else if ((b * c) <= 3.2d-308) then
tmp = t_1 + (x * ((-4.0d0) * i))
else if ((b * c) <= 4.2d+106) then
tmp = t_1 + (18.0d0 * (x * (t * (z * y))))
else
tmp = (b * c) + 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 ((b * c) <= -6.2e+32) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= -3e-166) {
tmp = t_1 + (18.0 * ((x * z) * (t * y)));
} else if ((b * c) <= 3.2e-308) {
tmp = t_1 + (x * (-4.0 * i));
} else if ((b * c) <= 4.2e+106) {
tmp = t_1 + (18.0 * (x * (t * (z * y))));
} else {
tmp = (b * c) + 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 (b * c) <= -6.2e+32: tmp = (b * c) - (4.0 * (x * i)) elif (b * c) <= -3e-166: tmp = t_1 + (18.0 * ((x * z) * (t * y))) elif (b * c) <= 3.2e-308: tmp = t_1 + (x * (-4.0 * i)) elif (b * c) <= 4.2e+106: tmp = t_1 + (18.0 * (x * (t * (z * y)))) else: tmp = (b * c) + t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * -27.0) * k) tmp = 0.0 if (Float64(b * c) <= -6.2e+32) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (Float64(b * c) <= -3e-166) tmp = Float64(t_1 + Float64(18.0 * Float64(Float64(x * z) * Float64(t * y)))); elseif (Float64(b * c) <= 3.2e-308) tmp = Float64(t_1 + Float64(x * Float64(-4.0 * i))); elseif (Float64(b * c) <= 4.2e+106) tmp = Float64(t_1 + Float64(18.0 * Float64(x * Float64(t * Float64(z * y))))); else tmp = Float64(Float64(b * c) + 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 ((b * c) <= -6.2e+32)
tmp = (b * c) - (4.0 * (x * i));
elseif ((b * c) <= -3e-166)
tmp = t_1 + (18.0 * ((x * z) * (t * y)));
elseif ((b * c) <= 3.2e-308)
tmp = t_1 + (x * (-4.0 * i));
elseif ((b * c) <= 4.2e+106)
tmp = t_1 + (18.0 * (x * (t * (z * y))));
else
tmp = (b * c) + t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -6.2e+32], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -3e-166], N[(t$95$1 + N[(18.0 * N[(N[(x * z), $MachinePrecision] * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3.2e-308], N[(t$95$1 + N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 4.2e+106], N[(t$95$1 + N[(18.0 * N[(x * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot -27\right) \cdot k\\
\mathbf{if}\;b \cdot c \leq -6.2 \cdot 10^{+32}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq -3 \cdot 10^{-166}:\\
\;\;\;\;t_1 + 18 \cdot \left(\left(x \cdot z\right) \cdot \left(t \cdot y\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 3.2 \cdot 10^{-308}:\\
\;\;\;\;t_1 + x \cdot \left(-4 \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 4.2 \cdot 10^{+106}:\\
\;\;\;\;t_1 + 18 \cdot \left(x \cdot \left(t \cdot \left(z \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t_1\\
\end{array}
\end{array}
if (*.f64 b c) < -6.19999999999999986e32Initial program 75.4%
associate-*l*75.5%
associate--l+75.5%
distribute-rgt-out--75.5%
associate-*l*74.2%
associate-*l*74.2%
Simplified74.2%
Taylor expanded in t around 0 71.3%
Taylor expanded in j around 0 66.9%
if -6.19999999999999986e32 < (*.f64 b c) < -3.0000000000000003e-166Initial program 83.0%
Simplified87.9%
Taylor expanded in z around inf 62.7%
expm1-log1p-u47.6%
expm1-udef46.8%
*-commutative46.8%
Applied egg-rr46.8%
expm1-def47.6%
expm1-log1p62.7%
associate-*r*62.6%
Simplified62.6%
Taylor expanded in t around 0 62.7%
*-commutative62.7%
associate-*r*62.6%
associate-*l*67.3%
*-commutative67.3%
associate-*l*64.9%
Simplified64.9%
if -3.0000000000000003e-166 < (*.f64 b c) < 3.2000000000000001e-308Initial program 88.8%
Simplified89.2%
Taylor expanded in i around inf 59.4%
associate-*r*59.4%
*-commutative59.4%
Simplified59.4%
if 3.2000000000000001e-308 < (*.f64 b c) < 4.2000000000000001e106Initial program 83.0%
Simplified86.0%
Taylor expanded in z around inf 59.1%
expm1-log1p-u42.2%
expm1-udef42.2%
*-commutative42.2%
Applied egg-rr42.2%
expm1-def42.2%
expm1-log1p59.1%
*-commutative59.1%
associate-*l*64.6%
*-commutative64.6%
*-commutative64.6%
Simplified64.6%
if 4.2000000000000001e106 < (*.f64 b c) Initial program 85.2%
Simplified91.1%
Taylor expanded in b around inf 67.7%
Final simplification64.8%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j -27.0) k)))
(if (<= (* b c) -1e+32)
(- (* b c) (* 4.0 (* x i)))
(if (<= (* b c) -1.6e-167)
(+ t_1 (* 18.0 (* (* x z) (* t y))))
(if (<= (* b c) 8.5e-306)
(+ t_1 (* x (* -4.0 i)))
(if (<= (* b c) 1.06e+107)
(+ t_1 (* x (* t (* z (* 18.0 y)))))
(+ (* b c) 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 ((b * c) <= -1e+32) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= -1.6e-167) {
tmp = t_1 + (18.0 * ((x * z) * (t * y)));
} else if ((b * c) <= 8.5e-306) {
tmp = t_1 + (x * (-4.0 * i));
} else if ((b * c) <= 1.06e+107) {
tmp = t_1 + (x * (t * (z * (18.0 * y))));
} else {
tmp = (b * c) + 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 ((b * c) <= (-1d+32)) then
tmp = (b * c) - (4.0d0 * (x * i))
else if ((b * c) <= (-1.6d-167)) then
tmp = t_1 + (18.0d0 * ((x * z) * (t * y)))
else if ((b * c) <= 8.5d-306) then
tmp = t_1 + (x * ((-4.0d0) * i))
else if ((b * c) <= 1.06d+107) then
tmp = t_1 + (x * (t * (z * (18.0d0 * y))))
else
tmp = (b * c) + 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 ((b * c) <= -1e+32) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= -1.6e-167) {
tmp = t_1 + (18.0 * ((x * z) * (t * y)));
} else if ((b * c) <= 8.5e-306) {
tmp = t_1 + (x * (-4.0 * i));
} else if ((b * c) <= 1.06e+107) {
tmp = t_1 + (x * (t * (z * (18.0 * y))));
} else {
tmp = (b * c) + 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 (b * c) <= -1e+32: tmp = (b * c) - (4.0 * (x * i)) elif (b * c) <= -1.6e-167: tmp = t_1 + (18.0 * ((x * z) * (t * y))) elif (b * c) <= 8.5e-306: tmp = t_1 + (x * (-4.0 * i)) elif (b * c) <= 1.06e+107: tmp = t_1 + (x * (t * (z * (18.0 * y)))) else: tmp = (b * c) + t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * -27.0) * k) tmp = 0.0 if (Float64(b * c) <= -1e+32) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (Float64(b * c) <= -1.6e-167) tmp = Float64(t_1 + Float64(18.0 * Float64(Float64(x * z) * Float64(t * y)))); elseif (Float64(b * c) <= 8.5e-306) tmp = Float64(t_1 + Float64(x * Float64(-4.0 * i))); elseif (Float64(b * c) <= 1.06e+107) tmp = Float64(t_1 + Float64(x * Float64(t * Float64(z * Float64(18.0 * y))))); else tmp = Float64(Float64(b * c) + 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 ((b * c) <= -1e+32)
tmp = (b * c) - (4.0 * (x * i));
elseif ((b * c) <= -1.6e-167)
tmp = t_1 + (18.0 * ((x * z) * (t * y)));
elseif ((b * c) <= 8.5e-306)
tmp = t_1 + (x * (-4.0 * i));
elseif ((b * c) <= 1.06e+107)
tmp = t_1 + (x * (t * (z * (18.0 * y))));
else
tmp = (b * c) + t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1e+32], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.6e-167], N[(t$95$1 + N[(18.0 * N[(N[(x * z), $MachinePrecision] * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 8.5e-306], N[(t$95$1 + N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.06e+107], N[(t$95$1 + N[(x * N[(t * N[(z * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot -27\right) \cdot k\\
\mathbf{if}\;b \cdot c \leq -1 \cdot 10^{+32}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq -1.6 \cdot 10^{-167}:\\
\;\;\;\;t_1 + 18 \cdot \left(\left(x \cdot z\right) \cdot \left(t \cdot y\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 8.5 \cdot 10^{-306}:\\
\;\;\;\;t_1 + x \cdot \left(-4 \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 1.06 \cdot 10^{+107}:\\
\;\;\;\;t_1 + x \cdot \left(t \cdot \left(z \cdot \left(18 \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t_1\\
\end{array}
\end{array}
if (*.f64 b c) < -1.00000000000000005e32Initial program 75.4%
associate-*l*75.5%
associate--l+75.5%
distribute-rgt-out--75.5%
associate-*l*74.2%
associate-*l*74.2%
Simplified74.2%
Taylor expanded in t around 0 71.3%
Taylor expanded in j around 0 66.9%
if -1.00000000000000005e32 < (*.f64 b c) < -1.6000000000000001e-167Initial program 83.0%
Simplified87.9%
Taylor expanded in z around inf 62.7%
expm1-log1p-u47.6%
expm1-udef46.8%
*-commutative46.8%
Applied egg-rr46.8%
expm1-def47.6%
expm1-log1p62.7%
associate-*r*62.6%
Simplified62.6%
Taylor expanded in t around 0 62.7%
*-commutative62.7%
associate-*r*62.6%
associate-*l*67.3%
*-commutative67.3%
associate-*l*64.9%
Simplified64.9%
if -1.6000000000000001e-167 < (*.f64 b c) < 8.5000000000000002e-306Initial program 88.8%
Simplified89.2%
Taylor expanded in i around inf 59.4%
associate-*r*59.4%
*-commutative59.4%
Simplified59.4%
if 8.5000000000000002e-306 < (*.f64 b c) < 1.06e107Initial program 83.0%
Simplified86.0%
Taylor expanded in z around inf 59.1%
*-commutative59.1%
associate-*r*64.6%
associate-*l*64.6%
*-commutative64.6%
*-commutative64.6%
associate-*l*64.6%
associate-*r*64.6%
*-commutative64.6%
associate-*l*63.2%
Simplified63.2%
if 1.06e107 < (*.f64 b c) Initial program 85.2%
Simplified91.1%
Taylor expanded in b around inf 67.7%
Final simplification64.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 (+ t_1 (* x (* -4.0 i)))))
(if (<= x -1.45e+252)
(+ t_1 (* (* t 18.0) (* z (* x y))))
(if (<= x -1.4e+214)
(- (* b c) (* 4.0 (* x i)))
(if (<= x -2.9e+191)
(+ t_1 (* 18.0 (* x (* t (* z y)))))
(if (<= x -8.5e+80)
t_2
(if (<= x 1.1e+56)
(- (- (* b c) (* 4.0 (* t a))) (* k (* j 27.0)))
(if (<= x 1.7e+232)
(+ t_1 (* x (* t (* z (* 18.0 y)))))
(if (<= x 4.9e+287)
t_2
(+ t_1 (* 18.0 (* t (* x (* z y))))))))))))))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 = t_1 + (x * (-4.0 * i));
double tmp;
if (x <= -1.45e+252) {
tmp = t_1 + ((t * 18.0) * (z * (x * y)));
} else if (x <= -1.4e+214) {
tmp = (b * c) - (4.0 * (x * i));
} else if (x <= -2.9e+191) {
tmp = t_1 + (18.0 * (x * (t * (z * y))));
} else if (x <= -8.5e+80) {
tmp = t_2;
} else if (x <= 1.1e+56) {
tmp = ((b * c) - (4.0 * (t * a))) - (k * (j * 27.0));
} else if (x <= 1.7e+232) {
tmp = t_1 + (x * (t * (z * (18.0 * y))));
} else if (x <= 4.9e+287) {
tmp = t_2;
} else {
tmp = t_1 + (18.0 * (t * (x * (z * y))));
}
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 = t_1 + (x * ((-4.0d0) * i))
if (x <= (-1.45d+252)) then
tmp = t_1 + ((t * 18.0d0) * (z * (x * y)))
else if (x <= (-1.4d+214)) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (x <= (-2.9d+191)) then
tmp = t_1 + (18.0d0 * (x * (t * (z * y))))
else if (x <= (-8.5d+80)) then
tmp = t_2
else if (x <= 1.1d+56) then
tmp = ((b * c) - (4.0d0 * (t * a))) - (k * (j * 27.0d0))
else if (x <= 1.7d+232) then
tmp = t_1 + (x * (t * (z * (18.0d0 * y))))
else if (x <= 4.9d+287) then
tmp = t_2
else
tmp = t_1 + (18.0d0 * (t * (x * (z * y))))
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 = t_1 + (x * (-4.0 * i));
double tmp;
if (x <= -1.45e+252) {
tmp = t_1 + ((t * 18.0) * (z * (x * y)));
} else if (x <= -1.4e+214) {
tmp = (b * c) - (4.0 * (x * i));
} else if (x <= -2.9e+191) {
tmp = t_1 + (18.0 * (x * (t * (z * y))));
} else if (x <= -8.5e+80) {
tmp = t_2;
} else if (x <= 1.1e+56) {
tmp = ((b * c) - (4.0 * (t * a))) - (k * (j * 27.0));
} else if (x <= 1.7e+232) {
tmp = t_1 + (x * (t * (z * (18.0 * y))));
} else if (x <= 4.9e+287) {
tmp = t_2;
} else {
tmp = t_1 + (18.0 * (t * (x * (z * y))));
}
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 = t_1 + (x * (-4.0 * i)) tmp = 0 if x <= -1.45e+252: tmp = t_1 + ((t * 18.0) * (z * (x * y))) elif x <= -1.4e+214: tmp = (b * c) - (4.0 * (x * i)) elif x <= -2.9e+191: tmp = t_1 + (18.0 * (x * (t * (z * y)))) elif x <= -8.5e+80: tmp = t_2 elif x <= 1.1e+56: tmp = ((b * c) - (4.0 * (t * a))) - (k * (j * 27.0)) elif x <= 1.7e+232: tmp = t_1 + (x * (t * (z * (18.0 * y)))) elif x <= 4.9e+287: tmp = t_2 else: tmp = t_1 + (18.0 * (t * (x * (z * y)))) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * -27.0) * k) t_2 = Float64(t_1 + Float64(x * Float64(-4.0 * i))) tmp = 0.0 if (x <= -1.45e+252) tmp = Float64(t_1 + Float64(Float64(t * 18.0) * Float64(z * Float64(x * y)))); elseif (x <= -1.4e+214) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (x <= -2.9e+191) tmp = Float64(t_1 + Float64(18.0 * Float64(x * Float64(t * Float64(z * y))))); elseif (x <= -8.5e+80) tmp = t_2; elseif (x <= 1.1e+56) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(k * Float64(j * 27.0))); elseif (x <= 1.7e+232) tmp = Float64(t_1 + Float64(x * Float64(t * Float64(z * Float64(18.0 * y))))); elseif (x <= 4.9e+287) tmp = t_2; else tmp = Float64(t_1 + Float64(18.0 * Float64(t * Float64(x * Float64(z * y))))); 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 = t_1 + (x * (-4.0 * i));
tmp = 0.0;
if (x <= -1.45e+252)
tmp = t_1 + ((t * 18.0) * (z * (x * y)));
elseif (x <= -1.4e+214)
tmp = (b * c) - (4.0 * (x * i));
elseif (x <= -2.9e+191)
tmp = t_1 + (18.0 * (x * (t * (z * y))));
elseif (x <= -8.5e+80)
tmp = t_2;
elseif (x <= 1.1e+56)
tmp = ((b * c) - (4.0 * (t * a))) - (k * (j * 27.0));
elseif (x <= 1.7e+232)
tmp = t_1 + (x * (t * (z * (18.0 * y))));
elseif (x <= 4.9e+287)
tmp = t_2;
else
tmp = t_1 + (18.0 * (t * (x * (z * y))));
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[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e+252], N[(t$95$1 + N[(N[(t * 18.0), $MachinePrecision] * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.4e+214], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.9e+191], N[(t$95$1 + N[(18.0 * N[(x * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e+80], t$95$2, If[LessEqual[x, 1.1e+56], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.7e+232], N[(t$95$1 + N[(x * N[(t * N[(z * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.9e+287], t$95$2, N[(t$95$1 + N[(18.0 * N[(t * N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot -27\right) \cdot k\\
t_2 := t_1 + x \cdot \left(-4 \cdot i\right)\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+252}:\\
\;\;\;\;t_1 + \left(t \cdot 18\right) \cdot \left(z \cdot \left(x \cdot y\right)\right)\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{+214}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{+191}:\\
\;\;\;\;t_1 + 18 \cdot \left(x \cdot \left(t \cdot \left(z \cdot y\right)\right)\right)\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{+80}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+56}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+232}:\\
\;\;\;\;t_1 + x \cdot \left(t \cdot \left(z \cdot \left(18 \cdot y\right)\right)\right)\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{+287}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 + 18 \cdot \left(t \cdot \left(x \cdot \left(z \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.44999999999999998e252Initial program 77.7%
Simplified77.6%
Taylor expanded in z around inf 73.3%
associate-*r*73.3%
associate-*r*73.3%
Simplified73.3%
if -1.44999999999999998e252 < x < -1.3999999999999999e214Initial program 62.8%
associate-*l*62.8%
associate--l+62.8%
distribute-rgt-out--62.8%
associate-*l*69.1%
associate-*l*69.1%
Simplified69.1%
Taylor expanded in t around 0 62.9%
Taylor expanded in j around 0 63.0%
if -1.3999999999999999e214 < x < -2.9000000000000001e191Initial program 81.3%
Simplified81.3%
Taylor expanded in z around inf 62.5%
expm1-log1p-u41.2%
expm1-udef41.2%
*-commutative41.2%
Applied egg-rr41.2%
expm1-def41.2%
expm1-log1p62.5%
*-commutative62.5%
associate-*l*80.9%
*-commutative80.9%
*-commutative80.9%
Simplified80.9%
if -2.9000000000000001e191 < x < -8.50000000000000007e80 or 1.6999999999999999e232 < x < 4.89999999999999993e287Initial program 79.1%
Simplified91.2%
Taylor expanded in i around inf 80.5%
associate-*r*80.5%
*-commutative80.5%
Simplified80.5%
if -8.50000000000000007e80 < x < 1.10000000000000008e56Initial program 90.6%
Taylor expanded in x around 0 74.6%
if 1.10000000000000008e56 < x < 1.6999999999999999e232Initial program 59.4%
Simplified69.8%
Taylor expanded in z around inf 53.4%
*-commutative53.4%
associate-*r*66.4%
associate-*l*66.5%
*-commutative66.5%
*-commutative66.5%
associate-*l*66.5%
associate-*r*66.5%
*-commutative66.5%
associate-*l*66.5%
Simplified66.5%
if 4.89999999999999993e287 < x Initial program 75.0%
Simplified75.0%
Taylor expanded in z around inf 63.2%
Final simplification73.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 (* k 27.0))))
(if (or (<= t -8.5e-72) (not (<= t 5.4e-96)))
(- (+ (* b c) (* t (- (* 18.0 (* x (* z y))) (* a 4.0)))) t_1)
(- (- (* b c) (* 4.0 (* x i))) t_1))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double tmp;
if ((t <= -8.5e-72) || !(t <= 5.4e-96)) {
tmp = ((b * c) + (t * ((18.0 * (x * (z * y))) - (a * 4.0)))) - t_1;
} else {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = j * (k * 27.0d0)
if ((t <= (-8.5d-72)) .or. (.not. (t <= 5.4d-96))) then
tmp = ((b * c) + (t * ((18.0d0 * (x * (z * y))) - (a * 4.0d0)))) - t_1
else
tmp = ((b * c) - (4.0d0 * (x * i))) - t_1
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double tmp;
if ((t <= -8.5e-72) || !(t <= 5.4e-96)) {
tmp = ((b * c) + (t * ((18.0 * (x * (z * y))) - (a * 4.0)))) - t_1;
} else {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * 27.0) tmp = 0 if (t <= -8.5e-72) or not (t <= 5.4e-96): tmp = ((b * c) + (t * ((18.0 * (x * (z * y))) - (a * 4.0)))) - t_1 else: tmp = ((b * c) - (4.0 * (x * i))) - t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * 27.0)) tmp = 0.0 if ((t <= -8.5e-72) || !(t <= 5.4e-96)) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(z * y))) - Float64(a * 4.0)))) - t_1); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * 27.0);
tmp = 0.0;
if ((t <= -8.5e-72) || ~((t <= 5.4e-96)))
tmp = ((b * c) + (t * ((18.0 * (x * (z * y))) - (a * 4.0)))) - t_1;
else
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -8.5e-72], N[Not[LessEqual[t, 5.4e-96]], $MachinePrecision]], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot 27\right)\\
\mathbf{if}\;t \leq -8.5 \cdot 10^{-72} \lor \neg \left(t \leq 5.4 \cdot 10^{-96}\right):\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(z \cdot y\right)\right) - a \cdot 4\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\end{array}
\end{array}
if t < -8.50000000000000008e-72 or 5.3999999999999999e-96 < t Initial program 84.4%
associate-*l*84.3%
associate--l+84.3%
distribute-rgt-out--86.8%
associate-*l*85.1%
associate-*l*85.1%
Simplified85.1%
Taylor expanded in i around 0 78.3%
if -8.50000000000000008e-72 < t < 5.3999999999999999e-96Initial program 78.7%
associate-*l*78.7%
associate--l+78.7%
distribute-rgt-out--78.7%
associate-*l*80.8%
associate-*l*80.8%
Simplified80.8%
Taylor expanded in t around 0 82.2%
Final simplification79.7%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j -27.0) k)))
(if (<= z -1.8e-112)
(+ t_1 (* 18.0 (* (* x z) (* t y))))
(if (<= z 4.3e+189)
(- (- (* b c) (* 4.0 (* x i))) (* j (* k 27.0)))
(if (<= z 2.25e+240)
(+ t_1 (* x (* t (* z (* 18.0 y)))))
(+ t_1 (* 18.0 (* t (* y (* x z))))))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * -27.0) * k;
double tmp;
if (z <= -1.8e-112) {
tmp = t_1 + (18.0 * ((x * z) * (t * y)));
} else if (z <= 4.3e+189) {
tmp = ((b * c) - (4.0 * (x * i))) - (j * (k * 27.0));
} else if (z <= 2.25e+240) {
tmp = t_1 + (x * (t * (z * (18.0 * y))));
} else {
tmp = t_1 + (18.0 * (t * (y * (x * z))));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * (-27.0d0)) * k
if (z <= (-1.8d-112)) then
tmp = t_1 + (18.0d0 * ((x * z) * (t * y)))
else if (z <= 4.3d+189) then
tmp = ((b * c) - (4.0d0 * (x * i))) - (j * (k * 27.0d0))
else if (z <= 2.25d+240) then
tmp = t_1 + (x * (t * (z * (18.0d0 * y))))
else
tmp = t_1 + (18.0d0 * (t * (y * (x * z))))
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * -27.0) * k;
double tmp;
if (z <= -1.8e-112) {
tmp = t_1 + (18.0 * ((x * z) * (t * y)));
} else if (z <= 4.3e+189) {
tmp = ((b * c) - (4.0 * (x * i))) - (j * (k * 27.0));
} else if (z <= 2.25e+240) {
tmp = t_1 + (x * (t * (z * (18.0 * y))));
} else {
tmp = t_1 + (18.0 * (t * (y * (x * z))));
}
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 z <= -1.8e-112: tmp = t_1 + (18.0 * ((x * z) * (t * y))) elif z <= 4.3e+189: tmp = ((b * c) - (4.0 * (x * i))) - (j * (k * 27.0)) elif z <= 2.25e+240: tmp = t_1 + (x * (t * (z * (18.0 * y)))) else: tmp = t_1 + (18.0 * (t * (y * (x * z)))) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * -27.0) * k) tmp = 0.0 if (z <= -1.8e-112) tmp = Float64(t_1 + Float64(18.0 * Float64(Float64(x * z) * Float64(t * y)))); elseif (z <= 4.3e+189) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - Float64(j * Float64(k * 27.0))); elseif (z <= 2.25e+240) tmp = Float64(t_1 + Float64(x * Float64(t * Float64(z * Float64(18.0 * y))))); else tmp = Float64(t_1 + Float64(18.0 * Float64(t * Float64(y * Float64(x * z))))); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * -27.0) * k;
tmp = 0.0;
if (z <= -1.8e-112)
tmp = t_1 + (18.0 * ((x * z) * (t * y)));
elseif (z <= 4.3e+189)
tmp = ((b * c) - (4.0 * (x * i))) - (j * (k * 27.0));
elseif (z <= 2.25e+240)
tmp = t_1 + (x * (t * (z * (18.0 * y))));
else
tmp = t_1 + (18.0 * (t * (y * (x * z))));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[z, -1.8e-112], N[(t$95$1 + N[(18.0 * N[(N[(x * z), $MachinePrecision] * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e+189], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e+240], N[(t$95$1 + N[(x * N[(t * N[(z * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(18.0 * N[(t * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot -27\right) \cdot k\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{-112}:\\
\;\;\;\;t_1 + 18 \cdot \left(\left(x \cdot z\right) \cdot \left(t \cdot y\right)\right)\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+189}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - j \cdot \left(k \cdot 27\right)\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+240}:\\
\;\;\;\;t_1 + x \cdot \left(t \cdot \left(z \cdot \left(18 \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + 18 \cdot \left(t \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if z < -1.8e-112Initial program 74.7%
Simplified80.1%
Taylor expanded in z around inf 53.5%
expm1-log1p-u31.2%
expm1-udef30.7%
*-commutative30.7%
Applied egg-rr30.7%
expm1-def31.2%
expm1-log1p53.5%
associate-*r*52.2%
Simplified52.2%
Taylor expanded in t around 0 53.5%
*-commutative53.5%
associate-*r*52.2%
associate-*l*57.3%
*-commutative57.3%
associate-*l*48.0%
Simplified48.0%
if -1.8e-112 < z < 4.29999999999999998e189Initial program 86.7%
associate-*l*86.7%
associate--l+86.7%
distribute-rgt-out--86.7%
associate-*l*87.5%
associate-*l*87.5%
Simplified87.5%
Taylor expanded in t around 0 70.3%
if 4.29999999999999998e189 < z < 2.24999999999999989e240Initial program 76.1%
Simplified76.2%
Taylor expanded in z around inf 57.2%
*-commutative57.2%
associate-*r*76.2%
associate-*l*76.3%
*-commutative76.3%
*-commutative76.3%
associate-*l*76.2%
associate-*r*76.3%
*-commutative76.3%
associate-*l*76.3%
Simplified76.3%
if 2.24999999999999989e240 < z Initial program 84.9%
Simplified80.7%
Taylor expanded in z around inf 51.9%
expm1-log1p-u35.8%
expm1-udef35.8%
*-commutative35.8%
Applied egg-rr35.8%
expm1-def35.8%
expm1-log1p51.9%
associate-*r*66.0%
Simplified66.0%
Final simplification64.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 (or (<= t -1.26e-59) (not (<= t 3.6e-86))) (+ (* b c) (* t (- (* 18.0 (* x (* z y))) (* a 4.0)))) (- (- (* b c) (* 4.0 (* x i))) (* j (* k 27.0)))))
assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -1.26e-59) || !(t <= 3.6e-86)) {
tmp = (b * c) + (t * ((18.0 * (x * (z * y))) - (a * 4.0)));
} else {
tmp = ((b * c) - (4.0 * (x * i))) - (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.26d-59)) .or. (.not. (t <= 3.6d-86))) then
tmp = (b * c) + (t * ((18.0d0 * (x * (z * y))) - (a * 4.0d0)))
else
tmp = ((b * c) - (4.0d0 * (x * i))) - (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.26e-59) || !(t <= 3.6e-86)) {
tmp = (b * c) + (t * ((18.0 * (x * (z * y))) - (a * 4.0)));
} else {
tmp = ((b * c) - (4.0 * (x * i))) - (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.26e-59) or not (t <= 3.6e-86): tmp = (b * c) + (t * ((18.0 * (x * (z * y))) - (a * 4.0))) else: tmp = ((b * c) - (4.0 * (x * i))) - (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.26e-59) || !(t <= 3.6e-86)) tmp = Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(z * y))) - Float64(a * 4.0)))); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - Float64(j * Float64(k * 27.0))); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((t <= -1.26e-59) || ~((t <= 3.6e-86)))
tmp = (b * c) + (t * ((18.0 * (x * (z * y))) - (a * 4.0)));
else
tmp = ((b * c) - (4.0 * (x * i))) - (j * (k * 27.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[t, -1.26e-59], N[Not[LessEqual[t, 3.6e-86]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.26 \cdot 10^{-59} \lor \neg \left(t \leq 3.6 \cdot 10^{-86}\right):\\
\;\;\;\;b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(z \cdot y\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - j \cdot \left(k \cdot 27\right)\\
\end{array}
\end{array}
if t < -1.2599999999999999e-59 or 3.59999999999999966e-86 < t Initial program 84.0%
associate-*l*84.0%
associate--l+84.0%
distribute-rgt-out--86.5%
associate-*l*84.8%
associate-*l*84.8%
Simplified84.8%
Taylor expanded in i around 0 78.3%
Taylor expanded in j around 0 71.9%
if -1.2599999999999999e-59 < t < 3.59999999999999966e-86Initial program 79.5%
associate-*l*79.5%
associate--l+79.5%
distribute-rgt-out--79.5%
associate-*l*81.5%
associate-*l*81.5%
Simplified81.5%
Taylor expanded in t around 0 82.0%
Final simplification75.8%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j -27.0) k)))
(if (<= (* b c) -580000000000.0)
(- (* b c) (* 4.0 (* x i)))
(if (<= (* b c) 4.1e+75) (+ t_1 (* x (* -4.0 i))) (+ (* b c) 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 ((b * c) <= -580000000000.0) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= 4.1e+75) {
tmp = t_1 + (x * (-4.0 * i));
} else {
tmp = (b * c) + 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 ((b * c) <= (-580000000000.0d0)) then
tmp = (b * c) - (4.0d0 * (x * i))
else if ((b * c) <= 4.1d+75) then
tmp = t_1 + (x * ((-4.0d0) * i))
else
tmp = (b * c) + 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 ((b * c) <= -580000000000.0) {
tmp = (b * c) - (4.0 * (x * i));
} else if ((b * c) <= 4.1e+75) {
tmp = t_1 + (x * (-4.0 * i));
} else {
tmp = (b * c) + 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 (b * c) <= -580000000000.0: tmp = (b * c) - (4.0 * (x * i)) elif (b * c) <= 4.1e+75: tmp = t_1 + (x * (-4.0 * i)) else: tmp = (b * c) + t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * -27.0) * k) tmp = 0.0 if (Float64(b * c) <= -580000000000.0) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (Float64(b * c) <= 4.1e+75) tmp = Float64(t_1 + Float64(x * Float64(-4.0 * i))); else tmp = Float64(Float64(b * c) + 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 ((b * c) <= -580000000000.0)
tmp = (b * c) - (4.0 * (x * i));
elseif ((b * c) <= 4.1e+75)
tmp = t_1 + (x * (-4.0 * i));
else
tmp = (b * c) + t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -580000000000.0], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 4.1e+75], N[(t$95$1 + N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot -27\right) \cdot k\\
\mathbf{if}\;b \cdot c \leq -580000000000:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 4.1 \cdot 10^{+75}:\\
\;\;\;\;t_1 + x \cdot \left(-4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t_1\\
\end{array}
\end{array}
if (*.f64 b c) < -5.8e11Initial program 75.4%
associate-*l*75.4%
associate--l+75.4%
distribute-rgt-out--75.4%
associate-*l*74.2%
associate-*l*74.2%
Simplified74.2%
Taylor expanded in t around 0 68.9%
Taylor expanded in j around 0 64.4%
if -5.8e11 < (*.f64 b c) < 4.0999999999999998e75Initial program 85.1%
Simplified88.0%
Taylor expanded in i around inf 49.3%
associate-*r*49.3%
*-commutative49.3%
Simplified49.3%
if 4.0999999999999998e75 < (*.f64 b c) Initial program 84.7%
Simplified89.8%
Taylor expanded in b around inf 64.3%
Final simplification55.9%
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 c) -1.1e+120)
(* b c)
(if (<= (* b c) 3.6e-130)
(* x (* -4.0 i))
(if (<= (* b c) 2.02e+49) (* j (* -27.0 k)) (* b c)))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -1.1e+120) {
tmp = b * c;
} else if ((b * c) <= 3.6e-130) {
tmp = x * (-4.0 * i);
} else if ((b * c) <= 2.02e+49) {
tmp = j * (-27.0 * k);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((b * c) <= (-1.1d+120)) then
tmp = b * c
else if ((b * c) <= 3.6d-130) then
tmp = x * ((-4.0d0) * i)
else if ((b * c) <= 2.02d+49) then
tmp = j * ((-27.0d0) * k)
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -1.1e+120) {
tmp = b * c;
} else if ((b * c) <= 3.6e-130) {
tmp = x * (-4.0 * i);
} else if ((b * c) <= 2.02e+49) {
tmp = j * (-27.0 * k);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -1.1e+120: tmp = b * c elif (b * c) <= 3.6e-130: tmp = x * (-4.0 * i) elif (b * c) <= 2.02e+49: tmp = j * (-27.0 * k) else: tmp = b * c return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -1.1e+120) tmp = Float64(b * c); elseif (Float64(b * c) <= 3.6e-130) tmp = Float64(x * Float64(-4.0 * i)); elseif (Float64(b * c) <= 2.02e+49) tmp = Float64(j * Float64(-27.0 * k)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((b * c) <= -1.1e+120)
tmp = b * c;
elseif ((b * c) <= 3.6e-130)
tmp = x * (-4.0 * i);
elseif ((b * c) <= 2.02e+49)
tmp = j * (-27.0 * k);
else
tmp = b * c;
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[N[(b * c), $MachinePrecision], -1.1e+120], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3.6e-130], N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.02e+49], N[(j * N[(-27.0 * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -1.1 \cdot 10^{+120}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq 3.6 \cdot 10^{-130}:\\
\;\;\;\;x \cdot \left(-4 \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 2.02 \cdot 10^{+49}:\\
\;\;\;\;j \cdot \left(-27 \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.1000000000000001e120 or 2.02000000000000004e49 < (*.f64 b c) Initial program 80.6%
associate-*l*80.6%
associate--l+80.6%
distribute-rgt-out--81.7%
associate-*l*81.7%
associate-*l*81.7%
Simplified81.7%
Taylor expanded in i around 0 76.2%
associate--l+76.2%
cancel-sign-sub-inv76.2%
associate-*r*76.2%
fma-def76.2%
metadata-eval76.2%
Applied egg-rr76.2%
Taylor expanded in b around inf 50.8%
if -1.1000000000000001e120 < (*.f64 b c) < 3.6000000000000001e-130Initial program 83.1%
associate-*l*83.1%
associate--l+83.1%
distribute-rgt-out--84.7%
associate-*l*84.1%
associate-*l*84.1%
Simplified84.1%
Taylor expanded in t around 0 56.7%
Taylor expanded in i around inf 34.2%
associate-*r*34.2%
metadata-eval34.2%
distribute-lft-neg-in34.2%
*-commutative34.2%
distribute-lft-neg-in34.2%
metadata-eval34.2%
Simplified34.2%
if 3.6000000000000001e-130 < (*.f64 b c) < 2.02000000000000004e49Initial program 83.3%
associate-*l*83.3%
associate--l+83.3%
distribute-rgt-out--86.1%
associate-*l*86.1%
associate-*l*86.1%
Simplified86.1%
associate-*r*86.1%
distribute-rgt-out--83.3%
associate-*l*83.2%
associate-*l*80.4%
*-commutative80.4%
Applied egg-rr80.4%
Taylor expanded in j around inf 32.2%
associate-*r*32.3%
*-commutative32.3%
associate-*r*32.2%
*-commutative32.2%
Simplified32.2%
Final simplification39.9%
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 (<= a -1.8e+110) (not (<= a 6e+33))) (+ (* (* j -27.0) k) (* -4.0 (* t a))) (- (* b c) (* 4.0 (* x i)))))
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 ((a <= -1.8e+110) || !(a <= 6e+33)) {
tmp = ((j * -27.0) * k) + (-4.0 * (t * a));
} else {
tmp = (b * c) - (4.0 * (x * i));
}
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 ((a <= (-1.8d+110)) .or. (.not. (a <= 6d+33))) then
tmp = ((j * (-27.0d0)) * k) + ((-4.0d0) * (t * a))
else
tmp = (b * c) - (4.0d0 * (x * i))
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 ((a <= -1.8e+110) || !(a <= 6e+33)) {
tmp = ((j * -27.0) * k) + (-4.0 * (t * a));
} else {
tmp = (b * c) - (4.0 * (x * i));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (a <= -1.8e+110) or not (a <= 6e+33): tmp = ((j * -27.0) * k) + (-4.0 * (t * a)) else: tmp = (b * c) - (4.0 * (x * i)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((a <= -1.8e+110) || !(a <= 6e+33)) tmp = Float64(Float64(Float64(j * -27.0) * k) + Float64(-4.0 * Float64(t * a))); else tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); 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 ((a <= -1.8e+110) || ~((a <= 6e+33)))
tmp = ((j * -27.0) * k) + (-4.0 * (t * a));
else
tmp = (b * c) - (4.0 * (x * i));
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[a, -1.8e+110], N[Not[LessEqual[a, 6e+33]], $MachinePrecision]], N[(N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{+110} \lor \neg \left(a \leq 6 \cdot 10^{+33}\right):\\
\;\;\;\;\left(j \cdot -27\right) \cdot k + -4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\end{array}
\end{array}
if a < -1.7999999999999998e110 or 5.99999999999999967e33 < a Initial program 76.5%
Simplified85.6%
Taylor expanded in a around inf 56.3%
*-commutative56.3%
Simplified56.3%
if -1.7999999999999998e110 < a < 5.99999999999999967e33Initial program 85.3%
associate-*l*85.3%
associate--l+85.3%
distribute-rgt-out--85.3%
associate-*l*84.8%
associate-*l*84.8%
Simplified84.8%
Taylor expanded in t around 0 65.9%
Taylor expanded in j around 0 54.1%
Final simplification54.9%
NOTE: y and z should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= (* b c) -24000000000.0) (not (<= (* b c) 2e+49))) (* 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 (((b * c) <= -24000000000.0) || !((b * c) <= 2e+49)) {
tmp = b * c;
} else {
tmp = -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 (((b * c) <= (-24000000000.0d0)) .or. (.not. ((b * c) <= 2d+49))) then
tmp = b * c
else
tmp = (-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 (((b * c) <= -24000000000.0) || !((b * c) <= 2e+49)) {
tmp = b * c;
} else {
tmp = -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 ((b * c) <= -24000000000.0) or not ((b * c) <= 2e+49): tmp = b * c else: tmp = -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 ((Float64(b * c) <= -24000000000.0) || !(Float64(b * c) <= 2e+49)) tmp = Float64(b * c); else tmp = 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 (((b * c) <= -24000000000.0) || ~(((b * c) <= 2e+49)))
tmp = b * c;
else
tmp = -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[N[(b * c), $MachinePrecision], -24000000000.0], N[Not[LessEqual[N[(b * c), $MachinePrecision], 2e+49]], $MachinePrecision]], N[(b * c), $MachinePrecision], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -24000000000 \lor \neg \left(b \cdot c \leq 2 \cdot 10^{+49}\right):\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -2.4e10 or 1.99999999999999989e49 < (*.f64 b c) Initial program 78.4%
associate-*l*78.4%
associate--l+78.4%
distribute-rgt-out--79.3%
associate-*l*78.5%
associate-*l*78.5%
Simplified78.5%
Taylor expanded in i around 0 72.0%
associate--l+72.0%
cancel-sign-sub-inv72.0%
associate-*r*72.0%
fma-def72.0%
metadata-eval72.0%
Applied egg-rr72.0%
Taylor expanded in b around inf 44.1%
if -2.4e10 < (*.f64 b c) < 1.99999999999999989e49Initial program 85.6%
Simplified88.0%
Taylor expanded in k around inf 25.0%
Final simplification33.9%
NOTE: y and z should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= x -6.5e+80) (not (<= x 4.5e+174))) (* x (* -4.0 i)) (+ (* b c) (* (* 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 ((x <= -6.5e+80) || !(x <= 4.5e+174)) {
tmp = x * (-4.0 * i);
} else {
tmp = (b * c) + ((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 ((x <= (-6.5d+80)) .or. (.not. (x <= 4.5d+174))) then
tmp = x * ((-4.0d0) * i)
else
tmp = (b * c) + ((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 ((x <= -6.5e+80) || !(x <= 4.5e+174)) {
tmp = x * (-4.0 * i);
} else {
tmp = (b * c) + ((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 (x <= -6.5e+80) or not (x <= 4.5e+174): tmp = x * (-4.0 * i) else: tmp = (b * c) + ((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 ((x <= -6.5e+80) || !(x <= 4.5e+174)) tmp = Float64(x * Float64(-4.0 * i)); else tmp = Float64(Float64(b * c) + Float64(Float64(j * -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 ((x <= -6.5e+80) || ~((x <= 4.5e+174)))
tmp = x * (-4.0 * i);
else
tmp = (b * c) + ((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[Or[LessEqual[x, -6.5e+80], N[Not[LessEqual[x, 4.5e+174]], $MachinePrecision]], N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+80} \lor \neg \left(x \leq 4.5 \cdot 10^{+174}\right):\\
\;\;\;\;x \cdot \left(-4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + \left(j \cdot -27\right) \cdot k\\
\end{array}
\end{array}
if x < -6.4999999999999998e80 or 4.50000000000000042e174 < x Initial program 73.4%
associate-*l*73.4%
associate--l+73.4%
distribute-rgt-out--74.5%
associate-*l*76.7%
associate-*l*76.7%
Simplified76.7%
Taylor expanded in t around 0 59.1%
Taylor expanded in i around inf 49.8%
associate-*r*49.8%
metadata-eval49.8%
distribute-lft-neg-in49.8%
*-commutative49.8%
distribute-lft-neg-in49.8%
metadata-eval49.8%
Simplified49.8%
if -6.4999999999999998e80 < x < 4.50000000000000042e174Initial program 87.0%
Simplified87.8%
Taylor expanded in b around inf 51.1%
Final simplification50.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 (<= i -2.6e+33) (not (<= i 7e-81))) (- (* b c) (* 4.0 (* x i))) (+ (* b c) (* (* 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 ((i <= -2.6e+33) || !(i <= 7e-81)) {
tmp = (b * c) - (4.0 * (x * i));
} else {
tmp = (b * c) + ((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 ((i <= (-2.6d+33)) .or. (.not. (i <= 7d-81))) then
tmp = (b * c) - (4.0d0 * (x * i))
else
tmp = (b * c) + ((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 ((i <= -2.6e+33) || !(i <= 7e-81)) {
tmp = (b * c) - (4.0 * (x * i));
} else {
tmp = (b * c) + ((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 (i <= -2.6e+33) or not (i <= 7e-81): tmp = (b * c) - (4.0 * (x * i)) else: tmp = (b * c) + ((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 ((i <= -2.6e+33) || !(i <= 7e-81)) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); else tmp = Float64(Float64(b * c) + Float64(Float64(j * -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 ((i <= -2.6e+33) || ~((i <= 7e-81)))
tmp = (b * c) - (4.0 * (x * i));
else
tmp = (b * c) + ((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[Or[LessEqual[i, -2.6e+33], N[Not[LessEqual[i, 7e-81]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.6 \cdot 10^{+33} \lor \neg \left(i \leq 7 \cdot 10^{-81}\right):\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + \left(j \cdot -27\right) \cdot k\\
\end{array}
\end{array}
if i < -2.5999999999999997e33 or 6.99999999999999973e-81 < i Initial program 81.0%
associate-*l*81.0%
associate--l+81.0%
distribute-rgt-out--82.4%
associate-*l*81.2%
associate-*l*81.2%
Simplified81.2%
Taylor expanded in t around 0 66.9%
Taylor expanded in j around 0 56.1%
if -2.5999999999999997e33 < i < 6.99999999999999973e-81Initial program 83.9%
Simplified87.5%
Taylor expanded in b around inf 46.1%
Final simplification51.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 (or (<= i -4.6e+33) (not (<= i 3.5e-80))) (- (* b c) (* 4.0 (* x i))) (- (* 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 ((i <= -4.6e+33) || !(i <= 3.5e-80)) {
tmp = (b * c) - (4.0 * (x * i));
} 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 ((i <= (-4.6d+33)) .or. (.not. (i <= 3.5d-80))) then
tmp = (b * c) - (4.0d0 * (x * i))
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 ((i <= -4.6e+33) || !(i <= 3.5e-80)) {
tmp = (b * c) - (4.0 * (x * i));
} 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 (i <= -4.6e+33) or not (i <= 3.5e-80): tmp = (b * c) - (4.0 * (x * i)) 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 ((i <= -4.6e+33) || !(i <= 3.5e-80)) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); 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 ((i <= -4.6e+33) || ~((i <= 3.5e-80)))
tmp = (b * c) - (4.0 * (x * i));
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[i, -4.6e+33], N[Not[LessEqual[i, 3.5e-80]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $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}\;i \leq -4.6 \cdot 10^{+33} \lor \neg \left(i \leq 3.5 \cdot 10^{-80}\right):\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if i < -4.60000000000000021e33 or 3.50000000000000015e-80 < i Initial program 81.0%
associate-*l*81.0%
associate--l+81.0%
distribute-rgt-out--82.4%
associate-*l*81.2%
associate-*l*81.2%
Simplified81.2%
Taylor expanded in t around 0 66.9%
Taylor expanded in j around 0 56.1%
if -4.60000000000000021e33 < i < 3.50000000000000015e-80Initial program 83.9%
associate-*l*83.8%
associate--l+83.8%
distribute-rgt-out--85.6%
associate-*l*86.5%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in i around 0 84.4%
Taylor expanded in t around 0 46.1%
Final simplification51.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 (* b c))
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 b * c;
}
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 = b * c
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 b * c;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
y, z = num2cell(sort([y, z])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
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[(b * c), $MachinePrecision]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
b \cdot c
\end{array}
Initial program 82.3%
associate-*l*82.2%
associate--l+82.2%
distribute-rgt-out--83.8%
associate-*l*83.5%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in i around 0 71.3%
associate--l+71.3%
cancel-sign-sub-inv71.3%
associate-*r*71.3%
fma-def71.3%
metadata-eval71.3%
Applied egg-rr71.3%
Taylor expanded in b around inf 22.8%
Final simplification22.8%
(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 2023336
(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)))