
(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 17 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 (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))
INFINITY)
(fma
(* (* y x) t)
(* z 18.0)
(fma (* k j) -27.0 (fma -4.0 (fma a t (* i x)) (* c b))))
(* (fma (* y 18.0) (* t z) (* 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 (((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= ((double) INFINITY)) {
tmp = fma(((y * x) * t), (z * 18.0), fma((k * j), -27.0, fma(-4.0, fma(a, t, (i * x)), (c * b))));
} else {
tmp = fma((y * 18.0), (t * z), (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 (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)) <= Inf) tmp = fma(Float64(Float64(y * x) * t), Float64(z * 18.0), fma(Float64(k * j), -27.0, fma(-4.0, fma(a, t, Float64(i * x)), Float64(c * b)))); else tmp = Float64(fma(Float64(y * 18.0), Float64(t * z), 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[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], Infinity], N[(N[(N[(y * x), $MachinePrecision] * t), $MachinePrecision] * N[(z * 18.0), $MachinePrecision] + N[(N[(k * j), $MachinePrecision] * -27.0 + N[(-4.0 * N[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision] + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * 18.0), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $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(\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 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot x\right) \cdot t, z \cdot 18, \mathsf{fma}\left(k \cdot j, -27, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, i \cdot x\right), c \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 18, t \cdot z, i \cdot -4\right) \cdot x\\
\end{array}
\end{array}
if (-.f64 (-.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)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0Initial program 84.5%
Applied rewrites86.3%
if +inf.0 < (-.f64 (-.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)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) Initial program 84.5%
Applied rewrites88.2%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.7
Applied rewrites42.7%
Applied rewrites42.7%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6443.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6443.0
Applied rewrites43.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
(if (<=
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
INFINITY)
(fma
(* -27.0 k)
j
(fma (* i x) -4.0 (fma (fma -4.0 a (* z (* y (* 18.0 x)))) t (* c b))))
(* (fma (* y 18.0) (* t z) (* 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 ((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= ((double) INFINITY)) {
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((y * 18.0), (t * z), (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 (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)) <= Inf) 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 = Float64(fma(Float64(y * 18.0), Float64(t * z), 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[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], Infinity], 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[(N[(N[(y * 18.0), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $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 \infty:\\
\;\;\;\;\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(y \cdot 18, t \cdot z, i \cdot -4\right) \cdot x\\
\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)) < +inf.0Initial program 84.5%
Applied rewrites88.2%
if +inf.0 < (-.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 84.5%
Applied rewrites88.2%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.7
Applied rewrites42.7%
Applied rewrites42.7%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6443.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6443.0
Applied rewrites43.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
(fma
-4.0
(* i x)
(fma b c (* t (fma -4.0 a (* 18.0 (* x (* y z))))))))
(t_2
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 5e+232)
(- (* b c) (fma 4.0 (* a t) (fma 4.0 (* i x) (* 27.0 (* j k)))))
(if (<= t_2 INFINITY) t_1 (* (fma (* y 18.0) (* t z) (* 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 t_1 = fma(-4.0, (i * x), fma(b, c, (t * fma(-4.0, a, (18.0 * (x * (y * z)))))));
double t_2 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 5e+232) {
tmp = (b * c) - fma(4.0, (a * t), fma(4.0, (i * x), (27.0 * (j * k))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma((y * 18.0), (t * z), (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) t_1 = fma(-4.0, Float64(i * x), fma(b, c, Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z))))))) t_2 = 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_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 5e+232) tmp = Float64(Float64(b * c) - fma(4.0, Float64(a * t), fma(4.0, Float64(i * x), Float64(27.0 * Float64(j * k))))); elseif (t_2 <= Inf) tmp = t_1; else tmp = Float64(fma(Float64(y * 18.0), Float64(t * z), 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_] := Block[{t$95$1 = N[(-4.0 * N[(i * x), $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]}, Block[{t$95$2 = 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$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 5e+232], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision] + N[(4.0 * N[(i * x), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$1, N[(N[(N[(y * 18.0), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $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 := \mathsf{fma}\left(-4, i \cdot x, \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)\\
t_2 := \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\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+232}:\\
\;\;\;\;b \cdot c - \mathsf{fma}\left(4, a \cdot t, \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 18, t \cdot z, i \cdot -4\right) \cdot x\\
\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)) < -inf.0 or 4.99999999999999987e232 < (-.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)) < +inf.0Initial program 84.5%
Applied rewrites88.2%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.7
Applied rewrites42.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-fma.f64N/A
distribute-rgt-inN/A
Applied rewrites38.8%
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-*.f6471.2
Applied rewrites71.2%
if -inf.0 < (-.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.99999999999999987e232Initial program 84.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6476.1
Applied rewrites76.1%
if +inf.0 < (-.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 84.5%
Applied rewrites88.2%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.7
Applied rewrites42.7%
Applied rewrites42.7%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6443.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6443.0
Applied rewrites43.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
(fma
-27.0
(* j k)
(fma b c (* t (fma -4.0 a (* 18.0 (* x (* y z)))))))))
(if (<= t -4.6e+111)
t_1
(if (<= t 2.8e-87)
(fma
(* j -27.0)
k
(fma (* -4.0 i) x (fma (* (* (* t x) y) 18.0) z (* 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 = fma(-27.0, (j * k), fma(b, c, (t * fma(-4.0, a, (18.0 * (x * (y * z)))))));
double tmp;
if (t <= -4.6e+111) {
tmp = t_1;
} else if (t <= 2.8e-87) {
tmp = fma((j * -27.0), k, fma((-4.0 * i), x, fma((((t * x) * y) * 18.0), z, (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 = 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.6e+111) tmp = t_1; elseif (t <= 2.8e-87) tmp = fma(Float64(j * -27.0), k, fma(Float64(-4.0 * i), x, fma(Float64(Float64(Float64(t * x) * y) * 18.0), z, 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[(-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.6e+111], t$95$1, If[LessEqual[t, 2.8e-87], N[(N[(j * -27.0), $MachinePrecision] * k + N[(N[(-4.0 * i), $MachinePrecision] * x + N[(N[(N[(N[(t * x), $MachinePrecision] * y), $MachinePrecision] * 18.0), $MachinePrecision] * z + N[(b * c), $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.6 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-87}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot -27, k, \mathsf{fma}\left(-4 \cdot i, x, \mathsf{fma}\left(\left(\left(t \cdot x\right) \cdot y\right) \cdot 18, z, b \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.60000000000000004e111 or 2.8000000000000001e-87 < t Initial program 84.5%
Applied rewrites88.2%
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.60000000000000004e111 < t < 2.8000000000000001e-87Initial program 84.5%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.3
Applied rewrites71.3%
Applied rewrites77.3%
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 -1.25e+50)
t_1
(if (<= t 0.059)
(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(-27.0, (j * k), fma(b, c, (t * fma(-4.0, a, (18.0 * (x * (y * z)))))));
double tmp;
if (t <= -1.25e+50) {
tmp = t_1;
} else if (t <= 0.059) {
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(-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 <= -1.25e+50) tmp = t_1; elseif (t <= 0.059) 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[(-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, -1.25e+50], t$95$1, If[LessEqual[t, 0.059], 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(-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 -1.25 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 0.059:\\
\;\;\;\;\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 t < -1.25e50 or 0.058999999999999997 < t Initial program 84.5%
Applied rewrites88.2%
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 -1.25e50 < t < 0.058999999999999997Initial program 84.5%
Applied rewrites88.2%
Taylor expanded in x 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 (<= x -1.45e+73) (* (fma (* y 18.0) (* t z) (* i -4.0)) x) (fma (* -27.0 k) j (fma (* i x) -4.0 (fma (* -4.0 a) 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.45e+73) {
tmp = fma((y * 18.0), (t * z), (i * -4.0)) * x;
} else {
tmp = fma((-27.0 * k), j, fma((i * x), -4.0, fma((-4.0 * a), 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.45e+73) tmp = Float64(fma(Float64(y * 18.0), Float64(t * z), Float64(i * -4.0)) * x); else tmp = fma(Float64(-27.0 * k), j, fma(Float64(i * x), -4.0, fma(Float64(-4.0 * a), 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.45e+73], N[(N[(N[(y * 18.0), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], 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]]
\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.45 \cdot 10^{+73}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 18, t \cdot z, i \cdot -4\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\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)\\
\end{array}
\end{array}
if x < -1.4500000000000001e73Initial program 84.5%
Applied rewrites88.2%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.7
Applied rewrites42.7%
Applied rewrites42.7%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6443.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6443.0
Applied rewrites43.0%
if -1.4500000000000001e73 < x Initial program 84.5%
Applied rewrites88.2%
Taylor expanded in x 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 (<= x -1.22e+71)
(* (fma (* y 18.0) (* t z) (* i -4.0)) x)
(if (<= x 3.5e+57)
(fma c b (fma (* a -4.0) t (* (* j k) -27.0)))
(fma (* -27.0 k) j (fma -4.0 (* i x) (* b c))))))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.22e+71) {
tmp = fma((y * 18.0), (t * z), (i * -4.0)) * x;
} else if (x <= 3.5e+57) {
tmp = fma(c, b, fma((a * -4.0), t, ((j * k) * -27.0)));
} else {
tmp = fma((-27.0 * k), j, fma(-4.0, (i * x), (b * c)));
}
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.22e+71) tmp = Float64(fma(Float64(y * 18.0), Float64(t * z), Float64(i * -4.0)) * x); elseif (x <= 3.5e+57) tmp = fma(c, b, fma(Float64(a * -4.0), t, Float64(Float64(j * k) * -27.0))); else tmp = fma(Float64(-27.0 * k), j, fma(-4.0, Float64(i * x), Float64(b * c))); 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.22e+71], N[(N[(N[(y * 18.0), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 3.5e+57], N[(c * b + N[(N[(a * -4.0), $MachinePrecision] * t + N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * k), $MachinePrecision] * j + N[(-4.0 * N[(i * x), $MachinePrecision] + N[(b * c), $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.22 \cdot 10^{+71}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 18, t \cdot z, i \cdot -4\right) \cdot x\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+57}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(a \cdot -4, t, \left(j \cdot k\right) \cdot -27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot k, j, \mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)\right)\\
\end{array}
\end{array}
if x < -1.22000000000000001e71Initial program 84.5%
Applied rewrites88.2%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.7
Applied rewrites42.7%
Applied rewrites42.7%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6443.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6443.0
Applied rewrites43.0%
if -1.22000000000000001e71 < x < 3.4999999999999997e57Initial program 84.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
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
sub-flip-reverseN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
Applied rewrites61.7%
if 3.4999999999999997e57 < x Initial program 84.5%
Applied rewrites88.2%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6461.3
Applied rewrites61.3%
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 18.0) (* t z) (* i -4.0)) x)))
(if (<= x -1.22e+71)
t_1
(if (<= x 7.6e+92) (fma c b (fma (* a -4.0) t (* (* 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 = fma((y * 18.0), (t * z), (i * -4.0)) * x;
double tmp;
if (x <= -1.22e+71) {
tmp = t_1;
} else if (x <= 7.6e+92) {
tmp = fma(c, b, fma((a * -4.0), t, ((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(fma(Float64(y * 18.0), Float64(t * z), Float64(i * -4.0)) * x) tmp = 0.0 if (x <= -1.22e+71) tmp = t_1; elseif (x <= 7.6e+92) tmp = fma(c, b, fma(Float64(a * -4.0), t, 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[(N[(N[(y * 18.0), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.22e+71], t$95$1, If[LessEqual[x, 7.6e+92], N[(c * b + N[(N[(a * -4.0), $MachinePrecision] * t + 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 := \mathsf{fma}\left(y \cdot 18, t \cdot z, i \cdot -4\right) \cdot x\\
\mathbf{if}\;x \leq -1.22 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{+92}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(a \cdot -4, t, \left(j \cdot k\right) \cdot -27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.22000000000000001e71 or 7.6000000000000001e92 < x Initial program 84.5%
Applied rewrites88.2%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.7
Applied rewrites42.7%
Applied rewrites42.7%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6443.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6443.0
Applied rewrites43.0%
if -1.22000000000000001e71 < x < 7.6000000000000001e92Initial program 84.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
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
sub-flip-reverseN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
Applied rewrites61.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
(let* ((t_1 (* (fma (* y 18.0) (* t z) (* i -4.0)) x)))
(if (<= x -4.7e+67)
t_1
(if (<= x -1.3e-134)
(- (* b c) (* 4.0 (* a t)))
(if (<= x 3.9e+92) (- (* b c) (* 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 = fma((y * 18.0), (t * z), (i * -4.0)) * x;
double tmp;
if (x <= -4.7e+67) {
tmp = t_1;
} else if (x <= -1.3e-134) {
tmp = (b * c) - (4.0 * (a * t));
} else if (x <= 3.9e+92) {
tmp = (b * c) - (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(fma(Float64(y * 18.0), Float64(t * z), Float64(i * -4.0)) * x) tmp = 0.0 if (x <= -4.7e+67) tmp = t_1; elseif (x <= -1.3e-134) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); elseif (x <= 3.9e+92) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(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[(N[(N[(y * 18.0), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -4.7e+67], t$95$1, If[LessEqual[x, -1.3e-134], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.9e+92], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $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 18, t \cdot z, i \cdot -4\right) \cdot x\\
\mathbf{if}\;x \leq -4.7 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-134}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+92}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.70000000000000017e67 or 3.90000000000000011e92 < x Initial program 84.5%
Applied rewrites88.2%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.7
Applied rewrites42.7%
Applied rewrites42.7%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6443.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6443.0
Applied rewrites43.0%
if -4.70000000000000017e67 < x < -1.30000000000000011e-134Initial program 84.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6444.2
Applied rewrites44.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6441.2
Applied rewrites41.2%
if -1.30000000000000011e-134 < x < 3.90000000000000011e92Initial program 84.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
Taylor expanded in t around 0
lower-*.f64N/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 (* x (fma -4.0 i (* 18.0 (* t (* y z)))))))
(if (<= x -4.7e+67)
t_1
(if (<= x -1.3e-134)
(- (* b c) (* 4.0 (* a t)))
(if (<= x 3.9e+92) (- (* b c) (* 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 = x * fma(-4.0, i, (18.0 * (t * (y * z))));
double tmp;
if (x <= -4.7e+67) {
tmp = t_1;
} else if (x <= -1.3e-134) {
tmp = (b * c) - (4.0 * (a * t));
} else if (x <= 3.9e+92) {
tmp = (b * c) - (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(x * fma(-4.0, i, Float64(18.0 * Float64(t * Float64(y * z))))) tmp = 0.0 if (x <= -4.7e+67) tmp = t_1; elseif (x <= -1.3e-134) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); elseif (x <= 3.9e+92) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(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[(x * N[(-4.0 * i + N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.7e+67], t$95$1, If[LessEqual[x, -1.3e-134], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.9e+92], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $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 -4.7 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-134}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+92}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.70000000000000017e67 or 3.90000000000000011e92 < x Initial program 84.5%
Applied rewrites88.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.7
Applied rewrites42.7%
if -4.70000000000000017e67 < x < -1.30000000000000011e-134Initial program 84.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6444.2
Applied rewrites44.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6441.2
Applied rewrites41.2%
if -1.30000000000000011e-134 < x < 3.90000000000000011e92Initial program 84.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
Taylor expanded in t around 0
lower-*.f64N/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 (* -4.0 (* i x))))
(if (<= x -4.6e+249)
(* (* 18.0 (* t (* y z))) x)
(if (<= x -5.7e+113)
t_1
(if (<= x -1.3e-134)
(- (* b c) (* 4.0 (* a t)))
(if (<= x 7.5e+92) (- (* b c) (* 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 = -4.0 * (i * x);
double tmp;
if (x <= -4.6e+249) {
tmp = (18.0 * (t * (y * z))) * x;
} else if (x <= -5.7e+113) {
tmp = t_1;
} else if (x <= -1.3e-134) {
tmp = (b * c) - (4.0 * (a * t));
} else if (x <= 7.5e+92) {
tmp = (b * c) - (27.0 * (j * k));
} 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) :: tmp
t_1 = (-4.0d0) * (i * x)
if (x <= (-4.6d+249)) then
tmp = (18.0d0 * (t * (y * z))) * x
else if (x <= (-5.7d+113)) then
tmp = t_1
else if (x <= (-1.3d-134)) then
tmp = (b * c) - (4.0d0 * (a * t))
else if (x <= 7.5d+92) then
tmp = (b * c) - (27.0d0 * (j * k))
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 = -4.0 * (i * x);
double tmp;
if (x <= -4.6e+249) {
tmp = (18.0 * (t * (y * z))) * x;
} else if (x <= -5.7e+113) {
tmp = t_1;
} else if (x <= -1.3e-134) {
tmp = (b * c) - (4.0 * (a * t));
} else if (x <= 7.5e+92) {
tmp = (b * c) - (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]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (i * x) tmp = 0 if x <= -4.6e+249: tmp = (18.0 * (t * (y * z))) * x elif x <= -5.7e+113: tmp = t_1 elif x <= -1.3e-134: tmp = (b * c) - (4.0 * (a * t)) elif x <= 7.5e+92: tmp = (b * c) - (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(-4.0 * Float64(i * x)) tmp = 0.0 if (x <= -4.6e+249) tmp = Float64(Float64(18.0 * Float64(t * Float64(y * z))) * x); elseif (x <= -5.7e+113) tmp = t_1; elseif (x <= -1.3e-134) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); elseif (x <= 7.5e+92) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); 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 = -4.0 * (i * x);
tmp = 0.0;
if (x <= -4.6e+249)
tmp = (18.0 * (t * (y * z))) * x;
elseif (x <= -5.7e+113)
tmp = t_1;
elseif (x <= -1.3e-134)
tmp = (b * c) - (4.0 * (a * t));
elseif (x <= 7.5e+92)
tmp = (b * c) - (27.0 * (j * k));
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[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.6e+249], N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, -5.7e+113], t$95$1, If[LessEqual[x, -1.3e-134], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e+92], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $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 := -4 \cdot \left(i \cdot x\right)\\
\mathbf{if}\;x \leq -4.6 \cdot 10^{+249}:\\
\;\;\;\;\left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x\\
\mathbf{elif}\;x \leq -5.7 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-134}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+92}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.5999999999999996e249Initial program 84.5%
Applied rewrites88.2%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.7
Applied rewrites42.7%
Applied rewrites42.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6426.2
Applied rewrites26.2%
if -4.5999999999999996e249 < x < -5.6999999999999998e113 or 7.49999999999999946e92 < x Initial program 84.5%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6421.5
Applied rewrites21.5%
if -5.6999999999999998e113 < x < -1.30000000000000011e-134Initial program 84.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6444.2
Applied rewrites44.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6441.2
Applied rewrites41.2%
if -1.30000000000000011e-134 < x < 7.49999999999999946e92Initial program 84.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
Taylor expanded in t around 0
lower-*.f64N/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 (* -4.0 (* i x))))
(if (<= x -5.7e+113)
t_1
(if (<= x -1.3e-134)
(- (* b c) (* 4.0 (* a t)))
(if (<= x 7.5e+92) (- (* b c) (* 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 = -4.0 * (i * x);
double tmp;
if (x <= -5.7e+113) {
tmp = t_1;
} else if (x <= -1.3e-134) {
tmp = (b * c) - (4.0 * (a * t));
} else if (x <= 7.5e+92) {
tmp = (b * c) - (27.0 * (j * k));
} 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) :: tmp
t_1 = (-4.0d0) * (i * x)
if (x <= (-5.7d+113)) then
tmp = t_1
else if (x <= (-1.3d-134)) then
tmp = (b * c) - (4.0d0 * (a * t))
else if (x <= 7.5d+92) then
tmp = (b * c) - (27.0d0 * (j * k))
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 = -4.0 * (i * x);
double tmp;
if (x <= -5.7e+113) {
tmp = t_1;
} else if (x <= -1.3e-134) {
tmp = (b * c) - (4.0 * (a * t));
} else if (x <= 7.5e+92) {
tmp = (b * c) - (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]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (i * x) tmp = 0 if x <= -5.7e+113: tmp = t_1 elif x <= -1.3e-134: tmp = (b * c) - (4.0 * (a * t)) elif x <= 7.5e+92: tmp = (b * c) - (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(-4.0 * Float64(i * x)) tmp = 0.0 if (x <= -5.7e+113) tmp = t_1; elseif (x <= -1.3e-134) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); elseif (x <= 7.5e+92) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); 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 = -4.0 * (i * x);
tmp = 0.0;
if (x <= -5.7e+113)
tmp = t_1;
elseif (x <= -1.3e-134)
tmp = (b * c) - (4.0 * (a * t));
elseif (x <= 7.5e+92)
tmp = (b * c) - (27.0 * (j * k));
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[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.7e+113], t$95$1, If[LessEqual[x, -1.3e-134], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e+92], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $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 := -4 \cdot \left(i \cdot x\right)\\
\mathbf{if}\;x \leq -5.7 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-134}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+92}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.6999999999999998e113 or 7.49999999999999946e92 < x Initial program 84.5%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6421.5
Applied rewrites21.5%
if -5.6999999999999998e113 < x < -1.30000000000000011e-134Initial program 84.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6444.2
Applied rewrites44.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6441.2
Applied rewrites41.2%
if -1.30000000000000011e-134 < x < 7.49999999999999946e92Initial program 84.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
Taylor expanded in t around 0
lower-*.f64N/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 -1e+188)
(* -27.0 (* j k))
(if (<= t_1 -2e+45)
(* -4.0 (* i x))
(if (<= t_1 2e+144) (- (* b c) (* 4.0 (* a t))) (* (* k -27.0) 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+188) {
tmp = -27.0 * (j * k);
} else if (t_1 <= -2e+45) {
tmp = -4.0 * (i * x);
} else if (t_1 <= 2e+144) {
tmp = (b * c) - (4.0 * (a * t));
} else {
tmp = (k * -27.0) * 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+188)) then
tmp = (-27.0d0) * (j * k)
else if (t_1 <= (-2d+45)) then
tmp = (-4.0d0) * (i * x)
else if (t_1 <= 2d+144) then
tmp = (b * c) - (4.0d0 * (a * t))
else
tmp = (k * (-27.0d0)) * 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+188) {
tmp = -27.0 * (j * k);
} else if (t_1 <= -2e+45) {
tmp = -4.0 * (i * x);
} else if (t_1 <= 2e+144) {
tmp = (b * c) - (4.0 * (a * t));
} else {
tmp = (k * -27.0) * 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+188: tmp = -27.0 * (j * k) elif t_1 <= -2e+45: tmp = -4.0 * (i * x) elif t_1 <= 2e+144: tmp = (b * c) - (4.0 * (a * t)) else: tmp = (k * -27.0) * 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+188) tmp = Float64(-27.0 * Float64(j * k)); elseif (t_1 <= -2e+45) tmp = Float64(-4.0 * Float64(i * x)); elseif (t_1 <= 2e+144) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); else tmp = Float64(Float64(k * -27.0) * 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+188)
tmp = -27.0 * (j * k);
elseif (t_1 <= -2e+45)
tmp = -4.0 * (i * x);
elseif (t_1 <= 2e+144)
tmp = (b * c) - (4.0 * (a * t));
else
tmp = (k * -27.0) * 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+188], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e+45], N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+144], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * -27.0), $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^{+188}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+45}:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+144}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot -27\right) \cdot j\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1e188Initial program 84.5%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.1
Applied rewrites24.1%
if -1e188 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.9999999999999999e45Initial program 84.5%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6421.5
Applied rewrites21.5%
if -1.9999999999999999e45 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000005e144Initial program 84.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6444.2
Applied rewrites44.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6441.2
Applied rewrites41.2%
if 2.00000000000000005e144 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 84.5%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.1
Applied rewrites24.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6424.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6424.1
Applied rewrites24.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 (* -4.0 (* i x))))
(if (<= x -2e+73)
t_1
(if (<= x -1.65e-134)
(* -4.0 (* a t))
(if (<= x 6e+34) (* (* k -27.0) j) 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 <= -2e+73) {
tmp = t_1;
} else if (x <= -1.65e-134) {
tmp = -4.0 * (a * t);
} else if (x <= 6e+34) {
tmp = (k * -27.0) * j;
} 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) :: tmp
t_1 = (-4.0d0) * (i * x)
if (x <= (-2d+73)) then
tmp = t_1
else if (x <= (-1.65d-134)) then
tmp = (-4.0d0) * (a * t)
else if (x <= 6d+34) then
tmp = (k * (-27.0d0)) * j
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 = -4.0 * (i * x);
double tmp;
if (x <= -2e+73) {
tmp = t_1;
} else if (x <= -1.65e-134) {
tmp = -4.0 * (a * t);
} else if (x <= 6e+34) {
tmp = (k * -27.0) * j;
} 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 = -4.0 * (i * x) tmp = 0 if x <= -2e+73: tmp = t_1 elif x <= -1.65e-134: tmp = -4.0 * (a * t) elif x <= 6e+34: tmp = (k * -27.0) * j 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 <= -2e+73) tmp = t_1; elseif (x <= -1.65e-134) tmp = Float64(-4.0 * Float64(a * t)); elseif (x <= 6e+34) tmp = Float64(Float64(k * -27.0) * j); 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 = -4.0 * (i * x);
tmp = 0.0;
if (x <= -2e+73)
tmp = t_1;
elseif (x <= -1.65e-134)
tmp = -4.0 * (a * t);
elseif (x <= 6e+34)
tmp = (k * -27.0) * j;
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[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e+73], t$95$1, If[LessEqual[x, -1.65e-134], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e+34], N[(N[(k * -27.0), $MachinePrecision] * j), $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 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-134}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+34}:\\
\;\;\;\;\left(k \cdot -27\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.99999999999999997e73 or 6.00000000000000037e34 < x Initial program 84.5%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6421.5
Applied rewrites21.5%
if -1.99999999999999997e73 < x < -1.6500000000000001e-134Initial program 84.5%
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.4
Applied rewrites42.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.5
Applied rewrites21.5%
if -1.6500000000000001e-134 < x < 6.00000000000000037e34Initial program 84.5%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.1
Applied rewrites24.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6424.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6424.1
Applied rewrites24.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 (* -4.0 (* i x))))
(if (<= x -2e+73)
t_1
(if (<= x -1.65e-134)
(* -4.0 (* a t))
(if (<= x 6e+34) (* -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 = -4.0 * (i * x);
double tmp;
if (x <= -2e+73) {
tmp = t_1;
} else if (x <= -1.65e-134) {
tmp = -4.0 * (a * t);
} else if (x <= 6e+34) {
tmp = -27.0 * (j * k);
} 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) :: tmp
t_1 = (-4.0d0) * (i * x)
if (x <= (-2d+73)) then
tmp = t_1
else if (x <= (-1.65d-134)) then
tmp = (-4.0d0) * (a * t)
else if (x <= 6d+34) then
tmp = (-27.0d0) * (j * k)
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 = -4.0 * (i * x);
double tmp;
if (x <= -2e+73) {
tmp = t_1;
} else if (x <= -1.65e-134) {
tmp = -4.0 * (a * t);
} else if (x <= 6e+34) {
tmp = -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]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (i * x) tmp = 0 if x <= -2e+73: tmp = t_1 elif x <= -1.65e-134: tmp = -4.0 * (a * t) elif x <= 6e+34: tmp = -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(-4.0 * Float64(i * x)) tmp = 0.0 if (x <= -2e+73) tmp = t_1; elseif (x <= -1.65e-134) tmp = Float64(-4.0 * Float64(a * t)); elseif (x <= 6e+34) tmp = Float64(-27.0 * Float64(j * k)); 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 = -4.0 * (i * x);
tmp = 0.0;
if (x <= -2e+73)
tmp = t_1;
elseif (x <= -1.65e-134)
tmp = -4.0 * (a * t);
elseif (x <= 6e+34)
tmp = -27.0 * (j * k);
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[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e+73], t$95$1, If[LessEqual[x, -1.65e-134], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e+34], N[(-27.0 * N[(j * 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 := -4 \cdot \left(i \cdot x\right)\\
\mathbf{if}\;x \leq -2 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-134}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+34}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.99999999999999997e73 or 6.00000000000000037e34 < x Initial program 84.5%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6421.5
Applied rewrites21.5%
if -1.99999999999999997e73 < x < -1.6500000000000001e-134Initial program 84.5%
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.4
Applied rewrites42.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.5
Applied rewrites21.5%
if -1.6500000000000001e-134 < x < 6.00000000000000037e34Initial program 84.5%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.1
Applied rewrites24.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 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k))) (if (<= t_2 -5.9e+179) t_1 (if (<= t_2 5e-72) (* -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 <= -5.9e+179) {
tmp = t_1;
} else if (t_2 <= 5e-72) {
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 <= (-5.9d+179)) then
tmp = t_1
else if (t_2 <= 5d-72) 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 <= -5.9e+179) {
tmp = t_1;
} else if (t_2 <= 5e-72) {
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 <= -5.9e+179: tmp = t_1 elif t_2 <= 5e-72: 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 <= -5.9e+179) tmp = t_1; elseif (t_2 <= 5e-72) 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 <= -5.9e+179)
tmp = t_1;
elseif (t_2 <= 5e-72)
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, -5.9e+179], t$95$1, If[LessEqual[t$95$2, 5e-72], 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 -5.9 \cdot 10^{+179}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-72}:\\
\;\;\;\;-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.9000000000000006e179 or 4.9999999999999996e-72 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 84.5%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.1
Applied rewrites24.1%
if -5.9000000000000006e179 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.9999999999999996e-72Initial program 84.5%
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.4
Applied rewrites42.4%
Taylor expanded in x around 0
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 (* -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 84.5%
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.4
Applied rewrites42.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.5
Applied rewrites21.5%
herbie shell --seed 2025149
(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)))