
(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 25 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))))
(if (<= (- t_1 (* (* j 27.0) k)) INFINITY)
(- t_1 (* j (* k 27.0)))
(* (* (fma (* t y) 18.0 (* (/ i z) -4.0)) z) 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 - ((j * 27.0) * k)) <= ((double) INFINITY)) {
tmp = t_1 - (j * (k * 27.0));
} else {
tmp = (fma((t * y), 18.0, ((i / z) * -4.0)) * z) * 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 (Float64(t_1 - Float64(Float64(j * 27.0) * k)) <= Inf) tmp = Float64(t_1 - Float64(j * Float64(k * 27.0))); else tmp = Float64(Float64(fma(Float64(t * y), 18.0, Float64(Float64(i / z) * -4.0)) * z) * 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[(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[N[(t$95$1 - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * y), $MachinePrecision] * 18.0 + N[(N[(i / z), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * z), $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 := \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 - \left(j \cdot 27\right) \cdot k \leq \infty:\\
\;\;\;\;t\_1 - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(t \cdot y, 18, \frac{i}{z} \cdot -4\right) \cdot z\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 95.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6495.4
Applied rewrites95.4%
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 0.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6458.2
Applied rewrites58.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.7
Applied rewrites58.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 (* (* j 27.0) k)))
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
t_1)
INFINITY)
(-
(fma
(* -4.0 i)
x
(fma (* -4.0 a) t (fma (* (* (* y x) z) t) 18.0 (* c b))))
t_1)
(* (* (fma (* t y) 18.0 (* (/ i z) -4.0)) z) 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 = (j * 27.0) * k;
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - t_1) <= ((double) INFINITY)) {
tmp = fma((-4.0 * i), x, fma((-4.0 * a), t, fma((((y * x) * z) * t), 18.0, (c * b)))) - t_1;
} else {
tmp = (fma((t * y), 18.0, ((i / z) * -4.0)) * z) * 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(j * 27.0) * 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)) - t_1) <= Inf) tmp = Float64(fma(Float64(-4.0 * i), x, fma(Float64(-4.0 * a), t, fma(Float64(Float64(Float64(y * x) * z) * t), 18.0, Float64(c * b)))) - t_1); else tmp = Float64(Float64(fma(Float64(t * y), 18.0, Float64(Float64(i / z) * -4.0)) * z) * 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[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, 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] - t$95$1), $MachinePrecision], Infinity], N[(N[(N[(-4.0 * i), $MachinePrecision] * x + N[(N[(-4.0 * a), $MachinePrecision] * t + N[(N[(N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] * 18.0 + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(N[(t * y), $MachinePrecision] * 18.0 + N[(N[(i / z), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * z), $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 := \left(j \cdot 27\right) \cdot k\\
\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) - t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot i, x, \mathsf{fma}\left(-4 \cdot a, t, \mathsf{fma}\left(\left(\left(y \cdot x\right) \cdot z\right) \cdot t, 18, c \cdot b\right)\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(t \cdot y, 18, \frac{i}{z} \cdot -4\right) \cdot z\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 95.4%
Taylor expanded in i around 0
associate--l+N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
Applied rewrites94.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6495.5
Applied rewrites95.5%
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 0.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6458.2
Applied rewrites58.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.7
Applied rewrites58.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
(if (<= x 2e-6)
(-
(fma
(* -4.0 i)
x
(fma (* -4.0 a) t (fma (* (* y (* z x)) t) 18.0 (* c b))))
(* (* j 27.0) k))
(fma
(* -27.0 j)
k
(fma (* 18.0 t) (* (* z y) x) (- (* c b) (* 4.0 (fma a t (* i x))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= 2e-6) {
tmp = fma((-4.0 * i), x, fma((-4.0 * a), t, fma(((y * (z * x)) * t), 18.0, (c * b)))) - ((j * 27.0) * k);
} else {
tmp = fma((-27.0 * j), k, fma((18.0 * t), ((z * y) * x), ((c * b) - (4.0 * fma(a, t, (i * x))))));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= 2e-6) tmp = Float64(fma(Float64(-4.0 * i), x, fma(Float64(-4.0 * a), t, fma(Float64(Float64(y * Float64(z * x)) * t), 18.0, Float64(c * b)))) - Float64(Float64(j * 27.0) * k)); else tmp = fma(Float64(-27.0 * j), k, fma(Float64(18.0 * t), Float64(Float64(z * y) * x), Float64(Float64(c * b) - Float64(4.0 * fma(a, t, Float64(i * x)))))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, 2e-6], N[(N[(N[(-4.0 * i), $MachinePrecision] * x + N[(N[(-4.0 * a), $MachinePrecision] * t + N[(N[(N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * 18.0 + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(18.0 * t), $MachinePrecision] * N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(a * t + N[(i * x), $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}\;x \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot i, x, \mathsf{fma}\left(-4 \cdot a, t, \mathsf{fma}\left(\left(y \cdot \left(z \cdot x\right)\right) \cdot t, 18, c \cdot b\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right)\right)\\
\end{array}
\end{array}
if x < 1.99999999999999991e-6Initial program 88.3%
Taylor expanded in i around 0
associate--l+N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
Applied rewrites89.4%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6491.1
Applied rewrites91.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6491.2
Applied rewrites91.2%
if 1.99999999999999991e-6 < x Initial program 75.4%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites82.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
(if (<=
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
INFINITY)
(fma
(* -27.0 j)
k
(fma (* 18.0 t) (* (* z y) x) (- (* c b) (* 4.0 (fma a t (* i x))))))
(* (* (fma (* t y) 18.0 (* (/ i z) -4.0)) z) 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 * j), k, fma((18.0 * t), ((z * y) * x), ((c * b) - (4.0 * fma(a, t, (i * x))))));
} else {
tmp = (fma((t * y), 18.0, ((i / z) * -4.0)) * z) * 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 * j), k, fma(Float64(18.0 * t), Float64(Float64(z * y) * x), Float64(Float64(c * b) - Float64(4.0 * fma(a, t, Float64(i * x)))))); else tmp = Float64(Float64(fma(Float64(t * y), 18.0, Float64(Float64(i / z) * -4.0)) * z) * 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 * j), $MachinePrecision] * k + N[(N[(18.0 * t), $MachinePrecision] * N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * y), $MachinePrecision] * 18.0 + N[(N[(i / z), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * z), $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 j, k, \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(t \cdot y, 18, \frac{i}{z} \cdot -4\right) \cdot z\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 92.6%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites93.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 0.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6467.2
Applied rewrites67.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6467.1
Applied rewrites67.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 (* (* j 27.0) k)))
(if (<= x -9.8e+86)
(* (fma (* (* t z) 18.0) y (* -4.0 i)) x)
(if (<= x -4.5e+23)
(- (fma (* -4.0 i) x (* (* -4.0 a) t)) t_1)
(if (<= x 2.6e+140)
(- (fma c b (* -4.0 (* a t))) t_1)
(* (fma (* 18.0 t) (* z y) (* -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 = (j * 27.0) * k;
double tmp;
if (x <= -9.8e+86) {
tmp = fma(((t * z) * 18.0), y, (-4.0 * i)) * x;
} else if (x <= -4.5e+23) {
tmp = fma((-4.0 * i), x, ((-4.0 * a) * t)) - t_1;
} else if (x <= 2.6e+140) {
tmp = fma(c, b, (-4.0 * (a * t))) - t_1;
} else {
tmp = fma((18.0 * t), (z * y), (-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(j * 27.0) * k) tmp = 0.0 if (x <= -9.8e+86) tmp = Float64(fma(Float64(Float64(t * z) * 18.0), y, Float64(-4.0 * i)) * x); elseif (x <= -4.5e+23) tmp = Float64(fma(Float64(-4.0 * i), x, Float64(Float64(-4.0 * a) * t)) - t_1); elseif (x <= 2.6e+140) tmp = Float64(fma(c, b, Float64(-4.0 * Float64(a * t))) - t_1); else tmp = Float64(fma(Float64(18.0 * t), Float64(z * y), Float64(-4.0 * i)) * x); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[x, -9.8e+86], N[(N[(N[(N[(t * z), $MachinePrecision] * 18.0), $MachinePrecision] * y + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, -4.5e+23], N[(N[(N[(-4.0 * i), $MachinePrecision] * x + N[(N[(-4.0 * a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 2.6e+140], N[(N[(c * b + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $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 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -9.8 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, y, -4 \cdot i\right) \cdot x\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot i, x, \left(-4 \cdot a\right) \cdot t\right) - t\_1\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -4 \cdot \left(a \cdot t\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x\\
\end{array}
\end{array}
if x < -9.7999999999999999e86Initial program 72.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6468.7
Applied rewrites68.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f6469.4
Applied rewrites69.4%
if -9.7999999999999999e86 < x < -4.49999999999999979e23Initial program 84.4%
Taylor expanded in i around 0
associate--l+N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
Applied rewrites90.2%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lift-*.f6460.6
Applied rewrites60.6%
if -4.49999999999999979e23 < x < 2.6000000000000001e140Initial program 91.1%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6473.6
Applied rewrites73.6%
if 2.6000000000000001e140 < x Initial program 71.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.9
Applied rewrites71.9%
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 -8e+23)
(* (fma (* (* t z) 18.0) y (* -4.0 i)) x)
(if (<= x 2.6e+140)
(- (fma c b (* -4.0 (* a t))) (* (* j 27.0) k))
(* (fma (* 18.0 t) (* z y) (* -4.0 i)) x))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -8e+23) {
tmp = fma(((t * z) * 18.0), y, (-4.0 * i)) * x;
} else if (x <= 2.6e+140) {
tmp = fma(c, b, (-4.0 * (a * t))) - ((j * 27.0) * k);
} else {
tmp = fma((18.0 * t), (z * y), (-4.0 * i)) * x;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -8e+23) tmp = Float64(fma(Float64(Float64(t * z) * 18.0), y, Float64(-4.0 * i)) * x); elseif (x <= 2.6e+140) tmp = Float64(fma(c, b, Float64(-4.0 * Float64(a * t))) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(fma(Float64(18.0 * t), Float64(z * y), Float64(-4.0 * i)) * x); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -8e+23], N[(N[(N[(N[(t * z), $MachinePrecision] * 18.0), $MachinePrecision] * y + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 2.6e+140], N[(N[(c * b + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $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}\;x \leq -8 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, y, -4 \cdot i\right) \cdot x\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -4 \cdot \left(a \cdot t\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x\\
\end{array}
\end{array}
if x < -7.9999999999999993e23Initial program 75.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f6464.0
Applied rewrites64.0%
if -7.9999999999999993e23 < x < 2.6000000000000001e140Initial program 91.1%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6473.7
Applied rewrites73.7%
if 2.6000000000000001e140 < x Initial program 71.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.9
Applied rewrites71.9%
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.3e+20)
(* (fma (* (* z x) y) 18.0 (* -4.0 a)) t)
(if (<= t -3.15e-164)
(- (* c b) (* j (* k 27.0)))
(if (<= t 1.35e+81)
(- (* (* -4.0 i) x) (* (* j 27.0) k))
(* (fma (* (* y x) z) 18.0 (* -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 (t <= -1.3e+20) {
tmp = fma(((z * x) * y), 18.0, (-4.0 * a)) * t;
} else if (t <= -3.15e-164) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t <= 1.35e+81) {
tmp = ((-4.0 * i) * x) - ((j * 27.0) * k);
} else {
tmp = fma(((y * x) * z), 18.0, (-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 (t <= -1.3e+20) tmp = Float64(fma(Float64(Float64(z * x) * y), 18.0, Float64(-4.0 * a)) * t); elseif (t <= -3.15e-164) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); elseif (t <= 1.35e+81) tmp = Float64(Float64(Float64(-4.0 * i) * x) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(fma(Float64(Float64(y * x) * z), 18.0, 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[t, -1.3e+20], N[(N[(N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision] * 18.0 + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, -3.15e-164], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+81], N[(N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision] * 18.0 + 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}\;t \leq -1.3 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(\left(z \cdot x\right) \cdot y, 18, -4 \cdot a\right) \cdot t\\
\mathbf{elif}\;t \leq -3.15 \cdot 10^{-164}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+81}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot x\right) \cdot z, 18, -4 \cdot a\right) \cdot t\\
\end{array}
\end{array}
if t < -1.3e20Initial program 84.2%
Taylor expanded in i around 0
associate--l+N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
Applied rewrites90.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6490.9
Applied rewrites90.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6490.5
Applied rewrites90.5%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6464.6
Applied rewrites64.6%
if -1.3e20 < t < -3.15000000000000004e-164Initial program 89.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6450.7
Applied rewrites50.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6450.7
Applied rewrites50.7%
if -3.15000000000000004e-164 < t < 1.35e81Initial program 85.9%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6453.1
Applied rewrites53.1%
if 1.35e81 < t Initial program 80.6%
Taylor expanded in i around 0
associate--l+N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
Applied rewrites88.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6488.4
Applied rewrites88.4%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6470.4
Applied rewrites70.4%
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 x) z) 18.0 (* -4.0 a)) t)))
(if (<= t -5.5e+16)
t_1
(if (<= t -3.15e-164)
(- (* c b) (* j (* k 27.0)))
(if (<= t 1.35e+81) (- (* (* -4.0 i) x) (* (* j 27.0) 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 * x) * z), 18.0, (-4.0 * a)) * t;
double tmp;
if (t <= -5.5e+16) {
tmp = t_1;
} else if (t <= -3.15e-164) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t <= 1.35e+81) {
tmp = ((-4.0 * i) * x) - ((j * 27.0) * 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(Float64(y * x) * z), 18.0, Float64(-4.0 * a)) * t) tmp = 0.0 if (t <= -5.5e+16) tmp = t_1; elseif (t <= -3.15e-164) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); elseif (t <= 1.35e+81) tmp = Float64(Float64(Float64(-4.0 * i) * x) - Float64(Float64(j * 27.0) * 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[(N[(y * x), $MachinePrecision] * z), $MachinePrecision] * 18.0 + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -5.5e+16], t$95$1, If[LessEqual[t, -3.15e-164], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+81], N[(N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision] - N[(N[(j * 27.0), $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 := \mathsf{fma}\left(\left(y \cdot x\right) \cdot z, 18, -4 \cdot a\right) \cdot t\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.15 \cdot 10^{-164}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+81}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.5e16 or 1.35e81 < t Initial program 82.7%
Taylor expanded in i around 0
associate--l+N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
Applied rewrites89.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6489.8
Applied rewrites89.8%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6467.2
Applied rewrites67.2%
if -5.5e16 < t < -3.15000000000000004e-164Initial program 89.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6450.6
Applied rewrites50.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6450.7
Applied rewrites50.7%
if -3.15000000000000004e-164 < t < 1.35e81Initial program 85.9%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6453.1
Applied rewrites53.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 (* (fma (* 18.0 t) (* z y) (* -4.0 i)) x)) (t_2 (* (* j 27.0) k)))
(if (<= x -7.8e+92)
t_1
(if (<= x -5.6e+23)
(- (* (* -4.0 i) x) t_2)
(if (<= x 4.5e-43) (- (* -4.0 (* a t)) t_2) 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((18.0 * t), (z * y), (-4.0 * i)) * x;
double t_2 = (j * 27.0) * k;
double tmp;
if (x <= -7.8e+92) {
tmp = t_1;
} else if (x <= -5.6e+23) {
tmp = ((-4.0 * i) * x) - t_2;
} else if (x <= 4.5e-43) {
tmp = (-4.0 * (a * t)) - t_2;
} 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(18.0 * t), Float64(z * y), Float64(-4.0 * i)) * x) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (x <= -7.8e+92) tmp = t_1; elseif (x <= -5.6e+23) tmp = Float64(Float64(Float64(-4.0 * i) * x) - t_2); elseif (x <= 4.5e-43) tmp = Float64(Float64(-4.0 * Float64(a * t)) - t_2); 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[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[x, -7.8e+92], t$95$1, If[LessEqual[x, -5.6e+23], N[(N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[x, 4.5e-43], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $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(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.6 \cdot 10^{+23}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x - t\_2\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-43}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right) - t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.80000000000000022e92 or 4.50000000000000025e-43 < x Initial program 75.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6462.6
Applied rewrites62.6%
if -7.80000000000000022e92 < x < -5.6e23Initial program 83.7%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6446.6
Applied rewrites46.6%
if -5.6e23 < x < 4.50000000000000025e-43Initial program 93.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6453.4
Applied rewrites53.4%
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 -5.8e-111)
(* (fma (* (* t z) 18.0) y (* -4.0 i)) x)
(if (<= x 4.5e-43)
(- (* -4.0 (* a t)) (* (* j 27.0) k))
(* (fma (* 18.0 t) (* z y) (* -4.0 i)) x))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -5.8e-111) {
tmp = fma(((t * z) * 18.0), y, (-4.0 * i)) * x;
} else if (x <= 4.5e-43) {
tmp = (-4.0 * (a * t)) - ((j * 27.0) * k);
} else {
tmp = fma((18.0 * t), (z * y), (-4.0 * i)) * x;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -5.8e-111) tmp = Float64(fma(Float64(Float64(t * z) * 18.0), y, Float64(-4.0 * i)) * x); elseif (x <= 4.5e-43) tmp = Float64(Float64(-4.0 * Float64(a * t)) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(fma(Float64(18.0 * t), Float64(z * y), Float64(-4.0 * i)) * x); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -5.8e-111], N[(N[(N[(N[(t * z), $MachinePrecision] * 18.0), $MachinePrecision] * y + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 4.5e-43], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $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}\;x \leq -5.8 \cdot 10^{-111}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, y, -4 \cdot i\right) \cdot x\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-43}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x\\
\end{array}
\end{array}
if x < -5.80000000000000003e-111Initial program 80.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6453.1
Applied rewrites53.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f6454.0
Applied rewrites54.0%
if -5.80000000000000003e-111 < x < 4.50000000000000025e-43Initial program 94.7%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6455.6
Applied rewrites55.6%
if 4.50000000000000025e-43 < x Initial program 77.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6458.6
Applied rewrites58.6%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -5.8e-111)
(* (fma (* t (* z 18.0)) y (* -4.0 i)) x)
(if (<= x 4.5e-43)
(- (* -4.0 (* a t)) (* (* j 27.0) k))
(* (fma (* 18.0 t) (* z y) (* -4.0 i)) x))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -5.8e-111) {
tmp = fma((t * (z * 18.0)), y, (-4.0 * i)) * x;
} else if (x <= 4.5e-43) {
tmp = (-4.0 * (a * t)) - ((j * 27.0) * k);
} else {
tmp = fma((18.0 * t), (z * y), (-4.0 * i)) * x;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -5.8e-111) tmp = Float64(fma(Float64(t * Float64(z * 18.0)), y, Float64(-4.0 * i)) * x); elseif (x <= 4.5e-43) tmp = Float64(Float64(-4.0 * Float64(a * t)) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(fma(Float64(18.0 * t), Float64(z * y), Float64(-4.0 * i)) * x); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -5.8e-111], N[(N[(N[(t * N[(z * 18.0), $MachinePrecision]), $MachinePrecision] * y + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 4.5e-43], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $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}\;x \leq -5.8 \cdot 10^{-111}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot \left(z \cdot 18\right), y, -4 \cdot i\right) \cdot x\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-43}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x\\
\end{array}
\end{array}
if x < -5.80000000000000003e-111Initial program 80.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6453.1
Applied rewrites53.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f6454.0
Applied rewrites54.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6454.1
Applied rewrites54.1%
if -5.80000000000000003e-111 < x < 4.50000000000000025e-43Initial program 94.7%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6455.6
Applied rewrites55.6%
if 4.50000000000000025e-43 < x Initial program 77.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6458.6
Applied rewrites58.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 (* (* j 27.0) k)) (t_2 (- (* (* -4.0 i) x) t_1)))
(if (<= i -3.3e+103)
t_2
(if (<= i -3.9e-23)
(* (* (* (* y x) z) t) 18.0)
(if (<= i 2.9e+16) (- (* -4.0 (* a t)) t_1) t_2)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = ((-4.0 * i) * x) - t_1;
double tmp;
if (i <= -3.3e+103) {
tmp = t_2;
} else if (i <= -3.9e-23) {
tmp = (((y * x) * z) * t) * 18.0;
} else if (i <= 2.9e+16) {
tmp = (-4.0 * (a * t)) - t_1;
} else {
tmp = t_2;
}
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 = (j * 27.0d0) * k
t_2 = (((-4.0d0) * i) * x) - t_1
if (i <= (-3.3d+103)) then
tmp = t_2
else if (i <= (-3.9d-23)) then
tmp = (((y * x) * z) * t) * 18.0d0
else if (i <= 2.9d+16) then
tmp = ((-4.0d0) * (a * t)) - t_1
else
tmp = t_2
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 t_2 = ((-4.0 * i) * x) - t_1;
double tmp;
if (i <= -3.3e+103) {
tmp = t_2;
} else if (i <= -3.9e-23) {
tmp = (((y * x) * z) * t) * 18.0;
} else if (i <= 2.9e+16) {
tmp = (-4.0 * (a * t)) - t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = ((-4.0 * i) * x) - t_1 tmp = 0 if i <= -3.3e+103: tmp = t_2 elif i <= -3.9e-23: tmp = (((y * x) * z) * t) * 18.0 elif i <= 2.9e+16: tmp = (-4.0 * (a * t)) - t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(Float64(-4.0 * i) * x) - t_1) tmp = 0.0 if (i <= -3.3e+103) tmp = t_2; elseif (i <= -3.9e-23) tmp = Float64(Float64(Float64(Float64(y * x) * z) * t) * 18.0); elseif (i <= 2.9e+16) tmp = Float64(Float64(-4.0 * Float64(a * t)) - t_1); else tmp = t_2; 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;
t_2 = ((-4.0 * i) * x) - t_1;
tmp = 0.0;
if (i <= -3.3e+103)
tmp = t_2;
elseif (i <= -3.9e-23)
tmp = (((y * x) * z) * t) * 18.0;
elseif (i <= 2.9e+16)
tmp = (-4.0 * (a * t)) - t_1;
else
tmp = t_2;
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]}, Block[{t$95$2 = N[(N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[i, -3.3e+103], t$95$2, If[LessEqual[i, -3.9e-23], N[(N[(N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision], If[LessEqual[i, 2.9e+16], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := \left(-4 \cdot i\right) \cdot x - t\_1\\
\mathbf{if}\;i \leq -3.3 \cdot 10^{+103}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;i \leq -3.9 \cdot 10^{-23}:\\
\;\;\;\;\left(\left(\left(y \cdot x\right) \cdot z\right) \cdot t\right) \cdot 18\\
\mathbf{elif}\;i \leq 2.9 \cdot 10^{+16}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if i < -3.30000000000000009e103 or 2.9e16 < i Initial program 82.3%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6455.2
Applied rewrites55.2%
if -3.30000000000000009e103 < i < -3.9e-23Initial program 85.0%
Taylor expanded in i around 0
associate--l+N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
Applied rewrites87.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6487.8
Applied rewrites87.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6426.6
Applied rewrites26.6%
if -3.9e-23 < i < 2.9e16Initial program 87.3%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6447.5
Applied rewrites47.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+305)
(* (* (* (* y x) z) t) 18.0)
(if (<= t_1 1e+168)
(- (* c b) (* j (* k 27.0)))
(if (<= t_1 1e+234)
(* (* -4.0 i) x)
(if (<= t_1 5e+298)
(* -4.0 (* a t))
(* (* (* (* t y) 18.0) z) 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+305) {
tmp = (((y * x) * z) * t) * 18.0;
} else if (t_1 <= 1e+168) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t_1 <= 1e+234) {
tmp = (-4.0 * i) * x;
} else if (t_1 <= 5e+298) {
tmp = -4.0 * (a * t);
} else {
tmp = (((t * y) * 18.0) * z) * 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+305)) then
tmp = (((y * x) * z) * t) * 18.0d0
else if (t_1 <= 1d+168) then
tmp = (c * b) - (j * (k * 27.0d0))
else if (t_1 <= 1d+234) then
tmp = ((-4.0d0) * i) * x
else if (t_1 <= 5d+298) then
tmp = (-4.0d0) * (a * t)
else
tmp = (((t * y) * 18.0d0) * z) * 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+305) {
tmp = (((y * x) * z) * t) * 18.0;
} else if (t_1 <= 1e+168) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t_1 <= 1e+234) {
tmp = (-4.0 * i) * x;
} else if (t_1 <= 5e+298) {
tmp = -4.0 * (a * t);
} else {
tmp = (((t * y) * 18.0) * z) * 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+305: tmp = (((y * x) * z) * t) * 18.0 elif t_1 <= 1e+168: tmp = (c * b) - (j * (k * 27.0)) elif t_1 <= 1e+234: tmp = (-4.0 * i) * x elif t_1 <= 5e+298: tmp = -4.0 * (a * t) else: tmp = (((t * y) * 18.0) * z) * 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+305) tmp = Float64(Float64(Float64(Float64(y * x) * z) * t) * 18.0); elseif (t_1 <= 1e+168) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); elseif (t_1 <= 1e+234) tmp = Float64(Float64(-4.0 * i) * x); elseif (t_1 <= 5e+298) tmp = Float64(-4.0 * Float64(a * t)); else tmp = Float64(Float64(Float64(Float64(t * y) * 18.0) * z) * 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+305)
tmp = (((y * x) * z) * t) * 18.0;
elseif (t_1 <= 1e+168)
tmp = (c * b) - (j * (k * 27.0));
elseif (t_1 <= 1e+234)
tmp = (-4.0 * i) * x;
elseif (t_1 <= 5e+298)
tmp = -4.0 * (a * t);
else
tmp = (((t * y) * 18.0) * z) * 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+305], N[(N[(N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+168], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+234], N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 5e+298], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * y), $MachinePrecision] * 18.0), $MachinePrecision] * z), $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 := \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^{+305}:\\
\;\;\;\;\left(\left(\left(y \cdot x\right) \cdot z\right) \cdot t\right) \cdot 18\\
\mathbf{elif}\;t\_1 \leq 10^{+168}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+234}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+298}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(t \cdot y\right) \cdot 18\right) \cdot z\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)) < -1.9999999999999999e305Initial program 83.6%
Taylor expanded in i around 0
associate--l+N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
Applied rewrites86.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6483.7
Applied rewrites83.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6439.6
Applied rewrites39.6%
if -1.9999999999999999e305 < (-.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)) < 9.9999999999999993e167Initial program 99.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6457.7
Applied rewrites57.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.8
Applied rewrites57.8%
if 9.9999999999999993e167 < (-.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)) < 1.00000000000000002e234Initial program 99.6%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6420.0
Applied rewrites20.0%
if 1.00000000000000002e234 < (-.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.0000000000000003e298Initial program 99.9%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6425.1
Applied rewrites25.1%
if 5.0000000000000003e298 < (-.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 59.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6459.8
Applied rewrites59.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6461.5
Applied rewrites61.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6444.0
Applied rewrites44.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
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))))
(if (<= t_1 -2e+305)
(* (* (* z y) (* t 18.0)) x)
(if (<= t_1 1e+168)
(- (* c b) (* j (* k 27.0)))
(if (<= t_1 1e+234)
(* (* -4.0 i) x)
(if (<= t_1 5e+298)
(* -4.0 (* a t))
(* (* (* (* t y) 18.0) z) 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+305) {
tmp = ((z * y) * (t * 18.0)) * x;
} else if (t_1 <= 1e+168) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t_1 <= 1e+234) {
tmp = (-4.0 * i) * x;
} else if (t_1 <= 5e+298) {
tmp = -4.0 * (a * t);
} else {
tmp = (((t * y) * 18.0) * z) * 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+305)) then
tmp = ((z * y) * (t * 18.0d0)) * x
else if (t_1 <= 1d+168) then
tmp = (c * b) - (j * (k * 27.0d0))
else if (t_1 <= 1d+234) then
tmp = ((-4.0d0) * i) * x
else if (t_1 <= 5d+298) then
tmp = (-4.0d0) * (a * t)
else
tmp = (((t * y) * 18.0d0) * z) * 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+305) {
tmp = ((z * y) * (t * 18.0)) * x;
} else if (t_1 <= 1e+168) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t_1 <= 1e+234) {
tmp = (-4.0 * i) * x;
} else if (t_1 <= 5e+298) {
tmp = -4.0 * (a * t);
} else {
tmp = (((t * y) * 18.0) * z) * 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+305: tmp = ((z * y) * (t * 18.0)) * x elif t_1 <= 1e+168: tmp = (c * b) - (j * (k * 27.0)) elif t_1 <= 1e+234: tmp = (-4.0 * i) * x elif t_1 <= 5e+298: tmp = -4.0 * (a * t) else: tmp = (((t * y) * 18.0) * z) * 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+305) tmp = Float64(Float64(Float64(z * y) * Float64(t * 18.0)) * x); elseif (t_1 <= 1e+168) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); elseif (t_1 <= 1e+234) tmp = Float64(Float64(-4.0 * i) * x); elseif (t_1 <= 5e+298) tmp = Float64(-4.0 * Float64(a * t)); else tmp = Float64(Float64(Float64(Float64(t * y) * 18.0) * z) * 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+305)
tmp = ((z * y) * (t * 18.0)) * x;
elseif (t_1 <= 1e+168)
tmp = (c * b) - (j * (k * 27.0));
elseif (t_1 <= 1e+234)
tmp = (-4.0 * i) * x;
elseif (t_1 <= 5e+298)
tmp = -4.0 * (a * t);
else
tmp = (((t * y) * 18.0) * z) * 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+305], N[(N[(N[(z * y), $MachinePrecision] * N[(t * 18.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 1e+168], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+234], N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 5e+298], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * y), $MachinePrecision] * 18.0), $MachinePrecision] * z), $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 := \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^{+305}:\\
\;\;\;\;\left(\left(z \cdot y\right) \cdot \left(t \cdot 18\right)\right) \cdot x\\
\mathbf{elif}\;t\_1 \leq 10^{+168}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+234}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+298}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(t \cdot y\right) \cdot 18\right) \cdot z\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)) < -1.9999999999999999e305Initial program 83.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6455.5
Applied rewrites55.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6440.3
Applied rewrites40.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.3
Applied rewrites40.3%
if -1.9999999999999999e305 < (-.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)) < 9.9999999999999993e167Initial program 99.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6457.7
Applied rewrites57.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.8
Applied rewrites57.8%
if 9.9999999999999993e167 < (-.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)) < 1.00000000000000002e234Initial program 99.6%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6420.0
Applied rewrites20.0%
if 1.00000000000000002e234 < (-.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.0000000000000003e298Initial program 99.9%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6425.1
Applied rewrites25.1%
if 5.0000000000000003e298 < (-.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 59.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6459.8
Applied rewrites59.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6461.5
Applied rewrites61.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6444.0
Applied rewrites44.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
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))))
(if (<= t_1 -2e+305)
(* (* (* t (* y 18.0)) z) x)
(if (<= t_1 1e+168)
(- (* c b) (* j (* k 27.0)))
(if (<= t_1 1e+234)
(* (* -4.0 i) x)
(if (<= t_1 5e+298)
(* -4.0 (* a t))
(* (* (* (* t y) 18.0) z) 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+305) {
tmp = ((t * (y * 18.0)) * z) * x;
} else if (t_1 <= 1e+168) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t_1 <= 1e+234) {
tmp = (-4.0 * i) * x;
} else if (t_1 <= 5e+298) {
tmp = -4.0 * (a * t);
} else {
tmp = (((t * y) * 18.0) * z) * 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+305)) then
tmp = ((t * (y * 18.0d0)) * z) * x
else if (t_1 <= 1d+168) then
tmp = (c * b) - (j * (k * 27.0d0))
else if (t_1 <= 1d+234) then
tmp = ((-4.0d0) * i) * x
else if (t_1 <= 5d+298) then
tmp = (-4.0d0) * (a * t)
else
tmp = (((t * y) * 18.0d0) * z) * 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+305) {
tmp = ((t * (y * 18.0)) * z) * x;
} else if (t_1 <= 1e+168) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t_1 <= 1e+234) {
tmp = (-4.0 * i) * x;
} else if (t_1 <= 5e+298) {
tmp = -4.0 * (a * t);
} else {
tmp = (((t * y) * 18.0) * z) * 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+305: tmp = ((t * (y * 18.0)) * z) * x elif t_1 <= 1e+168: tmp = (c * b) - (j * (k * 27.0)) elif t_1 <= 1e+234: tmp = (-4.0 * i) * x elif t_1 <= 5e+298: tmp = -4.0 * (a * t) else: tmp = (((t * y) * 18.0) * z) * 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+305) tmp = Float64(Float64(Float64(t * Float64(y * 18.0)) * z) * x); elseif (t_1 <= 1e+168) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); elseif (t_1 <= 1e+234) tmp = Float64(Float64(-4.0 * i) * x); elseif (t_1 <= 5e+298) tmp = Float64(-4.0 * Float64(a * t)); else tmp = Float64(Float64(Float64(Float64(t * y) * 18.0) * z) * 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+305)
tmp = ((t * (y * 18.0)) * z) * x;
elseif (t_1 <= 1e+168)
tmp = (c * b) - (j * (k * 27.0));
elseif (t_1 <= 1e+234)
tmp = (-4.0 * i) * x;
elseif (t_1 <= 5e+298)
tmp = -4.0 * (a * t);
else
tmp = (((t * y) * 18.0) * z) * 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+305], N[(N[(N[(t * N[(y * 18.0), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 1e+168], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+234], N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 5e+298], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * y), $MachinePrecision] * 18.0), $MachinePrecision] * z), $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 := \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^{+305}:\\
\;\;\;\;\left(\left(t \cdot \left(y \cdot 18\right)\right) \cdot z\right) \cdot x\\
\mathbf{elif}\;t\_1 \leq 10^{+168}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+234}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+298}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(t \cdot y\right) \cdot 18\right) \cdot z\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)) < -1.9999999999999999e305Initial program 83.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6455.5
Applied rewrites55.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.8
Applied rewrites58.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6442.2
Applied rewrites42.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6442.2
Applied rewrites42.2%
if -1.9999999999999999e305 < (-.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)) < 9.9999999999999993e167Initial program 99.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6457.7
Applied rewrites57.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.8
Applied rewrites57.8%
if 9.9999999999999993e167 < (-.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)) < 1.00000000000000002e234Initial program 99.6%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6420.0
Applied rewrites20.0%
if 1.00000000000000002e234 < (-.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.0000000000000003e298Initial program 99.9%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6425.1
Applied rewrites25.1%
if 5.0000000000000003e298 < (-.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 59.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6459.8
Applied rewrites59.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6461.5
Applied rewrites61.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6444.0
Applied rewrites44.0%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* (* t (* y 18.0)) z) x))
(t_2
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))))
(if (<= t_2 -2e+305)
t_1
(if (<= t_2 1e+168)
(- (* c b) (* j (* k 27.0)))
(if (<= t_2 1e+234)
(* (* -4.0 i) x)
(if (<= t_2 5e+298) (* -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 = ((t * (y * 18.0)) * z) * x;
double t_2 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
double tmp;
if (t_2 <= -2e+305) {
tmp = t_1;
} else if (t_2 <= 1e+168) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t_2 <= 1e+234) {
tmp = (-4.0 * i) * x;
} else if (t_2 <= 5e+298) {
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 = ((t * (y * 18.0d0)) * z) * x
t_2 = ((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)
if (t_2 <= (-2d+305)) then
tmp = t_1
else if (t_2 <= 1d+168) then
tmp = (c * b) - (j * (k * 27.0d0))
else if (t_2 <= 1d+234) then
tmp = ((-4.0d0) * i) * x
else if (t_2 <= 5d+298) 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 = ((t * (y * 18.0)) * z) * x;
double t_2 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
double tmp;
if (t_2 <= -2e+305) {
tmp = t_1;
} else if (t_2 <= 1e+168) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t_2 <= 1e+234) {
tmp = (-4.0 * i) * x;
} else if (t_2 <= 5e+298) {
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 = ((t * (y * 18.0)) * z) * x t_2 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i) tmp = 0 if t_2 <= -2e+305: tmp = t_1 elif t_2 <= 1e+168: tmp = (c * b) - (j * (k * 27.0)) elif t_2 <= 1e+234: tmp = (-4.0 * i) * x elif t_2 <= 5e+298: 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(Float64(Float64(t * Float64(y * 18.0)) * z) * x) 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 <= -2e+305) tmp = t_1; elseif (t_2 <= 1e+168) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); elseif (t_2 <= 1e+234) tmp = Float64(Float64(-4.0 * i) * x); elseif (t_2 <= 5e+298) 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 = ((t * (y * 18.0)) * z) * x;
t_2 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
tmp = 0.0;
if (t_2 <= -2e+305)
tmp = t_1;
elseif (t_2 <= 1e+168)
tmp = (c * b) - (j * (k * 27.0));
elseif (t_2 <= 1e+234)
tmp = (-4.0 * i) * x;
elseif (t_2 <= 5e+298)
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[(N[(N[(t * N[(y * 18.0), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * x), $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, -2e+305], t$95$1, If[LessEqual[t$95$2, 1e+168], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+234], N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$2, 5e+298], 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 := \left(\left(t \cdot \left(y \cdot 18\right)\right) \cdot z\right) \cdot x\\
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 -2 \cdot 10^{+305}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+168}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+234}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+298}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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)) < -1.9999999999999999e305 or 5.0000000000000003e298 < (-.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 69.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6458.0
Applied rewrites58.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6460.4
Applied rewrites60.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6443.2
Applied rewrites43.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.2
Applied rewrites43.2%
if -1.9999999999999999e305 < (-.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)) < 9.9999999999999993e167Initial program 99.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6457.7
Applied rewrites57.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.8
Applied rewrites57.8%
if 9.9999999999999993e167 < (-.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)) < 1.00000000000000002e234Initial program 99.6%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6420.0
Applied rewrites20.0%
if 1.00000000000000002e234 < (-.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.0000000000000003e298Initial program 99.9%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6425.1
Applied rewrites25.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))))
(if (<= t_1 (- INFINITY))
(* (* (* (* y x) z) t) 18.0)
(if (<= t_1 5e+298)
(- (* -4.0 (* a t)) (* (* j 27.0) k))
(* (* (* (* t y) 18.0) z) 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 <= -((double) INFINITY)) {
tmp = (((y * x) * z) * t) * 18.0;
} else if (t_1 <= 5e+298) {
tmp = (-4.0 * (a * t)) - ((j * 27.0) * k);
} else {
tmp = (((t * y) * 18.0) * z) * x;
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) {
tmp = (((y * x) * z) * t) * 18.0;
} else if (t_1 <= 5e+298) {
tmp = (-4.0 * (a * t)) - ((j * 27.0) * k);
} else {
tmp = (((t * y) * 18.0) * z) * 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 <= -math.inf: tmp = (((y * x) * z) * t) * 18.0 elif t_1 <= 5e+298: tmp = (-4.0 * (a * t)) - ((j * 27.0) * k) else: tmp = (((t * y) * 18.0) * z) * 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 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(y * x) * z) * t) * 18.0); elseif (t_1 <= 5e+298) tmp = Float64(Float64(-4.0 * Float64(a * t)) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(Float64(Float64(t * y) * 18.0) * z) * 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 <= -Inf)
tmp = (((y * x) * z) * t) * 18.0;
elseif (t_1 <= 5e+298)
tmp = (-4.0 * (a * t)) - ((j * 27.0) * k);
else
tmp = (((t * y) * 18.0) * z) * 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, (-Infinity)], N[(N[(N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+298], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * y), $MachinePrecision] * 18.0), $MachinePrecision] * z), $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 := \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 -\infty:\\
\;\;\;\;\left(\left(\left(y \cdot x\right) \cdot z\right) \cdot t\right) \cdot 18\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+298}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(t \cdot y\right) \cdot 18\right) \cdot z\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 83.4%
Taylor expanded in i around 0
associate--l+N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
Applied rewrites86.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6483.5
Applied rewrites83.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6439.7
Applied rewrites39.7%
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)) < 5.0000000000000003e298Initial program 99.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6452.9
Applied rewrites52.9%
if 5.0000000000000003e298 < (-.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 59.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6459.8
Applied rewrites59.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6461.5
Applied rewrites61.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6444.0
Applied rewrites44.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 (* -4.0 (* a t))))
(if (<= t -2.35e+30)
t_1
(if (<= t 7.6e+35)
(- (* c b) (* (* j 27.0) k))
(if (<= t 3.8e+151) (* (* -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 = -4.0 * (a * t);
double tmp;
if (t <= -2.35e+30) {
tmp = t_1;
} else if (t <= 7.6e+35) {
tmp = (c * b) - ((j * 27.0) * k);
} else if (t <= 3.8e+151) {
tmp = (-4.0 * i) * x;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (a * t)
if (t <= (-2.35d+30)) then
tmp = t_1
else if (t <= 7.6d+35) then
tmp = (c * b) - ((j * 27.0d0) * k)
else if (t <= 3.8d+151) then
tmp = ((-4.0d0) * i) * x
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (a * t);
double tmp;
if (t <= -2.35e+30) {
tmp = t_1;
} else if (t <= 7.6e+35) {
tmp = (c * b) - ((j * 27.0) * k);
} else if (t <= 3.8e+151) {
tmp = (-4.0 * i) * x;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (a * t) tmp = 0 if t <= -2.35e+30: tmp = t_1 elif t <= 7.6e+35: tmp = (c * b) - ((j * 27.0) * k) elif t <= 3.8e+151: tmp = (-4.0 * i) * x else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(a * t)) tmp = 0.0 if (t <= -2.35e+30) tmp = t_1; elseif (t <= 7.6e+35) tmp = Float64(Float64(c * b) - Float64(Float64(j * 27.0) * k)); elseif (t <= 3.8e+151) tmp = Float64(Float64(-4.0 * i) * x); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * (a * t);
tmp = 0.0;
if (t <= -2.35e+30)
tmp = t_1;
elseif (t <= 7.6e+35)
tmp = (c * b) - ((j * 27.0) * k);
elseif (t <= 3.8e+151)
tmp = (-4.0 * i) * x;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.35e+30], t$95$1, If[LessEqual[t, 7.6e+35], N[(N[(c * b), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e+151], N[(N[(-4.0 * i), $MachinePrecision] * x), $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(a \cdot t\right)\\
\mathbf{if}\;t \leq -2.35 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.6 \cdot 10^{+35}:\\
\;\;\;\;c \cdot b - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+151}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.34999999999999995e30 or 3.8e151 < t Initial program 82.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6437.5
Applied rewrites37.5%
if -2.34999999999999995e30 < t < 7.5999999999999999e35Initial program 86.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6455.5
Applied rewrites55.5%
if 7.5999999999999999e35 < t < 3.8e151Initial program 86.6%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6415.1
Applied rewrites15.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 (* a t))))
(if (<= t -2.35e+30)
t_1
(if (<= t 7.6e+35)
(- (* c b) (* j (* k 27.0)))
(if (<= t 3.8e+151) (* (* -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 = -4.0 * (a * t);
double tmp;
if (t <= -2.35e+30) {
tmp = t_1;
} else if (t <= 7.6e+35) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t <= 3.8e+151) {
tmp = (-4.0 * i) * x;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (a * t)
if (t <= (-2.35d+30)) then
tmp = t_1
else if (t <= 7.6d+35) then
tmp = (c * b) - (j * (k * 27.0d0))
else if (t <= 3.8d+151) then
tmp = ((-4.0d0) * i) * x
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (a * t);
double tmp;
if (t <= -2.35e+30) {
tmp = t_1;
} else if (t <= 7.6e+35) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t <= 3.8e+151) {
tmp = (-4.0 * i) * x;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (a * t) tmp = 0 if t <= -2.35e+30: tmp = t_1 elif t <= 7.6e+35: tmp = (c * b) - (j * (k * 27.0)) elif t <= 3.8e+151: tmp = (-4.0 * i) * x else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(a * t)) tmp = 0.0 if (t <= -2.35e+30) tmp = t_1; elseif (t <= 7.6e+35) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); elseif (t <= 3.8e+151) tmp = Float64(Float64(-4.0 * i) * x); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * (a * t);
tmp = 0.0;
if (t <= -2.35e+30)
tmp = t_1;
elseif (t <= 7.6e+35)
tmp = (c * b) - (j * (k * 27.0));
elseif (t <= 3.8e+151)
tmp = (-4.0 * i) * x;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.35e+30], t$95$1, If[LessEqual[t, 7.6e+35], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e+151], N[(N[(-4.0 * i), $MachinePrecision] * x), $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(a \cdot t\right)\\
\mathbf{if}\;t \leq -2.35 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.6 \cdot 10^{+35}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+151}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.34999999999999995e30 or 3.8e151 < t Initial program 82.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6437.5
Applied rewrites37.5%
if -2.34999999999999995e30 < t < 7.5999999999999999e35Initial program 86.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6455.5
Applied rewrites55.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6455.6
Applied rewrites55.6%
if 7.5999999999999999e35 < t < 3.8e151Initial program 86.6%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6415.1
Applied rewrites15.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 (* (* j 27.0) k)))
(if (<= t_1 -2e+172)
(* (* -27.0 k) j)
(if (<= t_1 -4e+137)
(* c b)
(if (<= t_1 20000000.0) (* (* -4.0 i) x) (* (* -27.0 j) k))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+172) {
tmp = (-27.0 * k) * j;
} else if (t_1 <= -4e+137) {
tmp = c * b;
} else if (t_1 <= 20000000.0) {
tmp = (-4.0 * i) * x;
} else {
tmp = (-27.0 * j) * k;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t_1 <= (-2d+172)) then
tmp = ((-27.0d0) * k) * j
else if (t_1 <= (-4d+137)) then
tmp = c * b
else if (t_1 <= 20000000.0d0) then
tmp = ((-4.0d0) * i) * x
else
tmp = ((-27.0d0) * j) * k
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+172) {
tmp = (-27.0 * k) * j;
} else if (t_1 <= -4e+137) {
tmp = c * b;
} else if (t_1 <= 20000000.0) {
tmp = (-4.0 * i) * x;
} else {
tmp = (-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]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t_1 <= -2e+172: tmp = (-27.0 * k) * j elif t_1 <= -4e+137: tmp = c * b elif t_1 <= 20000000.0: tmp = (-4.0 * i) * x else: tmp = (-27.0 * j) * k return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -2e+172) tmp = Float64(Float64(-27.0 * k) * j); elseif (t_1 <= -4e+137) tmp = Float64(c * b); elseif (t_1 <= 20000000.0) tmp = Float64(Float64(-4.0 * i) * x); else tmp = Float64(Float64(-27.0 * j) * k); end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (t_1 <= -2e+172)
tmp = (-27.0 * k) * j;
elseif (t_1 <= -4e+137)
tmp = c * b;
elseif (t_1 <= 20000000.0)
tmp = (-4.0 * i) * x;
else
tmp = (-27.0 * j) * k;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+172], N[(N[(-27.0 * k), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[t$95$1, -4e+137], N[(c * b), $MachinePrecision], If[LessEqual[t$95$1, 20000000.0], N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+172}:\\
\;\;\;\;\left(-27 \cdot k\right) \cdot j\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+137}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;t\_1 \leq 20000000:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.0000000000000002e172Initial program 79.3%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6465.7
Applied rewrites65.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6465.7
Applied rewrites65.7%
if -2.0000000000000002e172 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.0000000000000001e137Initial program 85.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6425.8
Applied rewrites25.8%
if -4.0000000000000001e137 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e7Initial program 87.7%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6424.4
Applied rewrites24.4%
if 2e7 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 81.7%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.3
Applied rewrites45.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6445.3
Applied rewrites45.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 (* (* j 27.0) k)))
(if (<= t_1 -2e+172)
(* (* -27.0 k) j)
(if (<= t_1 -5e-71)
(* c b)
(if (<= t_1 1e+81) (* -4.0 (* a t)) (* (* -27.0 j) k))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+172) {
tmp = (-27.0 * k) * j;
} else if (t_1 <= -5e-71) {
tmp = c * b;
} else if (t_1 <= 1e+81) {
tmp = -4.0 * (a * t);
} else {
tmp = (-27.0 * j) * k;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t_1 <= (-2d+172)) then
tmp = ((-27.0d0) * k) * j
else if (t_1 <= (-5d-71)) then
tmp = c * b
else if (t_1 <= 1d+81) then
tmp = (-4.0d0) * (a * t)
else
tmp = ((-27.0d0) * j) * k
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+172) {
tmp = (-27.0 * k) * j;
} else if (t_1 <= -5e-71) {
tmp = c * b;
} else if (t_1 <= 1e+81) {
tmp = -4.0 * (a * t);
} else {
tmp = (-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]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t_1 <= -2e+172: tmp = (-27.0 * k) * j elif t_1 <= -5e-71: tmp = c * b elif t_1 <= 1e+81: tmp = -4.0 * (a * t) else: tmp = (-27.0 * j) * k return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -2e+172) tmp = Float64(Float64(-27.0 * k) * j); elseif (t_1 <= -5e-71) tmp = Float64(c * b); elseif (t_1 <= 1e+81) tmp = Float64(-4.0 * Float64(a * t)); else tmp = Float64(Float64(-27.0 * j) * k); end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (t_1 <= -2e+172)
tmp = (-27.0 * k) * j;
elseif (t_1 <= -5e-71)
tmp = c * b;
elseif (t_1 <= 1e+81)
tmp = -4.0 * (a * t);
else
tmp = (-27.0 * j) * k;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+172], N[(N[(-27.0 * k), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[t$95$1, -5e-71], N[(c * b), $MachinePrecision], If[LessEqual[t$95$1, 1e+81], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+172}:\\
\;\;\;\;\left(-27 \cdot k\right) \cdot j\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-71}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;t\_1 \leq 10^{+81}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.0000000000000002e172Initial program 79.3%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6465.7
Applied rewrites65.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6465.7
Applied rewrites65.7%
if -2.0000000000000002e172 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.99999999999999998e-71Initial program 87.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6425.4
Applied rewrites25.4%
if -4.99999999999999998e-71 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.99999999999999921e80Initial program 87.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6425.8
Applied rewrites25.8%
if 9.99999999999999921e80 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 81.1%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6454.6
Applied rewrites54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6454.6
Applied rewrites54.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 (* (* j 27.0) k)))
(if (<= t_1 -2e+172)
(* -27.0 (* k j))
(if (<= t_1 -5e-71)
(* c b)
(if (<= t_1 1e+81) (* -4.0 (* a t)) (* (* -27.0 j) k))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+172) {
tmp = -27.0 * (k * j);
} else if (t_1 <= -5e-71) {
tmp = c * b;
} else if (t_1 <= 1e+81) {
tmp = -4.0 * (a * t);
} else {
tmp = (-27.0 * j) * k;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t_1 <= (-2d+172)) then
tmp = (-27.0d0) * (k * j)
else if (t_1 <= (-5d-71)) then
tmp = c * b
else if (t_1 <= 1d+81) then
tmp = (-4.0d0) * (a * t)
else
tmp = ((-27.0d0) * j) * k
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+172) {
tmp = -27.0 * (k * j);
} else if (t_1 <= -5e-71) {
tmp = c * b;
} else if (t_1 <= 1e+81) {
tmp = -4.0 * (a * t);
} else {
tmp = (-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]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t_1 <= -2e+172: tmp = -27.0 * (k * j) elif t_1 <= -5e-71: tmp = c * b elif t_1 <= 1e+81: tmp = -4.0 * (a * t) else: tmp = (-27.0 * j) * k return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -2e+172) tmp = Float64(-27.0 * Float64(k * j)); elseif (t_1 <= -5e-71) tmp = Float64(c * b); elseif (t_1 <= 1e+81) tmp = Float64(-4.0 * Float64(a * t)); else tmp = Float64(Float64(-27.0 * j) * k); end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (t_1 <= -2e+172)
tmp = -27.0 * (k * j);
elseif (t_1 <= -5e-71)
tmp = c * b;
elseif (t_1 <= 1e+81)
tmp = -4.0 * (a * t);
else
tmp = (-27.0 * j) * k;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+172], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-71], N[(c * b), $MachinePrecision], If[LessEqual[t$95$1, 1e+81], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+172}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-71}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;t\_1 \leq 10^{+81}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.0000000000000002e172Initial program 79.3%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6465.7
Applied rewrites65.7%
if -2.0000000000000002e172 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.99999999999999998e-71Initial program 87.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6425.4
Applied rewrites25.4%
if -4.99999999999999998e-71 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.99999999999999921e80Initial program 87.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6425.8
Applied rewrites25.8%
if 9.99999999999999921e80 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 81.1%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6454.6
Applied rewrites54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6454.6
Applied rewrites54.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 (* -27.0 (* k j))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -2e+172)
t_1
(if (<= t_2 -5e-71) (* c b) (if (<= t_2 1e+81) (* -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 * (k * j);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+172) {
tmp = t_1;
} else if (t_2 <= -5e-71) {
tmp = c * b;
} else if (t_2 <= 1e+81) {
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) * (k * j)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-2d+172)) then
tmp = t_1
else if (t_2 <= (-5d-71)) then
tmp = c * b
else if (t_2 <= 1d+81) 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 * (k * j);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+172) {
tmp = t_1;
} else if (t_2 <= -5e-71) {
tmp = c * b;
} else if (t_2 <= 1e+81) {
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 * (k * j) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -2e+172: tmp = t_1 elif t_2 <= -5e-71: tmp = c * b elif t_2 <= 1e+81: 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(k * j)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e+172) tmp = t_1; elseif (t_2 <= -5e-71) tmp = Float64(c * b); elseif (t_2 <= 1e+81) 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 * (k * j);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -2e+172)
tmp = t_1;
elseif (t_2 <= -5e-71)
tmp = c * b;
elseif (t_2 <= 1e+81)
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[(k * j), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+172], t$95$1, If[LessEqual[t$95$2, -5e-71], N[(c * b), $MachinePrecision], If[LessEqual[t$95$2, 1e+81], 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(k \cdot j\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-71}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;t\_2 \leq 10^{+81}:\\
\;\;\;\;-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.0000000000000002e172 or 9.99999999999999921e80 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 80.3%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6459.2
Applied rewrites59.2%
if -2.0000000000000002e172 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.99999999999999998e-71Initial program 87.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6425.4
Applied rewrites25.4%
if -4.99999999999999998e-71 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.99999999999999921e80Initial program 87.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6425.8
Applied rewrites25.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 (* k j))) (t_2 (* (* j 27.0) k))) (if (<= t_2 -2e+172) t_1 (if (<= t_2 200000.0) (* 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 = -27.0 * (k * j);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+172) {
tmp = t_1;
} else if (t_2 <= 200000.0) {
tmp = c * b;
} 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) * (k * j)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-2d+172)) then
tmp = t_1
else if (t_2 <= 200000.0d0) then
tmp = c * b
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 * (k * j);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+172) {
tmp = t_1;
} else if (t_2 <= 200000.0) {
tmp = 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]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (k * j) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -2e+172: tmp = t_1 elif t_2 <= 200000.0: tmp = c * b else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(k * j)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e+172) tmp = t_1; elseif (t_2 <= 200000.0) tmp = Float64(c * b); 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 * (k * j);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -2e+172)
tmp = t_1;
elseif (t_2 <= 200000.0)
tmp = c * b;
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[(k * j), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+172], t$95$1, If[LessEqual[t$95$2, 200000.0], N[(c * b), $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(k \cdot j\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 200000:\\
\;\;\;\;c \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.0000000000000002e172 or 2e5 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 80.9%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6452.3
Applied rewrites52.3%
if -2.0000000000000002e172 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e5Initial program 87.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6428.4
Applied rewrites28.4%
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 (* 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) {
return c * b;
}
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 = c * b
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 c * b;
}
[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 c * b
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(c * b) 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 = c * b;
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[(c * b), $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])\\
\\
c \cdot b
\end{array}
Initial program 85.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6424.2
Applied rewrites24.2%
herbie shell --seed 2025115
(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)))