
(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 21 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 (* (* j 27.0) k)))
(if (<= z 9e+123)
(-
(fma t (- (* (* x 18.0) (* y z)) (* a 4.0)) (* b c))
(fma (* x 4.0) i t_1))
(-
(-
(+ (* z (fma -4.0 (/ (* a t) z) (* 18.0 (* t (* x y))))) (* b c))
(* (* x 4.0) i))
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 = (j * 27.0) * k;
double tmp;
if (z <= 9e+123) {
tmp = fma(t, (((x * 18.0) * (y * z)) - (a * 4.0)), (b * c)) - fma((x * 4.0), i, t_1);
} else {
tmp = (((z * fma(-4.0, ((a * t) / z), (18.0 * (t * (x * y))))) + (b * c)) - ((x * 4.0) * i)) - 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(j * 27.0) * k) tmp = 0.0 if (z <= 9e+123) tmp = Float64(fma(t, Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)), Float64(b * c)) - fma(Float64(x * 4.0), i, t_1)); else tmp = Float64(Float64(Float64(Float64(z * fma(-4.0, Float64(Float64(a * t) / z), Float64(18.0 * Float64(t * Float64(x * y))))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - 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[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[z, 9e+123], N[(N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z * N[(-4.0 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision] + N[(18.0 * N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - t$95$1), $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}\;z \leq 9 \cdot 10^{+123}:\\
\;\;\;\;\mathsf{fma}\left(t, \left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4, b \cdot c\right) - \mathsf{fma}\left(x \cdot 4, i, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(z \cdot \mathsf{fma}\left(-4, \frac{a \cdot t}{z}, 18 \cdot \left(t \cdot \left(x \cdot y\right)\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1\\
\end{array}
\end{array}
if z < 8.99999999999999965e123Initial program 84.9%
Applied rewrites87.5%
if 8.99999999999999965e123 < z Initial program 84.9%
Taylor expanded in z around inf
Applied rewrites80.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 (<= y -5e+57)
(-
(-
(+ (* y (fma -4.0 (/ (* a t) y) (* 18.0 (* t (* x z))))) (* b c))
(* (* x 4.0) i))
t_1)
(-
(fma t (- (* (* x 18.0) (* y z)) (* a 4.0)) (* b c))
(fma (* x 4.0) i 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 = (j * 27.0) * k;
double tmp;
if (y <= -5e+57) {
tmp = (((y * fma(-4.0, ((a * t) / y), (18.0 * (t * (x * z))))) + (b * c)) - ((x * 4.0) * i)) - t_1;
} else {
tmp = fma(t, (((x * 18.0) * (y * z)) - (a * 4.0)), (b * c)) - fma((x * 4.0), i, 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(j * 27.0) * k) tmp = 0.0 if (y <= -5e+57) tmp = Float64(Float64(Float64(Float64(y * fma(-4.0, Float64(Float64(a * t) / y), Float64(18.0 * Float64(t * Float64(x * z))))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - t_1); else tmp = Float64(fma(t, Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)), Float64(b * c)) - fma(Float64(x * 4.0), i, 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[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[y, -5e+57], N[(N[(N[(N[(y * N[(-4.0 * N[(N[(a * t), $MachinePrecision] / y), $MachinePrecision] + N[(18.0 * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;y \leq -5 \cdot 10^{+57}:\\
\;\;\;\;\left(\left(y \cdot \mathsf{fma}\left(-4, \frac{a \cdot t}{y}, 18 \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4, b \cdot c\right) - \mathsf{fma}\left(x \cdot 4, i, t\_1\right)\\
\end{array}
\end{array}
if y < -4.99999999999999972e57Initial program 84.9%
Taylor expanded in y around inf
Applied rewrites80.0%
if -4.99999999999999972e57 < y Initial program 84.9%
Applied rewrites87.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 (- (fma t (- (* (* x 18.0) (* y z)) (* a 4.0)) (* b c)) (fma (* x 4.0) i (* (* j 27.0) k))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return fma(t, (((x * 18.0) * (y * z)) - (a * 4.0)), (b * c)) - fma((x * 4.0), i, ((j * 27.0) * k));
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(fma(t, Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)), Float64(b * c)) - fma(Float64(x * 4.0), i, Float64(Float64(j * 27.0) * k))) end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i + N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\mathsf{fma}\left(t, \left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4, b \cdot c\right) - \mathsf{fma}\left(x \cdot 4, i, \left(j \cdot 27\right) \cdot k\right)
\end{array}
Initial program 84.9%
Applied rewrites87.5%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma 4.0 (* i x) (* 27.0 (* j k)))))
(if (<= z -2.4e-53)
(- (* y (fma 18.0 (* t (* x z)) (/ (* b c) y))) t_1)
(if (<= z 9e+123)
(- (fma t (* -4.0 a) (* b c)) (fma (* x 4.0) i (* (* j 27.0) k)))
(- (* z (fma 18.0 (* t (* x y)) (/ (* b c) z))) 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(4.0, (i * x), (27.0 * (j * k)));
double tmp;
if (z <= -2.4e-53) {
tmp = (y * fma(18.0, (t * (x * z)), ((b * c) / y))) - t_1;
} else if (z <= 9e+123) {
tmp = fma(t, (-4.0 * a), (b * c)) - fma((x * 4.0), i, ((j * 27.0) * k));
} else {
tmp = (z * fma(18.0, (t * (x * y)), ((b * c) / z))) - t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(4.0, Float64(i * x), Float64(27.0 * Float64(j * k))) tmp = 0.0 if (z <= -2.4e-53) tmp = Float64(Float64(y * fma(18.0, Float64(t * Float64(x * z)), Float64(Float64(b * c) / y))) - t_1); elseif (z <= 9e+123) tmp = Float64(fma(t, Float64(-4.0 * a), Float64(b * c)) - fma(Float64(x * 4.0), i, Float64(Float64(j * 27.0) * k))); else tmp = Float64(Float64(z * fma(18.0, Float64(t * Float64(x * y)), Float64(Float64(b * c) / z))) - t_1); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(4.0 * N[(i * x), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e-53], N[(N[(y * N[(18.0 * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, 9e+123], N[(N[(t * N[(-4.0 * a), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i + N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(18.0 * N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{-53}:\\
\;\;\;\;y \cdot \mathsf{fma}\left(18, t \cdot \left(x \cdot z\right), \frac{b \cdot c}{y}\right) - t\_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+123}:\\
\;\;\;\;\mathsf{fma}\left(t, -4 \cdot a, b \cdot c\right) - \mathsf{fma}\left(x \cdot 4, i, \left(j \cdot 27\right) \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{fma}\left(18, t \cdot \left(x \cdot y\right), \frac{b \cdot c}{z}\right) - t\_1\\
\end{array}
\end{array}
if z < -2.40000000000000007e-53Initial program 84.9%
Taylor expanded in a around 0
Applied rewrites72.7%
Taylor expanded in y around inf
Applied rewrites68.8%
if -2.40000000000000007e-53 < z < 8.99999999999999965e123Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in x around 0
Applied rewrites76.9%
if 8.99999999999999965e123 < z Initial program 84.9%
Taylor expanded in a around 0
Applied rewrites72.7%
Taylor expanded in z around inf
Applied rewrites68.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma 4.0 (* i x) (* 27.0 (* j k)))))
(if (<= i -4.5e+29)
(- (* b c) (fma 4.0 (* a t) t_1))
(if (<= i 1.85e+37)
(- (fma t (fma (* x 18.0) (* y z) (* a -4.0)) (* b c)) (* (* j 27.0) k))
(- (fma 18.0 (* t (* x (* y z))) (* b c)) t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = fma(4.0, (i * x), (27.0 * (j * k)));
double tmp;
if (i <= -4.5e+29) {
tmp = (b * c) - fma(4.0, (a * t), t_1);
} else if (i <= 1.85e+37) {
tmp = fma(t, fma((x * 18.0), (y * z), (a * -4.0)), (b * c)) - ((j * 27.0) * k);
} else {
tmp = fma(18.0, (t * (x * (y * z))), (b * c)) - t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(4.0, Float64(i * x), Float64(27.0 * Float64(j * k))) tmp = 0.0 if (i <= -4.5e+29) tmp = Float64(Float64(b * c) - fma(4.0, Float64(a * t), t_1)); elseif (i <= 1.85e+37) tmp = Float64(fma(t, fma(Float64(x * 18.0), Float64(y * z), Float64(a * -4.0)), Float64(b * c)) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(fma(18.0, Float64(t * Float64(x * Float64(y * z))), Float64(b * c)) - t_1); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(4.0 * N[(i * x), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -4.5e+29], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.85e+37], N[(N[(t * N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{if}\;i \leq -4.5 \cdot 10^{+29}:\\
\;\;\;\;b \cdot c - \mathsf{fma}\left(4, a \cdot t, t\_1\right)\\
\mathbf{elif}\;i \leq 1.85 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(x \cdot 18, y \cdot z, a \cdot -4\right), b \cdot c\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18, t \cdot \left(x \cdot \left(y \cdot z\right)\right), b \cdot c\right) - t\_1\\
\end{array}
\end{array}
if i < -4.5000000000000002e29Initial program 84.9%
Taylor expanded in y around 0
Applied rewrites76.4%
if -4.5000000000000002e29 < i < 1.85e37Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in x around 0
Applied rewrites76.2%
Applied rewrites76.1%
if 1.85e37 < i Initial program 84.9%
Taylor expanded in a around 0
Applied rewrites72.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 (<= i -4.5e+29)
(- (* b c) (fma 4.0 (* a t) (fma 4.0 (* i x) (* 27.0 (* j k)))))
(if (<= i 1.4e+47)
(- (fma t (fma (* x 18.0) (* y z) (* a -4.0)) (* b c)) t_1)
(- (fma t (* -4.0 a) (* b c)) (fma (* x 4.0) i 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 = (j * 27.0) * k;
double tmp;
if (i <= -4.5e+29) {
tmp = (b * c) - fma(4.0, (a * t), fma(4.0, (i * x), (27.0 * (j * k))));
} else if (i <= 1.4e+47) {
tmp = fma(t, fma((x * 18.0), (y * z), (a * -4.0)), (b * c)) - t_1;
} else {
tmp = fma(t, (-4.0 * a), (b * c)) - fma((x * 4.0), i, 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(j * 27.0) * k) tmp = 0.0 if (i <= -4.5e+29) tmp = Float64(Float64(b * c) - fma(4.0, Float64(a * t), fma(4.0, Float64(i * x), Float64(27.0 * Float64(j * k))))); elseif (i <= 1.4e+47) tmp = Float64(fma(t, fma(Float64(x * 18.0), Float64(y * z), Float64(a * -4.0)), Float64(b * c)) - t_1); else tmp = Float64(fma(t, Float64(-4.0 * a), Float64(b * c)) - fma(Float64(x * 4.0), i, 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[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[i, -4.5e+29], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision] + N[(4.0 * N[(i * x), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.4e+47], N[(N[(t * N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(t * N[(-4.0 * a), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;i \leq -4.5 \cdot 10^{+29}:\\
\;\;\;\;b \cdot c - \mathsf{fma}\left(4, a \cdot t, \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right)\right)\\
\mathbf{elif}\;i \leq 1.4 \cdot 10^{+47}:\\
\;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(x \cdot 18, y \cdot z, a \cdot -4\right), b \cdot c\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, -4 \cdot a, b \cdot c\right) - \mathsf{fma}\left(x \cdot 4, i, t\_1\right)\\
\end{array}
\end{array}
if i < -4.5000000000000002e29Initial program 84.9%
Taylor expanded in y around 0
Applied rewrites76.4%
if -4.5000000000000002e29 < i < 1.39999999999999994e47Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in x around 0
Applied rewrites76.2%
Applied rewrites76.1%
if 1.39999999999999994e47 < i Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in x around 0
Applied rewrites76.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
(let* ((t_1 (* t (* x (* y z)))) (t_2 (fma (* x 4.0) i (* (* j 27.0) k))))
(if (<= y -2.4e+233)
(- (fma 18.0 t_1 (* b c)) (* 27.0 (* j k)))
(if (<= y 1.22e-53)
(- (fma t (* -4.0 a) (* b c)) t_2)
(- (* 18.0 t_1) t_2)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (x * (y * z));
double t_2 = fma((x * 4.0), i, ((j * 27.0) * k));
double tmp;
if (y <= -2.4e+233) {
tmp = fma(18.0, t_1, (b * c)) - (27.0 * (j * k));
} else if (y <= 1.22e-53) {
tmp = fma(t, (-4.0 * a), (b * c)) - t_2;
} else {
tmp = (18.0 * t_1) - t_2;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(x * Float64(y * z))) t_2 = fma(Float64(x * 4.0), i, Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (y <= -2.4e+233) tmp = Float64(fma(18.0, t_1, Float64(b * c)) - Float64(27.0 * Float64(j * k))); elseif (y <= 1.22e-53) tmp = Float64(fma(t, Float64(-4.0 * a), Float64(b * c)) - t_2); else tmp = Float64(Float64(18.0 * t_1) - t_2); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 4.0), $MachinePrecision] * i + N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e+233], N[(N[(18.0 * t$95$1 + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.22e-53], N[(N[(t * N[(-4.0 * a), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(18.0 * t$95$1), $MachinePrecision] - t$95$2), $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 := t \cdot \left(x \cdot \left(y \cdot z\right)\right)\\
t_2 := \mathsf{fma}\left(x \cdot 4, i, \left(j \cdot 27\right) \cdot k\right)\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+233}:\\
\;\;\;\;\mathsf{fma}\left(18, t\_1, b \cdot c\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{-53}:\\
\;\;\;\;\mathsf{fma}\left(t, -4 \cdot a, b \cdot c\right) - t\_2\\
\mathbf{else}:\\
\;\;\;\;18 \cdot t\_1 - t\_2\\
\end{array}
\end{array}
if y < -2.40000000000000003e233Initial program 84.9%
Taylor expanded in a around 0
Applied rewrites72.7%
Taylor expanded in i around 0
Applied rewrites61.2%
if -2.40000000000000003e233 < y < 1.22000000000000003e-53Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in x around 0
Applied rewrites76.9%
if 1.22000000000000003e-53 < y Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in x around inf
Applied rewrites56.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 (* x (* y z))) (* b c)) (* 27.0 (* j k)))))
(if (<= y -2.4e+233)
t_1
(if (<= y 6.4e-42)
(- (fma t (* -4.0 a) (* b c)) (fma (* x 4.0) i (* (* 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(18.0, (t * (x * (y * z))), (b * c)) - (27.0 * (j * k));
double tmp;
if (y <= -2.4e+233) {
tmp = t_1;
} else if (y <= 6.4e-42) {
tmp = fma(t, (-4.0 * a), (b * c)) - fma((x * 4.0), i, ((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(18.0, Float64(t * Float64(x * Float64(y * z))), Float64(b * c)) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (y <= -2.4e+233) tmp = t_1; elseif (y <= 6.4e-42) tmp = Float64(fma(t, Float64(-4.0 * a), Float64(b * c)) - fma(Float64(x * 4.0), i, 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[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e+233], t$95$1, If[LessEqual[y, 6.4e-42], N[(N[(t * N[(-4.0 * a), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i + N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(18, t \cdot \left(x \cdot \left(y \cdot z\right)\right), b \cdot c\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+233}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{-42}:\\
\;\;\;\;\mathsf{fma}\left(t, -4 \cdot a, b \cdot c\right) - \mathsf{fma}\left(x \cdot 4, i, \left(j \cdot 27\right) \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.40000000000000003e233 or 6.4000000000000005e-42 < y Initial program 84.9%
Taylor expanded in a around 0
Applied rewrites72.7%
Taylor expanded in i around 0
Applied rewrites61.2%
if -2.40000000000000003e233 < y < 6.4000000000000005e-42Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in x around 0
Applied rewrites76.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
(let* ((t_1 (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))))
(if (<= x -1.6e+159)
t_1
(if (<= x 1.25e+97)
(- (fma t (* -4.0 a) (* b c)) (* 27.0 (* j k)))
(if (<= x 5e+200)
(- (* x (fma (/ c x) b (* i -4.0))) (* (* 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 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -1.6e+159) {
tmp = t_1;
} else if (x <= 1.25e+97) {
tmp = fma(t, (-4.0 * a), (b * c)) - (27.0 * (j * k));
} else if (x <= 5e+200) {
tmp = (x * fma((c / x), b, (i * -4.0))) - ((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(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -1.6e+159) tmp = t_1; elseif (x <= 1.25e+97) tmp = Float64(fma(t, Float64(-4.0 * a), Float64(b * c)) - Float64(27.0 * Float64(j * k))); elseif (x <= 5e+200) tmp = Float64(Float64(x * fma(Float64(c / x), b, Float64(i * -4.0))) - 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[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+159], t$95$1, If[LessEqual[x, 1.25e+97], N[(N[(t * N[(-4.0 * a), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e+200], N[(N[(x * N[(N[(c / x), $MachinePrecision] * b + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $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 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+97}:\\
\;\;\;\;\mathsf{fma}\left(t, -4 \cdot a, b \cdot c\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+200}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(\frac{c}{x}, b, i \cdot -4\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.59999999999999992e159 or 5.00000000000000019e200 < x Initial program 84.9%
Taylor expanded in x around inf
Applied rewrites42.6%
if -1.59999999999999992e159 < x < 1.25e97Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in x around 0
Applied rewrites76.9%
Taylor expanded in x around 0
Applied rewrites61.0%
if 1.25e97 < x < 5.00000000000000019e200Initial program 84.9%
Taylor expanded in x around inf
Applied rewrites77.8%
Taylor expanded in t around 0
Applied rewrites56.4%
Applied rewrites54.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
(let* ((t_1 (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))))
(if (<= x -1.6e+159)
t_1
(if (<= x 1.2e+97)
(- (fma t (* -4.0 a) (* b c)) (* 27.0 (* j k)))
(if (<= x 5e+200)
(- (* x (- (/ (* b c) x) (* 4.0 i))) (* (* 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 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -1.6e+159) {
tmp = t_1;
} else if (x <= 1.2e+97) {
tmp = fma(t, (-4.0 * a), (b * c)) - (27.0 * (j * k));
} else if (x <= 5e+200) {
tmp = (x * (((b * c) / x) - (4.0 * i))) - ((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(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -1.6e+159) tmp = t_1; elseif (x <= 1.2e+97) tmp = Float64(fma(t, Float64(-4.0 * a), Float64(b * c)) - Float64(27.0 * Float64(j * k))); elseif (x <= 5e+200) tmp = Float64(Float64(x * Float64(Float64(Float64(b * c) / x) - Float64(4.0 * i))) - 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[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+159], t$95$1, If[LessEqual[x, 1.2e+97], N[(N[(t * N[(-4.0 * a), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e+200], N[(N[(x * N[(N[(N[(b * c), $MachinePrecision] / x), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $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 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+97}:\\
\;\;\;\;\mathsf{fma}\left(t, -4 \cdot a, b \cdot c\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+200}:\\
\;\;\;\;x \cdot \left(\frac{b \cdot c}{x} - 4 \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.59999999999999992e159 or 5.00000000000000019e200 < x Initial program 84.9%
Taylor expanded in x around inf
Applied rewrites42.6%
if -1.59999999999999992e159 < x < 1.2e97Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in x around 0
Applied rewrites76.9%
Taylor expanded in x around 0
Applied rewrites61.0%
if 1.2e97 < x < 5.00000000000000019e200Initial program 84.9%
Taylor expanded in x around inf
Applied rewrites77.8%
Taylor expanded in t around 0
Applied rewrites56.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 (<= i -4.5e+29)
(- (* x (- (/ (* b c) x) (* 4.0 i))) (* (* j 27.0) k))
(if (<= i 1.55e+47)
(- (fma 18.0 (* t (* x (* y z))) (* b c)) (* 27.0 (* j k)))
(- (* b c) (fma j (* 27.0 k) (* (* i 4.0) x))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (i <= -4.5e+29) {
tmp = (x * (((b * c) / x) - (4.0 * i))) - ((j * 27.0) * k);
} else if (i <= 1.55e+47) {
tmp = fma(18.0, (t * (x * (y * z))), (b * c)) - (27.0 * (j * k));
} else {
tmp = (b * c) - fma(j, (27.0 * k), ((i * 4.0) * x));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (i <= -4.5e+29) tmp = Float64(Float64(x * Float64(Float64(Float64(b * c) / x) - Float64(4.0 * i))) - Float64(Float64(j * 27.0) * k)); elseif (i <= 1.55e+47) tmp = Float64(fma(18.0, Float64(t * Float64(x * Float64(y * z))), Float64(b * c)) - Float64(27.0 * Float64(j * k))); else tmp = Float64(Float64(b * c) - fma(j, Float64(27.0 * k), Float64(Float64(i * 4.0) * x))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[i, -4.5e+29], N[(N[(x * N[(N[(N[(b * c), $MachinePrecision] / x), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.55e+47], N[(N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(j * N[(27.0 * k), $MachinePrecision] + N[(N[(i * 4.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq -4.5 \cdot 10^{+29}:\\
\;\;\;\;x \cdot \left(\frac{b \cdot c}{x} - 4 \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;i \leq 1.55 \cdot 10^{+47}:\\
\;\;\;\;\mathsf{fma}\left(18, t \cdot \left(x \cdot \left(y \cdot z\right)\right), b \cdot c\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - \mathsf{fma}\left(j, 27 \cdot k, \left(i \cdot 4\right) \cdot x\right)\\
\end{array}
\end{array}
if i < -4.5000000000000002e29Initial program 84.9%
Taylor expanded in x around inf
Applied rewrites77.8%
Taylor expanded in t around 0
Applied rewrites56.4%
if -4.5000000000000002e29 < i < 1.55e47Initial program 84.9%
Taylor expanded in a around 0
Applied rewrites72.7%
Taylor expanded in i around 0
Applied rewrites61.2%
if 1.55e47 < i Initial program 84.9%
Taylor expanded in t around 0
Applied rewrites60.9%
Applied rewrites61.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))))
(if (<= x -1.6e+159)
t_1
(if (<= x 4.4e+95) (- (fma t (* -4.0 a) (* b c)) (* 27.0 (* j k))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -1.6e+159) {
tmp = t_1;
} else if (x <= 4.4e+95) {
tmp = fma(t, (-4.0 * a), (b * c)) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -1.6e+159) tmp = t_1; elseif (x <= 4.4e+95) tmp = Float64(fma(t, Float64(-4.0 * a), Float64(b * c)) - Float64(27.0 * Float64(j * k))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+159], t$95$1, If[LessEqual[x, 4.4e+95], N[(N[(t * N[(-4.0 * a), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+95}:\\
\;\;\;\;\mathsf{fma}\left(t, -4 \cdot a, b \cdot c\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.59999999999999992e159 or 4.3999999999999998e95 < x Initial program 84.9%
Taylor expanded in x around inf
Applied rewrites42.6%
if -1.59999999999999992e159 < x < 4.3999999999999998e95Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in x around 0
Applied rewrites76.9%
Taylor expanded in x around 0
Applied rewrites61.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 (* t (* y z))) (* 4.0 i)))))
(if (<= x -1.6e+159)
t_1
(if (<= x 4.4e+95) (- (* b c) (fma 4.0 (* a t) (* 27.0 (* j k)))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -1.6e+159) {
tmp = t_1;
} else if (x <= 4.4e+95) {
tmp = (b * c) - fma(4.0, (a * t), (27.0 * (j * k)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -1.6e+159) tmp = t_1; elseif (x <= 4.4e+95) tmp = Float64(Float64(b * c) - fma(4.0, Float64(a * t), Float64(27.0 * Float64(j * k)))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+159], t$95$1, If[LessEqual[x, 4.4e+95], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+95}:\\
\;\;\;\;b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.59999999999999992e159 or 4.3999999999999998e95 < x Initial program 84.9%
Taylor expanded in x around inf
Applied rewrites42.6%
if -1.59999999999999992e159 < x < 4.3999999999999998e95Initial program 84.9%
Taylor expanded in x around 0
Applied rewrites60.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 (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))))
(if (<= x -0.00049)
t_1
(if (<= x 2e+95) (- (* b c) (* 27.0 (* j k))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -0.00049) {
tmp = t_1;
} else if (x <= 2e+95) {
tmp = (b * c) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
if (x <= (-0.00049d0)) then
tmp = t_1
else if (x <= 2d+95) then
tmp = (b * c) - (27.0d0 * (j * k))
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -0.00049) {
tmp = t_1;
} else if (x <= 2e+95) {
tmp = (b * c) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i)) tmp = 0 if x <= -0.00049: tmp = t_1 elif x <= 2e+95: tmp = (b * c) - (27.0 * (j * k)) else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -0.00049) tmp = t_1; elseif (x <= 2e+95) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
tmp = 0.0;
if (x <= -0.00049)
tmp = t_1;
elseif (x <= 2e+95)
tmp = (b * c) - (27.0 * (j * k));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.00049], t$95$1, If[LessEqual[x, 2e+95], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -0.00049:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+95}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.8999999999999998e-4 or 2.00000000000000004e95 < x Initial program 84.9%
Taylor expanded in x around inf
Applied rewrites42.6%
if -4.8999999999999998e-4 < x < 2.00000000000000004e95Initial program 84.9%
Taylor expanded in t around 0
Applied rewrites60.9%
Taylor expanded in x around 0
Applied rewrites44.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (fma (* (* x 18.0) z) y (* a -4.0)))))
(if (<= t -1.28e-26)
t_1
(if (<= t 5.8e+141) (- (* b c) (* 27.0 (* j k))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * fma(((x * 18.0) * z), y, (a * -4.0));
double tmp;
if (t <= -1.28e-26) {
tmp = t_1;
} else if (t <= 5.8e+141) {
tmp = (b * c) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * fma(Float64(Float64(x * 18.0) * z), y, Float64(a * -4.0))) tmp = 0.0 if (t <= -1.28e-26) tmp = t_1; elseif (t <= 5.8e+141) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * z), $MachinePrecision] * y + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.28e-26], t$95$1, If[LessEqual[t, 5.8e+141], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, a \cdot -4\right)\\
\mathbf{if}\;t \leq -1.28 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+141}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.27999999999999996e-26 or 5.80000000000000013e141 < t Initial program 84.9%
Applied rewrites87.5%
Applied rewrites84.1%
Taylor expanded in t around inf
Applied rewrites42.4%
Applied rewrites43.1%
if -1.27999999999999996e-26 < t < 5.80000000000000013e141Initial program 84.9%
Taylor expanded in t around 0
Applied rewrites60.9%
Taylor expanded in x around 0
Applied rewrites44.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 27.0 (* j k)))))
(if (<= (* b c) -2.4e-81)
t_1
(if (<= (* b c) 1.8e+133) (- (* x (* -4.0 i)) (* (* 27.0 k) j)) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (j * k));
double tmp;
if ((b * c) <= -2.4e-81) {
tmp = t_1;
} else if ((b * c) <= 1.8e+133) {
tmp = (x * (-4.0 * i)) - ((27.0 * k) * j);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (b * c) - (27.0d0 * (j * k))
if ((b * c) <= (-2.4d-81)) then
tmp = t_1
else if ((b * c) <= 1.8d+133) then
tmp = (x * ((-4.0d0) * i)) - ((27.0d0 * k) * j)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (j * k));
double tmp;
if ((b * c) <= -2.4e-81) {
tmp = t_1;
} else if ((b * c) <= 1.8e+133) {
tmp = (x * (-4.0 * i)) - ((27.0 * k) * j);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (27.0 * (j * k)) tmp = 0 if (b * c) <= -2.4e-81: tmp = t_1 elif (b * c) <= 1.8e+133: tmp = (x * (-4.0 * i)) - ((27.0 * k) * j) else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (Float64(b * c) <= -2.4e-81) tmp = t_1; elseif (Float64(b * c) <= 1.8e+133) tmp = Float64(Float64(x * Float64(-4.0 * i)) - Float64(Float64(27.0 * k) * j)); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (27.0 * (j * k));
tmp = 0.0;
if ((b * c) <= -2.4e-81)
tmp = t_1;
elseif ((b * c) <= 1.8e+133)
tmp = (x * (-4.0 * i)) - ((27.0 * k) * j);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2.4e-81], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 1.8e+133], N[(N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] - N[(N[(27.0 * k), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;b \cdot c \leq -2.4 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq 1.8 \cdot 10^{+133}:\\
\;\;\;\;x \cdot \left(-4 \cdot i\right) - \left(27 \cdot k\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 b c) < -2.3999999999999999e-81 or 1.79999999999999989e133 < (*.f64 b c) Initial program 84.9%
Taylor expanded in t around 0
Applied rewrites60.9%
Taylor expanded in x around 0
Applied rewrites44.2%
if -2.3999999999999999e-81 < (*.f64 b c) < 1.79999999999999989e133Initial program 84.9%
Taylor expanded in x around inf
Applied rewrites77.8%
Taylor expanded in i around inf
Applied rewrites41.4%
Applied rewrites41.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 (* -4.0 (* a t))))
(if (<= a -5.3e+133)
t_1
(if (<= a 1.02e+126) (- (* b c) (* 27.0 (* j k))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (a * t);
double tmp;
if (a <= -5.3e+133) {
tmp = t_1;
} else if (a <= 1.02e+126) {
tmp = (b * c) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (a * t)
if (a <= (-5.3d+133)) then
tmp = t_1
else if (a <= 1.02d+126) then
tmp = (b * c) - (27.0d0 * (j * k))
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (a * t);
double tmp;
if (a <= -5.3e+133) {
tmp = t_1;
} else if (a <= 1.02e+126) {
tmp = (b * c) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (a * t) tmp = 0 if a <= -5.3e+133: tmp = t_1 elif a <= 1.02e+126: tmp = (b * c) - (27.0 * (j * k)) else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(a * t)) tmp = 0.0 if (a <= -5.3e+133) tmp = t_1; elseif (a <= 1.02e+126) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * (a * t);
tmp = 0.0;
if (a <= -5.3e+133)
tmp = t_1;
elseif (a <= 1.02e+126)
tmp = (b * c) - (27.0 * (j * k));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.3e+133], t$95$1, If[LessEqual[a, 1.02e+126], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot t\right)\\
\mathbf{if}\;a \leq -5.3 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.02 \cdot 10^{+126}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.29999999999999997e133 or 1.02e126 < a Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in a around inf
Applied rewrites20.9%
if -5.29999999999999997e133 < a < 1.02e126Initial program 84.9%
Taylor expanded in t around 0
Applied rewrites60.9%
Taylor expanded in x around 0
Applied rewrites44.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -1.0 (* -1.0 (* b c)))))
(if (<= (* b c) -3.1e-19)
t_1
(if (<= (* b c) -2.65e-306)
(* -27.0 (* j k))
(if (<= (* b c) 1.8e+133) (* -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 = -1.0 * (-1.0 * (b * c));
double tmp;
if ((b * c) <= -3.1e-19) {
tmp = t_1;
} else if ((b * c) <= -2.65e-306) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 1.8e+133) {
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 = (-1.0d0) * ((-1.0d0) * (b * c))
if ((b * c) <= (-3.1d-19)) then
tmp = t_1
else if ((b * c) <= (-2.65d-306)) then
tmp = (-27.0d0) * (j * k)
else if ((b * c) <= 1.8d+133) 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 = -1.0 * (-1.0 * (b * c));
double tmp;
if ((b * c) <= -3.1e-19) {
tmp = t_1;
} else if ((b * c) <= -2.65e-306) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 1.8e+133) {
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 = -1.0 * (-1.0 * (b * c)) tmp = 0 if (b * c) <= -3.1e-19: tmp = t_1 elif (b * c) <= -2.65e-306: tmp = -27.0 * (j * k) elif (b * c) <= 1.8e+133: 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(-1.0 * Float64(-1.0 * Float64(b * c))) tmp = 0.0 if (Float64(b * c) <= -3.1e-19) tmp = t_1; elseif (Float64(b * c) <= -2.65e-306) tmp = Float64(-27.0 * Float64(j * k)); elseif (Float64(b * c) <= 1.8e+133) tmp = Float64(-4.0 * Float64(i * x)); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -1.0 * (-1.0 * (b * c));
tmp = 0.0;
if ((b * c) <= -3.1e-19)
tmp = t_1;
elseif ((b * c) <= -2.65e-306)
tmp = -27.0 * (j * k);
elseif ((b * c) <= 1.8e+133)
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[(-1.0 * N[(-1.0 * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -3.1e-19], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -2.65e-306], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.8e+133], N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -1 \cdot \left(-1 \cdot \left(b \cdot c\right)\right)\\
\mathbf{if}\;b \cdot c \leq -3.1 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq -2.65 \cdot 10^{-306}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 1.8 \cdot 10^{+133}:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 b c) < -3.0999999999999999e-19 or 1.79999999999999989e133 < (*.f64 b c) Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in k around -inf
Applied rewrites78.5%
Taylor expanded in b around inf
Applied rewrites24.4%
if -3.0999999999999999e-19 < (*.f64 b c) < -2.6499999999999999e-306Initial program 84.9%
Taylor expanded in j around inf
Applied rewrites23.4%
if -2.6499999999999999e-306 < (*.f64 b c) < 1.79999999999999989e133Initial program 84.9%
Taylor expanded in i around inf
Applied rewrites21.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+175)
(* (* -27.0 j) k)
(if (<= t_1 2e+47) (* -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+175) {
tmp = (-27.0 * j) * k;
} else if (t_1 <= 2e+47) {
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+175)) then
tmp = ((-27.0d0) * j) * k
else if (t_1 <= 2d+47) 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+175) {
tmp = (-27.0 * j) * k;
} else if (t_1 <= 2e+47) {
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+175: tmp = (-27.0 * j) * k elif t_1 <= 2e+47: 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+175) tmp = Float64(Float64(-27.0 * j) * k); elseif (t_1 <= 2e+47) tmp = Float64(-4.0 * Float64(a * t)); else tmp = Float64(-27.0 * Float64(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+175)
tmp = (-27.0 * j) * k;
elseif (t_1 <= 2e+47)
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+175], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision], If[LessEqual[t$95$1, 2e+47], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+175}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+47}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.9999999999999999e175Initial program 84.9%
Taylor expanded in j around inf
Applied rewrites23.4%
Applied rewrites23.4%
if -1.9999999999999999e175 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.0000000000000001e47Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in a around inf
Applied rewrites20.9%
if 2.0000000000000001e47 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 84.9%
Taylor expanded in j around inf
Applied rewrites23.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 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k))) (if (<= t_2 -2e+175) t_1 (if (<= t_2 2e+47) (* -4.0 (* a t)) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+175) {
tmp = t_1;
} else if (t_2 <= 2e+47) {
tmp = -4.0 * (a * t);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-2d+175)) then
tmp = t_1
else if (t_2 <= 2d+47) then
tmp = (-4.0d0) * (a * t)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+175) {
tmp = t_1;
} else if (t_2 <= 2e+47) {
tmp = -4.0 * (a * t);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -2e+175: tmp = t_1 elif t_2 <= 2e+47: tmp = -4.0 * (a * t) else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e+175) tmp = t_1; elseif (t_2 <= 2e+47) tmp = Float64(-4.0 * Float64(a * t)); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (j * k);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -2e+175)
tmp = t_1;
elseif (t_2 <= 2e+47)
tmp = -4.0 * (a * t);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+175], t$95$1, If[LessEqual[t$95$2, 2e+47], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+175}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+47}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.9999999999999999e175 or 2.0000000000000001e47 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 84.9%
Taylor expanded in j around inf
Applied rewrites23.4%
if -1.9999999999999999e175 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.0000000000000001e47Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in a around inf
Applied rewrites20.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 (* -4.0 (* a t)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return -4.0 * (a * t);
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (-4.0d0) * (a * t)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return -4.0 * (a * t);
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): return -4.0 * (a * t)
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(-4.0 * Float64(a * t)) end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = -4.0 * (a * t);
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
-4 \cdot \left(a \cdot t\right)
\end{array}
Initial program 84.9%
Applied rewrites87.5%
Taylor expanded in a around inf
Applied rewrites20.9%
herbie shell --seed 2025161
(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)))