
(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);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
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}
Herbie found 20 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);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
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: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(+
(- (* x (- (* i 4.0) (* (* (* y 18.0) t) z))))
(fma (* a t) -4.0 (* c b)))
(* (* j 27.0) k))))
(if (<= x -8e-47)
t_1
(if (<= x 1.65e+177)
(fma
(* -27.0 k)
j
(fma (* i x) -4.0 (fma (fma -4.0 a (* z (* y (* 18.0 x)))) t (* c b))))
t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (-(x * ((i * 4.0) - (((y * 18.0) * t) * z))) + fma((a * t), -4.0, (c * b))) - ((j * 27.0) * k);
double tmp;
if (x <= -8e-47) {
tmp = t_1;
} else if (x <= 1.65e+177) {
tmp = fma((-27.0 * k), j, fma((i * x), -4.0, fma(fma(-4.0, a, (z * (y * (18.0 * x)))), t, (c * b))));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(-Float64(x * Float64(Float64(i * 4.0) - Float64(Float64(Float64(y * 18.0) * t) * z)))) + fma(Float64(a * t), -4.0, Float64(c * b))) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (x <= -8e-47) tmp = t_1; elseif (x <= 1.65e+177) tmp = fma(Float64(-27.0 * k), j, fma(Float64(i * x), -4.0, fma(fma(-4.0, a, Float64(z * Float64(y * Float64(18.0 * x)))), t, Float64(c * b)))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k 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[(x * N[(N[(i * 4.0), $MachinePrecision] - N[(N[(N[(y * 18.0), $MachinePrecision] * t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(a * t), $MachinePrecision] * -4.0 + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e-47], t$95$1, If[LessEqual[x, 1.65e+177], N[(N[(-27.0 * k), $MachinePrecision] * j + N[(N[(i * x), $MachinePrecision] * -4.0 + N[(N[(-4.0 * a + N[(z * N[(y * N[(18.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(\left(-x \cdot \left(i \cdot 4 - \left(\left(y \cdot 18\right) \cdot t\right) \cdot z\right)\right) + \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -8 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+177}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot k, j, \mathsf{fma}\left(i \cdot x, -4, \mathsf{fma}\left(\mathsf{fma}\left(-4, a, z \cdot \left(y \cdot \left(18 \cdot x\right)\right)\right), t, c \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.9999999999999998e-47 or 1.6500000000000001e177 < x Initial program 85.3%
Applied rewrites87.4%
if -7.9999999999999998e-47 < x < 1.6500000000000001e177Initial program 85.3%
Applied rewrites88.6%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -1.35e+185)
(* x (fma -4.0 i (* 18.0 (* t (* y z)))))
(fma
(* -27.0 k)
j
(fma (* i x) -4.0 (fma (fma -4.0 a (* z (* y (* 18.0 x)))) t (* c b))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
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 <= -1.35e+185) {
tmp = x * fma(-4.0, i, (18.0 * (t * (y * z))));
} else {
tmp = fma((-27.0 * k), j, fma((i * x), -4.0, fma(fma(-4.0, a, (z * (y * (18.0 * x)))), t, (c * b))));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -1.35e+185) tmp = Float64(x * fma(-4.0, i, Float64(18.0 * Float64(t * Float64(y * z))))); else tmp = fma(Float64(-27.0 * k), j, fma(Float64(i * x), -4.0, fma(fma(-4.0, a, Float64(z * Float64(y * Float64(18.0 * x)))), t, Float64(c * b)))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -1.35e+185], N[(x * N[(-4.0 * i + N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * k), $MachinePrecision] * j + N[(N[(i * x), $MachinePrecision] * -4.0 + N[(N[(-4.0 * a + N[(z * N[(y * N[(18.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+185}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot k, j, \mathsf{fma}\left(i \cdot x, -4, \mathsf{fma}\left(\mathsf{fma}\left(-4, a, z \cdot \left(y \cdot \left(18 \cdot x\right)\right)\right), t, c \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.35000000000000003e185Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
if -1.35000000000000003e185 < x Initial program 85.3%
Applied rewrites88.6%
NOTE: x, y, z, t, a, b, c, i, j, and k 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
(fma
(* y t)
(* (* 18.0 x) z)
(fma (* j k) -27.0 (fma (* -4.0 x) i (* b c))))))
(if (<= y -3e+248)
(* t (fma -4.0 a (* 18.0 (* x (* y z)))))
(if (<= y -7.2e+49)
t_1
(if (<= y 61000000.0)
(fma (* -27.0 k) j (fma (* i x) -4.0 (fma (* -4.0 a) t (* c b))))
t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
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 = fma((y * t), ((18.0 * x) * z), fma((j * k), -27.0, fma((-4.0 * x), i, (b * c))));
double tmp;
if (y <= -3e+248) {
tmp = t * fma(-4.0, a, (18.0 * (x * (y * z))));
} else if (y <= -7.2e+49) {
tmp = t_1;
} else if (y <= 61000000.0) {
tmp = fma((-27.0 * k), j, fma((i * x), -4.0, fma((-4.0 * a), t, (c * b))));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(Float64(y * t), Float64(Float64(18.0 * x) * z), fma(Float64(j * k), -27.0, fma(Float64(-4.0 * x), i, Float64(b * c)))) tmp = 0.0 if (y <= -3e+248) tmp = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z))))); elseif (y <= -7.2e+49) tmp = t_1; elseif (y <= 61000000.0) tmp = fma(Float64(-27.0 * k), j, fma(Float64(i * x), -4.0, fma(Float64(-4.0 * a), t, Float64(c * b)))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k 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[(y * t), $MachinePrecision] * N[(N[(18.0 * x), $MachinePrecision] * z), $MachinePrecision] + N[(N[(j * k), $MachinePrecision] * -27.0 + N[(N[(-4.0 * x), $MachinePrecision] * i + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3e+248], N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.2e+49], t$95$1, If[LessEqual[y, 61000000.0], N[(N[(-27.0 * k), $MachinePrecision] * j + N[(N[(i * x), $MachinePrecision] * -4.0 + N[(N[(-4.0 * a), $MachinePrecision] * t + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y \cdot t, \left(18 \cdot x\right) \cdot z, \mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(-4 \cdot x, i, b \cdot c\right)\right)\right)\\
\mathbf{if}\;y \leq -3 \cdot 10^{+248}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 61000000:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot k, j, \mathsf{fma}\left(i \cdot x, -4, \mathsf{fma}\left(-4 \cdot a, t, c \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3e248Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.4
Applied rewrites42.4%
if -3e248 < y < -7.19999999999999993e49 or 6.1e7 < y Initial program 85.3%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.6
Applied rewrites71.6%
Applied rewrites73.3%
if -7.19999999999999993e49 < y < 6.1e7Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in x around 0
lower-*.f6478.6
Applied rewrites78.6%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= y -9e+142)
(fma (* -27.0 k) j (fma (* (* t (* 18.0 x)) z) y (* -4.0 (* a t))))
(if (<= y 1.35e+184)
(fma (* -27.0 k) j (fma (* i x) -4.0 (fma (* -4.0 a) t (* c b))))
(- (fma 18.0 (* t (* x (* y z))) (* b c)) (* 4.0 (* i x))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
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 (y <= -9e+142) {
tmp = fma((-27.0 * k), j, fma(((t * (18.0 * x)) * z), y, (-4.0 * (a * t))));
} else if (y <= 1.35e+184) {
tmp = fma((-27.0 * k), j, fma((i * x), -4.0, fma((-4.0 * a), t, (c * b))));
} else {
tmp = fma(18.0, (t * (x * (y * z))), (b * c)) - (4.0 * (i * x));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (y <= -9e+142) tmp = fma(Float64(-27.0 * k), j, fma(Float64(Float64(t * Float64(18.0 * x)) * z), y, Float64(-4.0 * Float64(a * t)))); elseif (y <= 1.35e+184) tmp = fma(Float64(-27.0 * k), j, fma(Float64(i * x), -4.0, fma(Float64(-4.0 * a), t, Float64(c * b)))); else tmp = Float64(fma(18.0, Float64(t * Float64(x * Float64(y * z))), Float64(b * c)) - Float64(4.0 * Float64(i * x))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[y, -9e+142], N[(N[(-27.0 * k), $MachinePrecision] * j + N[(N[(N[(t * N[(18.0 * x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * y + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+184], N[(N[(-27.0 * k), $MachinePrecision] * j + N[(N[(i * x), $MachinePrecision] * -4.0 + N[(N[(-4.0 * a), $MachinePrecision] * t + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot k, j, \mathsf{fma}\left(\left(t \cdot \left(18 \cdot x\right)\right) \cdot z, y, -4 \cdot \left(a \cdot t\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+184}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot k, j, \mathsf{fma}\left(i \cdot x, -4, \mathsf{fma}\left(-4 \cdot a, t, c \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18, t \cdot \left(x \cdot \left(y \cdot z\right)\right), b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\\
\end{array}
\end{array}
if y < -8.9999999999999998e142Initial program 85.3%
Applied rewrites88.6%
Applied rewrites88.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6458.8
Applied rewrites58.8%
if -8.9999999999999998e142 < y < 1.35e184Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in x around 0
lower-*.f6478.6
Applied rewrites78.6%
if 1.35e184 < y Initial program 85.3%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.6
Applied rewrites71.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6455.1
Applied rewrites55.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (* y z))))
(if (<= y -2.1e+249)
(* t (fma -4.0 a (* 18.0 t_1)))
(if (<= y 1.35e+184)
(fma (* -27.0 k) j (fma (* i x) -4.0 (fma (* -4.0 a) t (* c b))))
(- (fma 18.0 (* t t_1) (* b c)) (* 4.0 (* i x)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * (y * z);
double tmp;
if (y <= -2.1e+249) {
tmp = t * fma(-4.0, a, (18.0 * t_1));
} else if (y <= 1.35e+184) {
tmp = fma((-27.0 * k), j, fma((i * x), -4.0, fma((-4.0 * a), t, (c * b))));
} else {
tmp = fma(18.0, (t * t_1), (b * c)) - (4.0 * (i * x));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(y * z)) tmp = 0.0 if (y <= -2.1e+249) tmp = Float64(t * fma(-4.0, a, Float64(18.0 * t_1))); elseif (y <= 1.35e+184) tmp = fma(Float64(-27.0 * k), j, fma(Float64(i * x), -4.0, fma(Float64(-4.0 * a), t, Float64(c * b)))); else tmp = Float64(fma(18.0, Float64(t * t_1), Float64(b * c)) - Float64(4.0 * Float64(i * x))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e+249], N[(t * N[(-4.0 * a + N[(18.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+184], N[(N[(-27.0 * k), $MachinePrecision] * j + N[(N[(i * x), $MachinePrecision] * -4.0 + N[(N[(-4.0 * a), $MachinePrecision] * t + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(18.0 * N[(t * t$95$1), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{+249}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot t\_1\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+184}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot k, j, \mathsf{fma}\left(i \cdot x, -4, \mathsf{fma}\left(-4 \cdot a, t, c \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18, t \cdot t\_1, b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\\
\end{array}
\end{array}
if y < -2.0999999999999998e249Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.4
Applied rewrites42.4%
if -2.0999999999999998e249 < y < 1.35e184Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in x around 0
lower-*.f6478.6
Applied rewrites78.6%
if 1.35e184 < y Initial program 85.3%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.6
Applied rewrites71.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6455.1
Applied rewrites55.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (fma -4.0 i (* 18.0 (* t (* y z)))))))
(if (<= x -5.2e+192)
t_1
(if (<= x -5.4e-16)
(- (fma 18.0 (* t (* x (* y z))) (* b c)) (* 4.0 (* i x)))
(if (<= x 1.2e+111)
(fma (* -27.0 k) j (fma -4.0 (* a t) (* b c)))
t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * fma(-4.0, i, (18.0 * (t * (y * z))));
double tmp;
if (x <= -5.2e+192) {
tmp = t_1;
} else if (x <= -5.4e-16) {
tmp = fma(18.0, (t * (x * (y * z))), (b * c)) - (4.0 * (i * x));
} else if (x <= 1.2e+111) {
tmp = fma((-27.0 * k), j, fma(-4.0, (a * t), (b * c)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * fma(-4.0, i, Float64(18.0 * Float64(t * Float64(y * z))))) tmp = 0.0 if (x <= -5.2e+192) tmp = t_1; elseif (x <= -5.4e-16) tmp = Float64(fma(18.0, Float64(t * Float64(x * Float64(y * z))), Float64(b * c)) - Float64(4.0 * Float64(i * x))); elseif (x <= 1.2e+111) tmp = fma(Float64(-27.0 * k), j, fma(-4.0, Float64(a * t), Float64(b * c))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(-4.0 * i + N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.2e+192], t$95$1, If[LessEqual[x, -5.4e-16], N[(N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.2e+111], N[(N[(-27.0 * k), $MachinePrecision] * j + N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.4 \cdot 10^{-16}:\\
\;\;\;\;\mathsf{fma}\left(18, t \cdot \left(x \cdot \left(y \cdot z\right)\right), b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+111}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot k, j, \mathsf{fma}\left(-4, a \cdot t, b \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.20000000000000006e192 or 1.20000000000000003e111 < x Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
if -5.20000000000000006e192 < x < -5.39999999999999999e-16Initial program 85.3%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.6
Applied rewrites71.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6455.1
Applied rewrites55.1%
if -5.39999999999999999e-16 < x < 1.20000000000000003e111Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6462.0
Applied rewrites62.0%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (fma -4.0 a (* 18.0 (* x (* y z)))))))
(if (<= t -1.08e+142)
t_1
(if (<= t -2.8e-37)
(- (* b c) (fma 4.0 (* a t) (* 27.0 (* j k))))
(if (<= t 4e+114)
(fma (* i -4.0) x (fma b c (* (* j k) -27.0)))
t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * fma(-4.0, a, (18.0 * (x * (y * z))));
double tmp;
if (t <= -1.08e+142) {
tmp = t_1;
} else if (t <= -2.8e-37) {
tmp = (b * c) - fma(4.0, (a * t), (27.0 * (j * k)));
} else if (t <= 4e+114) {
tmp = fma((i * -4.0), x, fma(b, c, ((j * k) * -27.0)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z))))) tmp = 0.0 if (t <= -1.08e+142) tmp = t_1; elseif (t <= -2.8e-37) tmp = Float64(Float64(b * c) - fma(4.0, Float64(a * t), Float64(27.0 * Float64(j * k)))); elseif (t <= 4e+114) tmp = fma(Float64(i * -4.0), x, fma(b, c, Float64(Float64(j * k) * -27.0))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.08e+142], t$95$1, If[LessEqual[t, -2.8e-37], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e+114], N[(N[(i * -4.0), $MachinePrecision] * x + N[(b * c + N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;t \leq -1.08 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{-37}:\\
\;\;\;\;b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot -4, x, \mathsf{fma}\left(b, c, \left(j \cdot k\right) \cdot -27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.08e142 or 4e114 < t Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.4
Applied rewrites42.4%
if -1.08e142 < t < -2.8000000000000001e-37Initial program 85.3%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.4
Applied rewrites61.4%
if -2.8000000000000001e-37 < t < 4e114Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites62.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (fma -4.0 a (* 18.0 (* x (* y z)))))))
(if (<= t -1.08e+142)
t_1
(if (<= t -2.9e-38)
(fma (* -27.0 k) j (fma -4.0 (* a t) (* b c)))
(if (<= t 4e+114)
(fma (* i -4.0) x (fma b c (* (* j k) -27.0)))
t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * fma(-4.0, a, (18.0 * (x * (y * z))));
double tmp;
if (t <= -1.08e+142) {
tmp = t_1;
} else if (t <= -2.9e-38) {
tmp = fma((-27.0 * k), j, fma(-4.0, (a * t), (b * c)));
} else if (t <= 4e+114) {
tmp = fma((i * -4.0), x, fma(b, c, ((j * k) * -27.0)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z))))) tmp = 0.0 if (t <= -1.08e+142) tmp = t_1; elseif (t <= -2.9e-38) tmp = fma(Float64(-27.0 * k), j, fma(-4.0, Float64(a * t), Float64(b * c))); elseif (t <= 4e+114) tmp = fma(Float64(i * -4.0), x, fma(b, c, Float64(Float64(j * k) * -27.0))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.08e+142], t$95$1, If[LessEqual[t, -2.9e-38], N[(N[(-27.0 * k), $MachinePrecision] * j + N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e+114], N[(N[(i * -4.0), $MachinePrecision] * x + N[(b * c + N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;t \leq -1.08 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.9 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot k, j, \mathsf{fma}\left(-4, a \cdot t, b \cdot c\right)\right)\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot -4, x, \mathsf{fma}\left(b, c, \left(j \cdot k\right) \cdot -27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.08e142 or 4e114 < t Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.4
Applied rewrites42.4%
if -1.08e142 < t < -2.89999999999999994e-38Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6462.0
Applied rewrites62.0%
if -2.89999999999999994e-38 < t < 4e114Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites62.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (fma -4.0 a (* 18.0 (* x (* y z)))))))
(if (<= t -2.9e+142)
t_1
(if (<= t 4e+114) (fma (* i -4.0) x (fma b c (* (* j k) -27.0))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * fma(-4.0, a, (18.0 * (x * (y * z))));
double tmp;
if (t <= -2.9e+142) {
tmp = t_1;
} else if (t <= 4e+114) {
tmp = fma((i * -4.0), x, fma(b, c, ((j * k) * -27.0)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z))))) tmp = 0.0 if (t <= -2.9e+142) tmp = t_1; elseif (t <= 4e+114) tmp = fma(Float64(i * -4.0), x, fma(b, c, Float64(Float64(j * k) * -27.0))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.9e+142], t$95$1, If[LessEqual[t, 4e+114], N[(N[(i * -4.0), $MachinePrecision] * x + N[(b * c + N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot -4, x, \mathsf{fma}\left(b, c, \left(j \cdot k\right) \cdot -27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.90000000000000013e142 or 4e114 < t Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.4
Applied rewrites42.4%
if -2.90000000000000013e142 < t < 4e114Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites62.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (fma -4.0 a (* 18.0 (* x (* y z)))))))
(if (<= t -1.35e+61)
t_1
(if (<= t -1.02e-144)
(fma c b (- (* (* j k) 27.0)))
(if (<= t -5e-275)
(- (* b c) (* 4.0 (* i x)))
(if (<= t 2.1e-169)
(fma (* i -4.0) x (* -27.0 (* j k)))
(if (<= t 1.6e+114) (fma -27.0 (* j k) (* b c)) t_1)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * fma(-4.0, a, (18.0 * (x * (y * z))));
double tmp;
if (t <= -1.35e+61) {
tmp = t_1;
} else if (t <= -1.02e-144) {
tmp = fma(c, b, -((j * k) * 27.0));
} else if (t <= -5e-275) {
tmp = (b * c) - (4.0 * (i * x));
} else if (t <= 2.1e-169) {
tmp = fma((i * -4.0), x, (-27.0 * (j * k)));
} else if (t <= 1.6e+114) {
tmp = fma(-27.0, (j * k), (b * c));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z))))) tmp = 0.0 if (t <= -1.35e+61) tmp = t_1; elseif (t <= -1.02e-144) tmp = fma(c, b, Float64(-Float64(Float64(j * k) * 27.0))); elseif (t <= -5e-275) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(i * x))); elseif (t <= 2.1e-169) tmp = fma(Float64(i * -4.0), x, Float64(-27.0 * Float64(j * k))); elseif (t <= 1.6e+114) tmp = fma(-27.0, Float64(j * k), Float64(b * c)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.35e+61], t$95$1, If[LessEqual[t, -1.02e-144], N[(c * b + (-N[(N[(j * k), $MachinePrecision] * 27.0), $MachinePrecision])), $MachinePrecision], If[LessEqual[t, -5e-275], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e-169], N[(N[(i * -4.0), $MachinePrecision] * x + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.6e+114], N[(-27.0 * N[(j * k), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.02 \cdot 10^{-144}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -\left(j \cdot k\right) \cdot 27\right)\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-275}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(i \cdot x\right)\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-169}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot -4, x, -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(-27, j \cdot k, b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.3500000000000001e61 or 1.6e114 < t Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.4
Applied rewrites42.4%
if -1.3500000000000001e61 < t < -1.01999999999999997e-144Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f6444.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6444.2
Applied rewrites44.2%
if -1.01999999999999997e-144 < t < -4.99999999999999983e-275Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6441.2
Applied rewrites41.2%
if -4.99999999999999983e-275 < t < 2.1000000000000001e-169Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites62.1%
Taylor expanded in b around 0
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
if 2.1000000000000001e-169 < t < 1.6e114Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites62.1%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (fma -4.0 a (* 18.0 (* x (* y z))))))
(t_2 (* x (fma -4.0 i (* 18.0 (* t (* y z)))))))
(if (<= x -1.05e+86)
t_2
(if (<= x -4.4e-21)
t_1
(if (<= x 7.7e-13)
(fma c b (- (* (* j k) 27.0)))
(if (<= x 2.35e+162) t_1 t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * fma(-4.0, a, (18.0 * (x * (y * z))));
double t_2 = x * fma(-4.0, i, (18.0 * (t * (y * z))));
double tmp;
if (x <= -1.05e+86) {
tmp = t_2;
} else if (x <= -4.4e-21) {
tmp = t_1;
} else if (x <= 7.7e-13) {
tmp = fma(c, b, -((j * k) * 27.0));
} else if (x <= 2.35e+162) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z))))) t_2 = Float64(x * fma(-4.0, i, Float64(18.0 * Float64(t * Float64(y * z))))) tmp = 0.0 if (x <= -1.05e+86) tmp = t_2; elseif (x <= -4.4e-21) tmp = t_1; elseif (x <= 7.7e-13) tmp = fma(c, b, Float64(-Float64(Float64(j * k) * 27.0))); elseif (x <= 2.35e+162) tmp = t_1; else tmp = t_2; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(-4.0 * i + N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e+86], t$95$2, If[LessEqual[x, -4.4e-21], t$95$1, If[LessEqual[x, 7.7e-13], N[(c * b + (-N[(N[(j * k), $MachinePrecision] * 27.0), $MachinePrecision])), $MachinePrecision], If[LessEqual[x, 2.35e+162], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
t_2 := x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+86}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -4.4 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.7 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -\left(j \cdot k\right) \cdot 27\right)\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{+162}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -1.0499999999999999e86 or 2.35000000000000001e162 < x Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
if -1.0499999999999999e86 < x < -4.4000000000000001e-21 or 7.6999999999999995e-13 < x < 2.35000000000000001e162Initial program 85.3%
Applied rewrites88.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.4
Applied rewrites42.4%
if -4.4000000000000001e-21 < x < 7.6999999999999995e-13Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f6444.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6444.2
Applied rewrites44.2%
NOTE: x, y, z, t, a, b, c, i, j, and k 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 (fma (* -27.0 k) j (* -4.0 (* a t)))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -500000000000.0)
t_1
(if (<= t_2 1e+86) (- (* b c) (* 4.0 (* i x))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
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 = fma((-27.0 * k), j, (-4.0 * (a * t)));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -500000000000.0) {
tmp = t_1;
} else if (t_2 <= 1e+86) {
tmp = (b * c) - (4.0 * (i * x));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(Float64(-27.0 * k), j, Float64(-4.0 * Float64(a * t))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -500000000000.0) tmp = t_1; elseif (t_2 <= 1e+86) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(i * x))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k 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[(-27.0 * k), $MachinePrecision] * j + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -500000000000.0], t$95$1, If[LessEqual[t$95$2, 1e+86], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-27 \cdot k, j, -4 \cdot \left(a \cdot t\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -500000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+86}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(i \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5e11 or 1e86 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.3%
Applied rewrites88.6%
Applied rewrites88.2%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6462.0
Applied rewrites62.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6442.7
Applied rewrites42.7%
if -5e11 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1e86Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6441.2
Applied rewrites41.2%
NOTE: x, y, z, t, a, b, c, i, j, and k 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) -4e+200)
(fma -27.0 (* j k) (* b c))
(if (<= (* b c) 2e+124)
(fma (* i -4.0) x (* -27.0 (* j k)))
(- (* b c) (* 4.0 (* i x))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
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) <= -4e+200) {
tmp = fma(-27.0, (j * k), (b * c));
} else if ((b * c) <= 2e+124) {
tmp = fma((i * -4.0), x, (-27.0 * (j * k)));
} else {
tmp = (b * c) - (4.0 * (i * x));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -4e+200) tmp = fma(-27.0, Float64(j * k), Float64(b * c)); elseif (Float64(b * c) <= 2e+124) tmp = fma(Float64(i * -4.0), x, Float64(-27.0 * Float64(j * k))); else tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(i * x))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k 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], -4e+200], N[(-27.0 * N[(j * k), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+124], N[(N[(i * -4.0), $MachinePrecision] * x + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -4 \cdot 10^{+200}:\\
\;\;\;\;\mathsf{fma}\left(-27, j \cdot k, b \cdot c\right)\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+124}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot -4, x, -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(i \cdot x\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -3.9999999999999999e200Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites62.1%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
if -3.9999999999999999e200 < (*.f64 b c) < 1.9999999999999999e124Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites62.1%
Taylor expanded in b around 0
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
if 1.9999999999999999e124 < (*.f64 b c) Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6441.2
Applied rewrites41.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -2e+33)
(fma -27.0 (* j k) (* b c))
(if (<= t_1 2e+18)
(- (* b c) (* 4.0 (* i x)))
(fma c b (- (* (* j k) 27.0)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+33) {
tmp = fma(-27.0, (j * k), (b * c));
} else if (t_1 <= 2e+18) {
tmp = (b * c) - (4.0 * (i * x));
} else {
tmp = fma(c, b, -((j * k) * 27.0));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -2e+33) tmp = fma(-27.0, Float64(j * k), Float64(b * c)); elseif (t_1 <= 2e+18) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(i * x))); else tmp = fma(c, b, Float64(-Float64(Float64(j * k) * 27.0))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k 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[t$95$1, -2e+33], N[(-27.0 * N[(j * k), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+18], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * b + (-N[(N[(j * k), $MachinePrecision] * 27.0), $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(-27, j \cdot k, b \cdot c\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+18}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(i \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -\left(j \cdot k\right) \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.9999999999999999e33Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites62.1%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
if -1.9999999999999999e33 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e18Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6441.2
Applied rewrites41.2%
if 2e18 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f6444.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6444.2
Applied rewrites44.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -2e+33)
(fma -27.0 (* j k) (* b c))
(if (<= t_1 2e+18)
(- (* b c) (* 4.0 (* i x)))
(- (* b c) (* (* 27.0 j) k))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+33) {
tmp = fma(-27.0, (j * k), (b * c));
} else if (t_1 <= 2e+18) {
tmp = (b * c) - (4.0 * (i * x));
} else {
tmp = (b * c) - ((27.0 * j) * k);
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -2e+33) tmp = fma(-27.0, Float64(j * k), Float64(b * c)); elseif (t_1 <= 2e+18) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(i * x))); else tmp = Float64(Float64(b * c) - Float64(Float64(27.0 * j) * k)); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k 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[t$95$1, -2e+33], N[(-27.0 * N[(j * k), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+18], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(N[(27.0 * j), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(-27, j \cdot k, b \cdot c\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+18}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(i \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - \left(27 \cdot j\right) \cdot k\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.9999999999999999e33Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites62.1%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
if -1.9999999999999999e33 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e18Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6441.2
Applied rewrites41.2%
if 2e18 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.8
Applied rewrites43.8%
NOTE: x, y, z, t, a, b, c, i, j, and k 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 (fma -27.0 (* j k) (* b c))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -2e+33)
t_1
(if (<= t_2 2e+18) (- (* b c) (* 4.0 (* i x))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
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 = fma(-27.0, (j * k), (b * c));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+33) {
tmp = t_1;
} else if (t_2 <= 2e+18) {
tmp = (b * c) - (4.0 * (i * x));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(-27.0, Float64(j * k), Float64(b * c)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e+33) tmp = t_1; elseif (t_2 <= 2e+18) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(i * x))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k 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[(-27.0 * N[(j * k), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+33], t$95$1, If[LessEqual[t$95$2, 2e+18], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-27, j \cdot k, b \cdot c\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+18}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(i \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.9999999999999999e33 or 2e18 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites62.1%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
if -1.9999999999999999e33 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e18Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6441.2
Applied rewrites41.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (* i x))))
(if (<= x -2.1e+172)
t_1
(if (<= x 9.5e+195) (fma -27.0 (* j k) (* b c)) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (i * x);
double tmp;
if (x <= -2.1e+172) {
tmp = t_1;
} else if (x <= 9.5e+195) {
tmp = fma(-27.0, (j * k), (b * c));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(i * x)) tmp = 0.0 if (x <= -2.1e+172) tmp = t_1; elseif (x <= 9.5e+195) tmp = fma(-27.0, Float64(j * k), Float64(b * c)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+172], t$95$1, If[LessEqual[x, 9.5e+195], N[(-27.0 * N[(j * k), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(i \cdot x\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+195}:\\
\;\;\;\;\mathsf{fma}\left(-27, j \cdot k, b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.1000000000000001e172 or 9.5000000000000004e195 < x Initial program 85.3%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6421.5
Applied rewrites21.5%
if -2.1000000000000001e172 < x < 9.5000000000000004e195Initial program 85.3%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites62.1%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -2e+111)
(* -27.0 (* j k))
(if (<= t_1 2000.0) (* -4.0 (* i x)) (* (* j -27.0) k)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+111) {
tmp = -27.0 * (j * k);
} else if (t_1 <= 2000.0) {
tmp = -4.0 * (i * x);
} else {
tmp = (j * -27.0) * k;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t_1 <= (-2d+111)) then
tmp = (-27.0d0) * (j * k)
else if (t_1 <= 2000.0d0) then
tmp = (-4.0d0) * (i * x)
else
tmp = (j * (-27.0d0)) * k
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+111) {
tmp = -27.0 * (j * k);
} else if (t_1 <= 2000.0) {
tmp = -4.0 * (i * x);
} else {
tmp = (j * -27.0) * k;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t_1 <= -2e+111: tmp = -27.0 * (j * k) elif t_1 <= 2000.0: tmp = -4.0 * (i * x) else: tmp = (j * -27.0) * k return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -2e+111) tmp = Float64(-27.0 * Float64(j * k)); elseif (t_1 <= 2000.0) tmp = Float64(-4.0 * Float64(i * x)); else tmp = Float64(Float64(j * -27.0) * k); end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (t_1 <= -2e+111)
tmp = -27.0 * (j * k);
elseif (t_1 <= 2000.0)
tmp = -4.0 * (i * x);
else
tmp = (j * -27.0) * k;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k 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[t$95$1, -2e+111], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2000.0], N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision], N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+111}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t\_1 \leq 2000:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot -27\right) \cdot k\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.99999999999999991e111Initial program 85.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.0
Applied rewrites24.0%
if -1.99999999999999991e111 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e3Initial program 85.3%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6421.5
Applied rewrites21.5%
if 2e3 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.0
Applied rewrites24.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6424.0
Applied rewrites24.0%
NOTE: x, y, z, t, a, b, c, i, j, and k 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 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k))) (if (<= t_2 -2e+111) t_1 (if (<= t_2 2000.0) (* -4.0 (* i x)) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
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 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+111) {
tmp = t_1;
} else if (t_2 <= 2000.0) {
tmp = -4.0 * (i * x);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
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 = (-27.0d0) * (j * k)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-2d+111)) then
tmp = t_1
else if (t_2 <= 2000.0d0) then
tmp = (-4.0d0) * (i * x)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
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 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+111) {
tmp = t_1;
} else if (t_2 <= 2000.0) {
tmp = -4.0 * (i * x);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -2e+111: tmp = t_1 elif t_2 <= 2000.0: tmp = -4.0 * (i * x) else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e+111) tmp = t_1; elseif (t_2 <= 2000.0) tmp = Float64(-4.0 * Float64(i * x)); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (j * k);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -2e+111)
tmp = t_1;
elseif (t_2 <= 2000.0)
tmp = -4.0 * (i * x);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k 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[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+111], t$95$1, If[LessEqual[t$95$2, 2000.0], N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2000:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.99999999999999991e111 or 2e3 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.0
Applied rewrites24.0%
if -1.99999999999999991e111 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e3Initial program 85.3%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6421.5
Applied rewrites21.5%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (* -27.0 (* j k)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return -27.0 * (j * k);
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (-27.0d0) * (j * k)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return -27.0 * (j * k);
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): return -27.0 * (j * k)
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(-27.0 * Float64(j * k)) end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = -27.0 * (j * k);
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
-27 \cdot \left(j \cdot k\right)
\end{array}
Initial program 85.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.0
Applied rewrites24.0%
herbie shell --seed 2025155
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))