
(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 18 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
(if (<= t -1e+20)
(fma
(* i x)
-4.0
(fma c b (fma (fma -4.0 a (* z (* y (* 18.0 x)))) t (* (* -27.0 j) k))))
(fma
(* t a)
-4.0
(fma (* -27.0 j) k (fma b c (* (fma z (* y (* 18.0 t)) (* i -4.0)) 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 (t <= -1e+20) {
tmp = fma((i * x), -4.0, fma(c, b, fma(fma(-4.0, a, (z * (y * (18.0 * x)))), t, ((-27.0 * j) * k))));
} else {
tmp = fma((t * a), -4.0, fma((-27.0 * j), k, fma(b, c, (fma(z, (y * (18.0 * t)), (i * -4.0)) * 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 (t <= -1e+20) tmp = fma(Float64(i * x), -4.0, fma(c, b, fma(fma(-4.0, a, Float64(z * Float64(y * Float64(18.0 * x)))), t, Float64(Float64(-27.0 * j) * k)))); else tmp = fma(Float64(t * a), -4.0, fma(Float64(-27.0 * j), k, fma(b, c, Float64(fma(z, Float64(y * Float64(18.0 * t)), Float64(i * -4.0)) * 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[t, -1e+20], N[(N[(i * x), $MachinePrecision] * -4.0 + N[(c * b + N[(N[(-4.0 * a + N[(z * N[(y * N[(18.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * a), $MachinePrecision] * -4.0 + N[(N[(-27.0 * j), $MachinePrecision] * k + N[(b * c + N[(N[(z * N[(y * N[(18.0 * t), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $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}\;t \leq -1 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot x, -4, \mathsf{fma}\left(c, b, \mathsf{fma}\left(\mathsf{fma}\left(-4, a, z \cdot \left(y \cdot \left(18 \cdot x\right)\right)\right), t, \left(-27 \cdot j\right) \cdot k\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot a, -4, \mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(b, c, \mathsf{fma}\left(z, y \cdot \left(18 \cdot t\right), i \cdot -4\right) \cdot x\right)\right)\right)\\
\end{array}
\end{array}
if t < -1e20Initial program 85.7%
Applied rewrites88.8%
if -1e20 < t Initial program 85.7%
Applied rewrites87.9%
Applied rewrites89.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 (<=
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
5e+303)
(fma
(* i x)
-4.0
(fma c b (fma (fma -4.0 a (* z (* y (* 18.0 x)))) t (* (* -27.0 j) k))))
(fma -4.0 (* a t) (fma b c (* x (fma -4.0 i (* 18.0 (* t (* y z)))))))))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 * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= 5e+303) {
tmp = fma((i * x), -4.0, fma(c, b, fma(fma(-4.0, a, (z * (y * (18.0 * x)))), t, ((-27.0 * j) * k))));
} else {
tmp = fma(-4.0, (a * t), fma(b, c, (x * fma(-4.0, i, (18.0 * (t * (y * z)))))));
}
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(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)) <= 5e+303) tmp = fma(Float64(i * x), -4.0, fma(c, b, fma(fma(-4.0, a, Float64(z * Float64(y * Float64(18.0 * x)))), t, Float64(Float64(-27.0 * j) * k)))); else tmp = fma(-4.0, Float64(a * t), fma(b, c, Float64(x * fma(-4.0, i, Float64(18.0 * Float64(t * Float64(y * z))))))); 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[(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], 5e+303], N[(N[(i * x), $MachinePrecision] * -4.0 + N[(c * b + N[(N[(-4.0 * a + N[(z * N[(y * N[(18.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b * c + N[(x * N[(-4.0 * i + N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\;\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 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot x, -4, \mathsf{fma}\left(c, b, \mathsf{fma}\left(\mathsf{fma}\left(-4, a, z \cdot \left(y \cdot \left(18 \cdot x\right)\right)\right), t, \left(-27 \cdot j\right) \cdot k\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < 4.9999999999999997e303Initial program 85.7%
Applied rewrites88.8%
if 4.9999999999999997e303 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) Initial program 85.7%
Applied rewrites87.9%
Applied rewrites89.2%
Taylor expanded in j around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.5
Applied rewrites72.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
(if (<=
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
5e+303)
(fma
(* -27.0 k)
j
(fma (* i x) -4.0 (fma (fma -4.0 a (* z (* y (* 18.0 x)))) t (* c b))))
(fma -4.0 (* a t) (fma b c (* x (fma -4.0 i (* 18.0 (* t (* y z)))))))))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 * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= 5e+303) {
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 = fma(-4.0, (a * t), fma(b, c, (x * fma(-4.0, i, (18.0 * (t * (y * z)))))));
}
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(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)) <= 5e+303) 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 = fma(-4.0, Float64(a * t), fma(b, c, Float64(x * fma(-4.0, i, Float64(18.0 * Float64(t * Float64(y * z))))))); 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[(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], 5e+303], 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], N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b * c + N[(x * N[(-4.0 * i + N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\;\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 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;\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}:\\
\;\;\;\;\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < 4.9999999999999997e303Initial program 85.7%
Applied rewrites89.3%
if 4.9999999999999997e303 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) Initial program 85.7%
Applied rewrites87.9%
Applied rewrites89.2%
Taylor expanded in j around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.5
Applied rewrites72.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
(let* ((t_1
(fma
-27.0
(* j k)
(fma b c (* t (fma -4.0 a (* 18.0 (* x (* y z)))))))))
(if (<= t -4.9e-14)
t_1
(if (<= t 1.75)
(fma (* t a) -4.0 (fma (* -27.0 j) k (fma 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), fma(b, c, (t * fma(-4.0, a, (18.0 * (x * (y * z)))))));
double tmp;
if (t <= -4.9e-14) {
tmp = t_1;
} else if (t <= 1.75) {
tmp = fma((t * a), -4.0, fma((-27.0 * j), k, fma(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), fma(b, c, Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z))))))) tmp = 0.0 if (t <= -4.9e-14) tmp = t_1; elseif (t <= 1.75) tmp = fma(Float64(t * a), -4.0, fma(Float64(-27.0 * j), k, fma(b, c, Float64(Float64(-4.0 * 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 + N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.9e-14], t$95$1, If[LessEqual[t, 1.75], N[(N[(t * a), $MachinePrecision] * -4.0 + N[(N[(-27.0 * j), $MachinePrecision] * k + N[(b * c + N[(N[(-4.0 * i), $MachinePrecision] * x), $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(-27, j \cdot k, \mathsf{fma}\left(b, c, t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right)\right)\\
\mathbf{if}\;t \leq -4.9 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.75:\\
\;\;\;\;\mathsf{fma}\left(t \cdot a, -4, \mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(b, c, \left(-4 \cdot i\right) \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.89999999999999995e-14 or 1.75 < t Initial program 85.7%
Applied rewrites89.3%
Taylor expanded in i around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6475.8
Applied rewrites75.8%
if -4.89999999999999995e-14 < t < 1.75Initial program 85.7%
Applied rewrites87.9%
Applied rewrites89.2%
Taylor expanded in y around 0
lower-*.f6477.5
Applied rewrites77.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 (if (<= z 4.9e+219) (fma (* t a) -4.0 (fma (* -27.0 j) k (fma b c (* (* -4.0 i) x)))) (* (fma (* (* 18.0 x) y) z (* -4.0 a)) t)))
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 (z <= 4.9e+219) {
tmp = fma((t * a), -4.0, fma((-27.0 * j), k, fma(b, c, ((-4.0 * i) * x))));
} else {
tmp = fma(((18.0 * x) * y), z, (-4.0 * a)) * t;
}
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 (z <= 4.9e+219) tmp = fma(Float64(t * a), -4.0, fma(Float64(-27.0 * j), k, fma(b, c, Float64(Float64(-4.0 * i) * x)))); else tmp = Float64(fma(Float64(Float64(18.0 * x) * y), z, Float64(-4.0 * a)) * t); 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[z, 4.9e+219], N[(N[(t * a), $MachinePrecision] * -4.0 + N[(N[(-27.0 * j), $MachinePrecision] * k + N[(b * c + N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(18.0 * x), $MachinePrecision] * y), $MachinePrecision] * z + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t), $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}\;z \leq 4.9 \cdot 10^{+219}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot a, -4, \mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(b, c, \left(-4 \cdot i\right) \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(18 \cdot x\right) \cdot y, z, -4 \cdot a\right) \cdot t\\
\end{array}
\end{array}
if z < 4.90000000000000003e219Initial program 85.7%
Applied rewrites87.9%
Applied rewrites89.2%
Taylor expanded in y around 0
lower-*.f6477.5
Applied rewrites77.5%
if 4.90000000000000003e219 < z Initial program 85.7%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
Applied rewrites43.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 (<= z 4.9e+219) (fma (* -27.0 k) j (fma (* i x) -4.0 (fma (* -4.0 a) t (* c b)))) (* (fma (* (* 18.0 x) y) z (* -4.0 a)) t)))
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 (z <= 4.9e+219) {
tmp = fma((-27.0 * k), j, fma((i * x), -4.0, fma((-4.0 * a), t, (c * b))));
} else {
tmp = fma(((18.0 * x) * y), z, (-4.0 * a)) * t;
}
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 (z <= 4.9e+219) 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(Float64(Float64(18.0 * x) * y), z, Float64(-4.0 * a)) * t); 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[z, 4.9e+219], 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[(N[(N[(18.0 * x), $MachinePrecision] * y), $MachinePrecision] * z + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t), $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}\;z \leq 4.9 \cdot 10^{+219}:\\
\;\;\;\;\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(\left(18 \cdot x\right) \cdot y, z, -4 \cdot a\right) \cdot t\\
\end{array}
\end{array}
if z < 4.90000000000000003e219Initial program 85.7%
Applied rewrites89.3%
Taylor expanded in x around 0
lower-*.f6477.9
Applied rewrites77.9%
if 4.90000000000000003e219 < z Initial program 85.7%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
Applied rewrites43.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 (* x (fma (* (* 18.0 t) y) z (* i -4.0)))))
(if (<= x -95.0)
t_1
(if (<= x 1.22e-26)
(fma c b (fma (* -27.0 k) j (* (* -4.0 a) t)))
(if (<= x 7.8e+208)
(fma -27.0 (* j k) (fma -4.0 (* i x) (* 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(((18.0 * t) * y), z, (i * -4.0));
double tmp;
if (x <= -95.0) {
tmp = t_1;
} else if (x <= 1.22e-26) {
tmp = fma(c, b, fma((-27.0 * k), j, ((-4.0 * a) * t)));
} else if (x <= 7.8e+208) {
tmp = fma(-27.0, (j * k), fma(-4.0, (i * x), (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(Float64(Float64(18.0 * t) * y), z, Float64(i * -4.0))) tmp = 0.0 if (x <= -95.0) tmp = t_1; elseif (x <= 1.22e-26) tmp = fma(c, b, fma(Float64(-27.0 * k), j, Float64(Float64(-4.0 * a) * t))); elseif (x <= 7.8e+208) tmp = fma(-27.0, Float64(j * k), fma(-4.0, Float64(i * x), 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[(N[(N[(18.0 * t), $MachinePrecision] * y), $MachinePrecision] * z + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -95.0], t$95$1, If[LessEqual[x, 1.22e-26], N[(c * b + N[(N[(-27.0 * k), $MachinePrecision] * j + N[(N[(-4.0 * a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.8e+208], N[(-27.0 * N[(j * k), $MachinePrecision] + N[(-4.0 * N[(i * x), $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(\left(18 \cdot t\right) \cdot y, z, i \cdot -4\right)\\
\mathbf{if}\;x \leq -95:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-26}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(-27 \cdot k, j, \left(-4 \cdot a\right) \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+208}:\\
\;\;\;\;\mathsf{fma}\left(-27, j \cdot k, \mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -95 or 7.8000000000000001e208 < x Initial program 85.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.4
Applied rewrites42.4%
Applied rewrites43.6%
if -95 < x < 1.22e-26Initial program 85.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
sub-negateN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
Applied rewrites61.4%
if 1.22e-26 < x < 7.8000000000000001e208Initial program 85.7%
Applied rewrites89.3%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6460.5
Applied rewrites60.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
(if (<= t -1.95e-13)
(* (fma (* (* 18.0 x) y) z (* -4.0 a)) t)
(if (<= t 1.75e+166)
(fma -27.0 (* j k) (fma -4.0 (* i x) (* b c)))
(* t (fma -4.0 a (* 18.0 (* x (* y z))))))))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 (t <= -1.95e-13) {
tmp = fma(((18.0 * x) * y), z, (-4.0 * a)) * t;
} else if (t <= 1.75e+166) {
tmp = fma(-27.0, (j * k), fma(-4.0, (i * x), (b * c)));
} else {
tmp = t * fma(-4.0, a, (18.0 * (x * (y * z))));
}
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 (t <= -1.95e-13) tmp = Float64(fma(Float64(Float64(18.0 * x) * y), z, Float64(-4.0 * a)) * t); elseif (t <= 1.75e+166) tmp = fma(-27.0, Float64(j * k), fma(-4.0, Float64(i * x), Float64(b * c))); else tmp = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z))))); 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[t, -1.95e-13], N[(N[(N[(N[(18.0 * x), $MachinePrecision] * y), $MachinePrecision] * z + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, 1.75e+166], N[(-27.0 * N[(j * k), $MachinePrecision] + N[(-4.0 * N[(i * x), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $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}\;t \leq -1.95 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(\left(18 \cdot x\right) \cdot y, z, -4 \cdot a\right) \cdot t\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+166}:\\
\;\;\;\;\mathsf{fma}\left(-27, j \cdot k, \mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if t < -1.95000000000000002e-13Initial program 85.7%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
Applied rewrites43.6%
if -1.95000000000000002e-13 < t < 1.7499999999999999e166Initial program 85.7%
Applied rewrites89.3%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6460.5
Applied rewrites60.5%
if 1.7499999999999999e166 < t Initial program 85.7%
Applied rewrites87.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.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 (* x (fma (* (* 18.0 t) y) z (* i -4.0)))))
(if (<= x -29.0)
t_1
(if (<= x -1.2e-243)
(fma c b (- (* (* 27.0 j) k)))
(if (<= x 4.6e-22) (- (* b c) (* 4.0 (* a t))) 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(((18.0 * t) * y), z, (i * -4.0));
double tmp;
if (x <= -29.0) {
tmp = t_1;
} else if (x <= -1.2e-243) {
tmp = fma(c, b, -((27.0 * j) * k));
} else if (x <= 4.6e-22) {
tmp = (b * c) - (4.0 * (a * t));
} 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(Float64(Float64(18.0 * t) * y), z, Float64(i * -4.0))) tmp = 0.0 if (x <= -29.0) tmp = t_1; elseif (x <= -1.2e-243) tmp = fma(c, b, Float64(-Float64(Float64(27.0 * j) * k))); elseif (x <= 4.6e-22) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); 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[(N[(N[(18.0 * t), $MachinePrecision] * y), $MachinePrecision] * z + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -29.0], t$95$1, If[LessEqual[x, -1.2e-243], N[(c * b + (-N[(N[(27.0 * j), $MachinePrecision] * k), $MachinePrecision])), $MachinePrecision], If[LessEqual[x, 4.6e-22], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $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(\left(18 \cdot t\right) \cdot y, z, i \cdot -4\right)\\
\mathbf{if}\;x \leq -29:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-243}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right)\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{-22}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -29 or 4.5999999999999996e-22 < x Initial program 85.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.4
Applied rewrites42.4%
Applied rewrites43.6%
if -29 < x < -1.2e-243Initial program 85.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6443.5
Applied rewrites43.5%
lift--.f64N/A
sub-flipN/A
add-flipN/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
remove-double-negN/A
lower-fma.f64N/A
lower-neg.f6443.8
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.8
Applied rewrites43.8%
if -1.2e-243 < x < 4.5999999999999996e-22Initial program 85.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
Taylor expanded in j around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.5
Applied rewrites41.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
(if (<= (* b c) -2e+195)
(fma c b (- (* (* 27.0 j) k)))
(if (<= (* b c) -5e-104)
(* t (fma -4.0 a (* 18.0 (* x (* y z)))))
(if (<= (* b c) 2e+83)
(* -1.0 (fma 4.0 (* a t) (* 27.0 (* j k))))
(- (* b c) (* 4.0 (* a t)))))))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) <= -2e+195) {
tmp = fma(c, b, -((27.0 * j) * k));
} else if ((b * c) <= -5e-104) {
tmp = t * fma(-4.0, a, (18.0 * (x * (y * z))));
} else if ((b * c) <= 2e+83) {
tmp = -1.0 * fma(4.0, (a * t), (27.0 * (j * k)));
} else {
tmp = (b * c) - (4.0 * (a * t));
}
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) <= -2e+195) tmp = fma(c, b, Float64(-Float64(Float64(27.0 * j) * k))); elseif (Float64(b * c) <= -5e-104) tmp = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z))))); elseif (Float64(b * c) <= 2e+83) tmp = Float64(-1.0 * fma(4.0, Float64(a * t), Float64(27.0 * Float64(j * k)))); else tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); 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], -2e+195], N[(c * b + (-N[(N[(27.0 * j), $MachinePrecision] * k), $MachinePrecision])), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -5e-104], N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+83], N[(-1.0 * N[(4.0 * N[(a * t), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $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 -2 \cdot 10^{+195}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq -5 \cdot 10^{-104}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+83}:\\
\;\;\;\;-1 \cdot \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -1.99999999999999995e195Initial program 85.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6443.5
Applied rewrites43.5%
lift--.f64N/A
sub-flipN/A
add-flipN/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
remove-double-negN/A
lower-fma.f64N/A
lower-neg.f6443.8
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.8
Applied rewrites43.8%
if -1.99999999999999995e195 < (*.f64 b c) < -4.99999999999999979e-104Initial program 85.7%
Applied rewrites87.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
if -4.99999999999999979e-104 < (*.f64 b c) < 2.00000000000000006e83Initial program 85.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
Taylor expanded in b around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.8
Applied rewrites41.8%
if 2.00000000000000006e83 < (*.f64 b c) Initial program 85.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
Taylor expanded in j around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.5
Applied rewrites41.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
(let* ((t_1 (* t (fma -4.0 a (* 18.0 (* x (* y z)))))))
(if (<= t -1e-43)
t_1
(if (<= t 4.5e+30) (fma c b (- (* (* 27.0 j) k))) 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 <= -1e-43) {
tmp = t_1;
} else if (t <= 4.5e+30) {
tmp = fma(c, b, -((27.0 * j) * k));
} 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 <= -1e-43) tmp = t_1; elseif (t <= 4.5e+30) tmp = fma(c, b, Float64(-Float64(Float64(27.0 * j) * k))); 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, -1e-43], t$95$1, If[LessEqual[t, 4.5e+30], N[(c * b + (-N[(N[(27.0 * j), $MachinePrecision] * k), $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 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.00000000000000008e-43 or 4.49999999999999995e30 < t Initial program 85.7%
Applied rewrites87.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
if -1.00000000000000008e-43 < t < 4.49999999999999995e30Initial program 85.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6443.5
Applied rewrites43.5%
lift--.f64N/A
sub-flipN/A
add-flipN/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
remove-double-negN/A
lower-fma.f64N/A
lower-neg.f6443.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 (* (* j 27.0) k)))
(if (<= t_1 -5e+53)
(fma c b (- (* (* 27.0 j) k)))
(if (<= t_1 2e+43)
(- (* b c) (* 4.0 (* a t)))
(- (* 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 <= -5e+53) {
tmp = fma(c, b, -((27.0 * j) * k));
} else if (t_1 <= 2e+43) {
tmp = (b * c) - (4.0 * (a * t));
} 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 <= -5e+53) tmp = fma(c, b, Float64(-Float64(Float64(27.0 * j) * k))); elseif (t_1 <= 2e+43) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); else tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(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, -5e+53], N[(c * b + (-N[(N[(27.0 * j), $MachinePrecision] * k), $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$1, 2e+43], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $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 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+53}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+43}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5.0000000000000004e53Initial program 85.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6443.5
Applied rewrites43.5%
lift--.f64N/A
sub-flipN/A
add-flipN/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
remove-double-negN/A
lower-fma.f64N/A
lower-neg.f6443.8
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.8
Applied rewrites43.8%
if -5.0000000000000004e53 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000003e43Initial program 85.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
Taylor expanded in j around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.5
Applied rewrites41.5%
if 2.00000000000000003e43 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6443.5
Applied rewrites43.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
(let* ((t_1 (- (* b c) (* 27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -5e+53)
t_1
(if (<= t_2 2e+43) (- (* b c) (* 4.0 (* a t))) 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 = (b * c) - (27.0 * (j * k));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e+53) {
tmp = t_1;
} else if (t_2 <= 2e+43) {
tmp = (b * c) - (4.0 * (a * t));
} 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 = (b * c) - (27.0d0 * (j * k))
t_2 = (j * 27.0d0) * k
if (t_2 <= (-5d+53)) then
tmp = t_1
else if (t_2 <= 2d+43) then
tmp = (b * c) - (4.0d0 * (a * t))
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 = (b * c) - (27.0 * (j * k));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e+53) {
tmp = t_1;
} else if (t_2 <= 2e+43) {
tmp = (b * c) - (4.0 * (a * t));
} 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 = (b * c) - (27.0 * (j * k)) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -5e+53: tmp = t_1 elif t_2 <= 2e+43: tmp = (b * c) - (4.0 * (a * t)) 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(b * c) - Float64(27.0 * Float64(j * k))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -5e+53) tmp = t_1; elseif (t_2 <= 2e+43) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); 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 = (b * c) - (27.0 * (j * k));
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -5e+53)
tmp = t_1;
elseif (t_2 <= 2e+43)
tmp = (b * c) - (4.0 * (a * t));
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[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+53], t$95$1, If[LessEqual[t$95$2, 2e+43], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $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 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+43}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5.0000000000000004e53 or 2.00000000000000003e43 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6443.5
Applied rewrites43.5%
if -5.0000000000000004e53 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000003e43Initial program 85.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
Taylor expanded in j around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.5
Applied rewrites41.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
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -1e+152)
(* (* -27.0 j) k)
(if (<= t_1 1e+125) (- (* b c) (* 4.0 (* a t))) (* (* -27.0 k) j)))))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 <= -1e+152) {
tmp = (-27.0 * j) * k;
} else if (t_1 <= 1e+125) {
tmp = (b * c) - (4.0 * (a * t));
} else {
tmp = (-27.0 * k) * j;
}
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 <= (-1d+152)) then
tmp = ((-27.0d0) * j) * k
else if (t_1 <= 1d+125) then
tmp = (b * c) - (4.0d0 * (a * t))
else
tmp = ((-27.0d0) * k) * j
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 <= -1e+152) {
tmp = (-27.0 * j) * k;
} else if (t_1 <= 1e+125) {
tmp = (b * c) - (4.0 * (a * t));
} else {
tmp = (-27.0 * k) * j;
}
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 <= -1e+152: tmp = (-27.0 * j) * k elif t_1 <= 1e+125: tmp = (b * c) - (4.0 * (a * t)) else: tmp = (-27.0 * k) * j 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 <= -1e+152) tmp = Float64(Float64(-27.0 * j) * k); elseif (t_1 <= 1e+125) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); else tmp = Float64(Float64(-27.0 * k) * j); 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 <= -1e+152)
tmp = (-27.0 * j) * k;
elseif (t_1 <= 1e+125)
tmp = (b * c) - (4.0 * (a * t));
else
tmp = (-27.0 * k) * j;
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, -1e+152], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision], If[LessEqual[t$95$1, 1e+125], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * k), $MachinePrecision] * j), $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 -1 \cdot 10^{+152}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\mathbf{elif}\;t\_1 \leq 10^{+125}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot k\right) \cdot j\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1e152Initial program 85.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.5
Applied rewrites23.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6423.5
Applied rewrites23.5%
if -1e152 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.9999999999999992e124Initial program 85.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
Taylor expanded in j around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.5
Applied rewrites41.5%
if 9.9999999999999992e124 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.5
Applied rewrites23.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6423.5
Applied rewrites23.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
(let* ((t_1
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))))
(if (<= t_1 -2e+199)
(* -4.0 (* a t))
(if (<= t_1 5e+120) (* (* -27.0 k) j) (* -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 * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
double tmp;
if (t_1 <= -2e+199) {
tmp = -4.0 * (a * t);
} else if (t_1 <= 5e+120) {
tmp = (-27.0 * k) * j;
} else {
tmp = -4.0 * (i * x);
}
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 = ((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)
if (t_1 <= (-2d+199)) then
tmp = (-4.0d0) * (a * t)
else if (t_1 <= 5d+120) then
tmp = ((-27.0d0) * k) * j
else
tmp = (-4.0d0) * (i * x)
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 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
double tmp;
if (t_1 <= -2e+199) {
tmp = -4.0 * (a * t);
} else if (t_1 <= 5e+120) {
tmp = (-27.0 * k) * j;
} else {
tmp = -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]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i) tmp = 0 if t_1 <= -2e+199: tmp = -4.0 * (a * t) elif t_1 <= 5e+120: tmp = (-27.0 * k) * j else: tmp = -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(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)) tmp = 0.0 if (t_1 <= -2e+199) tmp = Float64(-4.0 * Float64(a * t)); elseif (t_1 <= 5e+120) tmp = Float64(Float64(-27.0 * k) * j); else tmp = Float64(-4.0 * Float64(i * x)); 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 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
tmp = 0.0;
if (t_1 <= -2e+199)
tmp = -4.0 * (a * t);
elseif (t_1 <= 5e+120)
tmp = (-27.0 * k) * j;
else
tmp = -4.0 * (i * x);
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[(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]}, If[LessEqual[t$95$1, -2e+199], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+120], N[(N[(-27.0 * k), $MachinePrecision] * j), $MachinePrecision], N[(-4.0 * N[(i * x), $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(\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\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+199}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+120}:\\
\;\;\;\;\left(-27 \cdot k\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < -2.00000000000000019e199Initial program 85.7%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.7
Applied rewrites21.7%
if -2.00000000000000019e199 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < 5.00000000000000019e120Initial program 85.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.5
Applied rewrites23.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6423.5
Applied rewrites23.5%
if 5.00000000000000019e120 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) Initial program 85.7%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6421.8
Applied rewrites21.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
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))))
(if (<= t_1 -2e+199)
(* -4.0 (* a t))
(if (<= t_1 5e+120) (* -27.0 (* j k)) (* -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 * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
double tmp;
if (t_1 <= -2e+199) {
tmp = -4.0 * (a * t);
} else if (t_1 <= 5e+120) {
tmp = -27.0 * (j * k);
} else {
tmp = -4.0 * (i * x);
}
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 = ((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)
if (t_1 <= (-2d+199)) then
tmp = (-4.0d0) * (a * t)
else if (t_1 <= 5d+120) then
tmp = (-27.0d0) * (j * k)
else
tmp = (-4.0d0) * (i * x)
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 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
double tmp;
if (t_1 <= -2e+199) {
tmp = -4.0 * (a * t);
} else if (t_1 <= 5e+120) {
tmp = -27.0 * (j * k);
} else {
tmp = -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]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i) tmp = 0 if t_1 <= -2e+199: tmp = -4.0 * (a * t) elif t_1 <= 5e+120: tmp = -27.0 * (j * k) else: tmp = -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(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)) tmp = 0.0 if (t_1 <= -2e+199) tmp = Float64(-4.0 * Float64(a * t)); elseif (t_1 <= 5e+120) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(-4.0 * Float64(i * x)); 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 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
tmp = 0.0;
if (t_1 <= -2e+199)
tmp = -4.0 * (a * t);
elseif (t_1 <= 5e+120)
tmp = -27.0 * (j * k);
else
tmp = -4.0 * (i * x);
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[(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]}, If[LessEqual[t$95$1, -2e+199], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+120], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(i * x), $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(\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\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+199}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+120}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < -2.00000000000000019e199Initial program 85.7%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.7
Applied rewrites21.7%
if -2.00000000000000019e199 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < 5.00000000000000019e120Initial program 85.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.5
Applied rewrites23.5%
if 5.00000000000000019e120 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) Initial program 85.7%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6421.8
Applied rewrites21.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 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k))) (if (<= t_2 -2e+71) t_1 (if (<= t_2 2e+43) (* -4.0 (* a t)) 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+71) {
tmp = t_1;
} else if (t_2 <= 2e+43) {
tmp = -4.0 * (a * t);
} 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+71)) then
tmp = t_1
else if (t_2 <= 2d+43) then
tmp = (-4.0d0) * (a * t)
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+71) {
tmp = t_1;
} else if (t_2 <= 2e+43) {
tmp = -4.0 * (a * t);
} 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+71: tmp = t_1 elif t_2 <= 2e+43: tmp = -4.0 * (a * t) 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+71) tmp = t_1; elseif (t_2 <= 2e+43) tmp = Float64(-4.0 * Float64(a * t)); 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+71)
tmp = t_1;
elseif (t_2 <= 2e+43)
tmp = -4.0 * (a * t);
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+71], t$95$1, If[LessEqual[t$95$2, 2e+43], N[(-4.0 * N[(a * t), $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^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+43}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.0000000000000001e71 or 2.00000000000000003e43 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.5
Applied rewrites23.5%
if -2.0000000000000001e71 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000003e43Initial program 85.7%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.7
Applied rewrites21.7%
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 (* -4.0 (* a t)))
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 -4.0 * (a * t);
}
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 = (-4.0d0) * (a * t)
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 -4.0 * (a * t);
}
[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 -4.0 * (a * t)
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(-4.0 * Float64(a * t)) 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 = -4.0 * (a * t);
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[(-4.0 * N[(a * t), $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])\\
\\
-4 \cdot \left(a \cdot t\right)
\end{array}
Initial program 85.7%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.7
Applied rewrites21.7%
herbie shell --seed 2025143
(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)))