
(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}
Sampling outcomes in binary64 precision:
Herbie found 19 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))
(* (* j 27.0) k))))
(if (<= t_1 INFINITY) t_1 (* (fma (* (* t 18.0) z) y (* i -4.0)) x))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(((t * 18.0) * z), y, (i * -4.0)) * x;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = 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)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(fma(Float64(Float64(t * 18.0) * z), y, Float64(i * -4.0)) * x); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(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]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(N[(N[(t * 18.0), $MachinePrecision] * z), $MachinePrecision] * y + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \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\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot 18\right) \cdot z, y, i \cdot -4\right) \cdot x\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0Initial program 94.6%
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-*.f6465.0
Applied rewrites65.0%
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
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6465.0
Applied rewrites65.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 (* (* j 27.0) k)) (t_2 (fma a t (* i x))))
(if (<= t_1 -1e-133)
(- (- (fma (* x 18.0) (* y (* t z)) (* b c)) (* (* x 4.0) i)) t_1)
(if (<= t_1 1e+37)
(fma (* 18.0 t) (* (* z y) x) (- (* c b) (* 4.0 t_2)))
(if (<= t_1 4e+296)
(- (* c b) (fma 4.0 t_2 (* (* k j) 27.0)))
(* -27.0 (* k j)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = fma(a, t, (i * x));
double tmp;
if (t_1 <= -1e-133) {
tmp = (fma((x * 18.0), (y * (t * z)), (b * c)) - ((x * 4.0) * i)) - t_1;
} else if (t_1 <= 1e+37) {
tmp = fma((18.0 * t), ((z * y) * x), ((c * b) - (4.0 * t_2)));
} else if (t_1 <= 4e+296) {
tmp = (c * b) - fma(4.0, t_2, ((k * j) * 27.0));
} else {
tmp = -27.0 * (k * j);
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = fma(a, t, Float64(i * x)) tmp = 0.0 if (t_1 <= -1e-133) tmp = Float64(Float64(fma(Float64(x * 18.0), Float64(y * Float64(t * z)), Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - t_1); elseif (t_1 <= 1e+37) tmp = fma(Float64(18.0 * t), Float64(Float64(z * y) * x), Float64(Float64(c * b) - Float64(4.0 * t_2))); elseif (t_1 <= 4e+296) tmp = Float64(Float64(c * b) - fma(4.0, t_2, Float64(Float64(k * j) * 27.0))); else tmp = Float64(-27.0 * Float64(k * j)); 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]}, Block[{t$95$2 = N[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-133], N[(N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 1e+37], N[(N[(18.0 * t), $MachinePrecision] * N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+296], N[(N[(c * b), $MachinePrecision] - N[(4.0 * t$95$2 + N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-27.0 * N[(k * j), $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\\
t_2 := \mathsf{fma}\left(a, t, i \cdot x\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-133}:\\
\;\;\;\;\left(\mathsf{fma}\left(x \cdot 18, y \cdot \left(t \cdot z\right), b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot t\_2\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+296}:\\
\;\;\;\;c \cdot b - \mathsf{fma}\left(4, t\_2, \left(k \cdot j\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.0000000000000001e-133Initial program 86.2%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*l*N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-neg.f64N/A
lower-*.f6488.1
Applied rewrites88.1%
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites90.2%
Taylor expanded in t around 0
lower-*.f6486.4
Applied rewrites86.4%
if -1.0000000000000001e-133 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.99999999999999954e36Initial program 91.9%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6492.9
Applied rewrites92.9%
if 9.99999999999999954e36 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 3.99999999999999993e296Initial program 87.3%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6492.5
Applied rewrites92.5%
if 3.99999999999999993e296 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 68.2%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6486.4
Applied rewrites86.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 a t (* i x)))
(t_2 (- (* c b) (fma 4.0 t_1 (* (* k j) 27.0))))
(t_3 (* (* j 27.0) k)))
(if (<= t_3 -2e-69)
t_2
(if (<= t_3 1e+37)
(fma (* 18.0 t) (* (* z y) x) (- (* c b) (* 4.0 t_1)))
(if (<= t_3 4e+296) t_2 (* -27.0 (* k j)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = fma(a, t, (i * x));
double t_2 = (c * b) - fma(4.0, t_1, ((k * j) * 27.0));
double t_3 = (j * 27.0) * k;
double tmp;
if (t_3 <= -2e-69) {
tmp = t_2;
} else if (t_3 <= 1e+37) {
tmp = fma((18.0 * t), ((z * y) * x), ((c * b) - (4.0 * t_1)));
} else if (t_3 <= 4e+296) {
tmp = t_2;
} else {
tmp = -27.0 * (k * j);
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(a, t, Float64(i * x)) t_2 = Float64(Float64(c * b) - fma(4.0, t_1, Float64(Float64(k * j) * 27.0))) t_3 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_3 <= -2e-69) tmp = t_2; elseif (t_3 <= 1e+37) tmp = fma(Float64(18.0 * t), Float64(Float64(z * y) * x), Float64(Float64(c * b) - Float64(4.0 * t_1))); elseif (t_3 <= 4e+296) tmp = t_2; else tmp = Float64(-27.0 * Float64(k * j)); 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[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * b), $MachinePrecision] - N[(4.0 * t$95$1 + N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-69], t$95$2, If[LessEqual[t$95$3, 1e+37], N[(N[(18.0 * t), $MachinePrecision] * N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 4e+296], t$95$2, N[(-27.0 * N[(k * j), $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 := \mathsf{fma}\left(a, t, i \cdot x\right)\\
t_2 := c \cdot b - \mathsf{fma}\left(4, t\_1, \left(k \cdot j\right) \cdot 27\right)\\
t_3 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{-69}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot t\_1\right)\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+296}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.9999999999999999e-69 or 9.99999999999999954e36 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 3.99999999999999993e296Initial program 87.2%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6488.2
Applied rewrites88.2%
if -1.9999999999999999e-69 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.99999999999999954e36Initial program 90.6%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6491.6
Applied rewrites91.6%
if 3.99999999999999993e296 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 68.2%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6486.4
Applied rewrites86.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 (- (* c b) (fma 4.0 (fma a t (* i x)) (* (* k j) 27.0))))
(t_2 (* (* j 27.0) k)))
(if (<= t_2 -2e-69)
t_1
(if (<= t_2 1e+37)
(fma (* 18.0 t) (* (* z y) x) (fma c b (* -4.0 (fma i x (* a t)))))
(if (<= t_2 4e+296) t_1 (* -27.0 (* k j)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (c * b) - fma(4.0, fma(a, t, (i * x)), ((k * j) * 27.0));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e-69) {
tmp = t_1;
} else if (t_2 <= 1e+37) {
tmp = fma((18.0 * t), ((z * y) * x), fma(c, b, (-4.0 * fma(i, x, (a * t)))));
} else if (t_2 <= 4e+296) {
tmp = t_1;
} else {
tmp = -27.0 * (k * j);
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(c * b) - fma(4.0, fma(a, t, Float64(i * x)), Float64(Float64(k * j) * 27.0))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e-69) tmp = t_1; elseif (t_2 <= 1e+37) tmp = fma(Float64(18.0 * t), Float64(Float64(z * y) * x), fma(c, b, Float64(-4.0 * fma(i, x, Float64(a * t))))); elseif (t_2 <= 4e+296) tmp = t_1; else tmp = Float64(-27.0 * Float64(k * j)); 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[(c * b), $MachinePrecision] - N[(4.0 * N[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision] + N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-69], t$95$1, If[LessEqual[t$95$2, 1e+37], N[(N[(18.0 * t), $MachinePrecision] * N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(c * b + N[(-4.0 * N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+296], t$95$1, N[(-27.0 * N[(k * j), $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 := c \cdot b - \mathsf{fma}\left(4, \mathsf{fma}\left(a, t, i \cdot x\right), \left(k \cdot j\right) \cdot 27\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, \mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+296}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.9999999999999999e-69 or 9.99999999999999954e36 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 3.99999999999999993e296Initial program 87.2%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6488.2
Applied rewrites88.2%
if -1.9999999999999999e-69 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.99999999999999954e36Initial program 90.6%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*l*N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-neg.f64N/A
lower-*.f6486.7
Applied rewrites86.7%
Taylor expanded in j around 0
Applied rewrites90.8%
if 3.99999999999999993e296 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 68.2%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6486.4
Applied rewrites86.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 (<= t 3.25e+209)
(-
(-
(fma (* x 18.0) (* y (* t z)) (fma (* a t) -4.0 (* c b)))
(* (* x 4.0) i))
(* (* j 27.0) 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 (t <= 3.25e+209) {
tmp = (fma((x * 18.0), (y * (t * z)), fma((a * t), -4.0, (c * b))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
} else {
tmp = 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 (t <= 3.25e+209) tmp = Float64(Float64(fma(Float64(x * 18.0), Float64(y * Float64(t * z)), fma(Float64(a * t), -4.0, Float64(c * b))) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)); else tmp = 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[t, 3.25e+209], N[(N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * t), $MachinePrecision] * -4.0 + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], 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]]
\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 3.25 \cdot 10^{+209}:\\
\;\;\;\;\left(\mathsf{fma}\left(x \cdot 18, y \cdot \left(t \cdot z\right), \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right)\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\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)\\
\end{array}
\end{array}
if t < 3.24999999999999987e209Initial program 87.9%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*l*N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-neg.f64N/A
lower-*.f6487.4
Applied rewrites87.4%
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites90.8%
if 3.24999999999999987e209 < t Initial program 78.8%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6489.8
Applied rewrites89.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -2e+183)
(* -27.0 (* k j))
(if (<= t_1 -5e-145)
(* c b)
(if (<= t_1 2e+77) (* (fma i x (* a t)) -4.0) (* (* -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+183) {
tmp = -27.0 * (k * j);
} else if (t_1 <= -5e-145) {
tmp = c * b;
} else if (t_1 <= 2e+77) {
tmp = fma(i, x, (a * t)) * -4.0;
} 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+183) tmp = Float64(-27.0 * Float64(k * j)); elseif (t_1 <= -5e-145) tmp = Float64(c * b); elseif (t_1 <= 2e+77) tmp = Float64(fma(i, x, Float64(a * t)) * -4.0); else tmp = Float64(Float64(-27.0 * j) * k); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+183], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-145], N[(c * b), $MachinePrecision], If[LessEqual[t$95$1, 2e+77], N[(N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * -4.0), $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^{+183}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-145}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+77}:\\
\;\;\;\;\mathsf{fma}\left(i, x, a \cdot t\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.99999999999999989e183Initial program 83.7%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.0
Applied rewrites72.0%
if -1.99999999999999989e183 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.9999999999999998e-145Initial program 88.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6440.1
Applied rewrites40.1%
if -4.9999999999999998e-145 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999997e77Initial program 92.3%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6477.0
Applied rewrites77.0%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6474.5
Applied rewrites74.5%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f6451.8
Applied rewrites51.8%
if 1.99999999999999997e77 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 76.7%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6464.0
Applied rewrites64.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6464.1
Applied rewrites64.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 (- (* c b) (* j (* k 27.0)))))
(if (<= (* b c) -2e+188)
t_1
(if (<= (* b c) -2e-54)
(* (fma (* (* y x) z) 18.0 (* -4.0 a)) t)
(if (<= (* b c) 4e+101)
(- (fma (fma i x (* a t)) 4.0 (* (* k j) 27.0)))
t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (c * b) - (j * (k * 27.0));
double tmp;
if ((b * c) <= -2e+188) {
tmp = t_1;
} else if ((b * c) <= -2e-54) {
tmp = fma(((y * x) * z), 18.0, (-4.0 * a)) * t;
} else if ((b * c) <= 4e+101) {
tmp = -fma(fma(i, x, (a * t)), 4.0, ((k * j) * 27.0));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))) tmp = 0.0 if (Float64(b * c) <= -2e+188) tmp = t_1; elseif (Float64(b * c) <= -2e-54) tmp = Float64(fma(Float64(Float64(y * x) * z), 18.0, Float64(-4.0 * a)) * t); elseif (Float64(b * c) <= 4e+101) tmp = Float64(-fma(fma(i, x, Float64(a * t)), 4.0, Float64(Float64(k * j) * 27.0))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2e+188], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -2e-54], N[(N[(N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision] * 18.0 + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 4e+101], (-N[(N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * 4.0 + N[(N[(k * j), $MachinePrecision] * 27.0), $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 := c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq -2 \cdot 10^{-54}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot x\right) \cdot z, 18, -4 \cdot a\right) \cdot t\\
\mathbf{elif}\;b \cdot c \leq 4 \cdot 10^{+101}:\\
\;\;\;\;-\mathsf{fma}\left(\mathsf{fma}\left(i, x, a \cdot t\right), 4, \left(k \cdot j\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 b c) < -2e188 or 3.9999999999999999e101 < (*.f64 b c) Initial program 86.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6478.7
Applied rewrites78.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6477.4
Applied rewrites77.4%
if -2e188 < (*.f64 b c) < -2.0000000000000001e-54Initial program 76.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6453.9
Applied rewrites53.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6456.1
Applied rewrites56.1%
if -2.0000000000000001e-54 < (*.f64 b c) < 3.9999999999999999e101Initial program 91.2%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6484.0
Applied rewrites84.0%
Taylor expanded in b around 0
mul-1-negN/A
distribute-lft-inN/A
associate-+r+N/A
lower-neg.f64N/A
associate-+r+N/A
distribute-lft-inN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6480.0
Applied rewrites80.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 (* (* j 27.0) k)))
(if (<= t_1 -2e+183)
(* -27.0 (* k j))
(if (<= t_1 -5e-145)
(* c b)
(if (<= t_1 2e+77) (* -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+183) {
tmp = -27.0 * (k * j);
} else if (t_1 <= -5e-145) {
tmp = c * b;
} else if (t_1 <= 2e+77) {
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+183)) then
tmp = (-27.0d0) * (k * j)
else if (t_1 <= (-5d-145)) then
tmp = c * b
else if (t_1 <= 2d+77) 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+183) {
tmp = -27.0 * (k * j);
} else if (t_1 <= -5e-145) {
tmp = c * b;
} else if (t_1 <= 2e+77) {
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+183: tmp = -27.0 * (k * j) elif t_1 <= -5e-145: tmp = c * b elif t_1 <= 2e+77: 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+183) tmp = Float64(-27.0 * Float64(k * j)); elseif (t_1 <= -5e-145) tmp = Float64(c * b); elseif (t_1 <= 2e+77) 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+183)
tmp = -27.0 * (k * j);
elseif (t_1 <= -5e-145)
tmp = c * b;
elseif (t_1 <= 2e+77)
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+183], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-145], N[(c * b), $MachinePrecision], If[LessEqual[t$95$1, 2e+77], 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^{+183}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-145}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+77}:\\
\;\;\;\;-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) < -1.99999999999999989e183Initial program 83.7%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.0
Applied rewrites72.0%
if -1.99999999999999989e183 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.9999999999999998e-145Initial program 88.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6440.1
Applied rewrites40.1%
if -4.9999999999999998e-145 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999997e77Initial program 92.3%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6432.9
Applied rewrites32.9%
if 1.99999999999999997e77 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 76.7%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6464.0
Applied rewrites64.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6464.1
Applied rewrites64.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27.0 (* k j))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -2e+183)
t_1
(if (<= t_2 -5e-145) (* c b) (if (<= t_2 2e+77) (* -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+183) {
tmp = t_1;
} else if (t_2 <= -5e-145) {
tmp = c * b;
} else if (t_2 <= 2e+77) {
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+183)) then
tmp = t_1
else if (t_2 <= (-5d-145)) then
tmp = c * b
else if (t_2 <= 2d+77) 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+183) {
tmp = t_1;
} else if (t_2 <= -5e-145) {
tmp = c * b;
} else if (t_2 <= 2e+77) {
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+183: tmp = t_1 elif t_2 <= -5e-145: tmp = c * b elif t_2 <= 2e+77: 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+183) tmp = t_1; elseif (t_2 <= -5e-145) tmp = Float64(c * b); elseif (t_2 <= 2e+77) 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+183)
tmp = t_1;
elseif (t_2 <= -5e-145)
tmp = c * b;
elseif (t_2 <= 2e+77)
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+183], t$95$1, If[LessEqual[t$95$2, -5e-145], N[(c * b), $MachinePrecision], If[LessEqual[t$95$2, 2e+77], 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^{+183}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-145}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+77}:\\
\;\;\;\;-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.99999999999999989e183 or 1.99999999999999997e77 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 79.8%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.5
Applied rewrites67.5%
if -1.99999999999999989e183 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.9999999999999998e-145Initial program 88.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6440.1
Applied rewrites40.1%
if -4.9999999999999998e-145 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999997e77Initial program 92.3%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6432.9
Applied rewrites32.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 (* (* j 27.0) k)))
(if (<= t_1 -4e-33)
(- (* c b) (* j (* k 27.0)))
(if (<= t_1 1e+229)
(fma c b (* -4.0 (fma i x (* a t))))
(- (* -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 = (j * 27.0) * k;
double tmp;
if (t_1 <= -4e-33) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t_1 <= 1e+229) {
tmp = fma(c, b, (-4.0 * fma(i, x, (a * t))));
} else {
tmp = (-4.0 * (a * t)) - 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 (t_1 <= -4e-33) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); elseif (t_1 <= 1e+229) tmp = fma(c, b, Float64(-4.0 * fma(i, x, Float64(a * t)))); else tmp = Float64(Float64(-4.0 * Float64(a * t)) - 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[t$95$1, -4e-33], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+229], N[(c * b + N[(-4.0 * N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[(a * t), $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}\;t\_1 \leq -4 \cdot 10^{-33}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+229}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right) - t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.0000000000000002e-33Initial program 87.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6474.4
Applied rewrites74.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.9
Applied rewrites72.9%
if -4.0000000000000002e-33 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.9999999999999999e228Initial program 90.5%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6477.3
Applied rewrites77.3%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6470.1
Applied rewrites70.1%
if 9.9999999999999999e228 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 69.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6485.2
Applied rewrites85.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -4e-33)
(- (* c b) (* j (* k 27.0)))
(if (<= t_1 5e+223)
(fma c b (* -4.0 (fma i x (* 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 <= -4e-33) {
tmp = (c * b) - (j * (k * 27.0));
} else if (t_1 <= 5e+223) {
tmp = fma(c, b, (-4.0 * fma(i, x, (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 <= -4e-33) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); elseif (t_1 <= 5e+223) tmp = fma(c, b, Float64(-4.0 * fma(i, x, Float64(a * t)))); else tmp = Float64(Float64(-27.0 * j) * k); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-33], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+223], N[(c * b + N[(-4.0 * N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision]), $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 -4 \cdot 10^{-33}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+223}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.0000000000000002e-33Initial program 87.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6474.4
Applied rewrites74.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.9
Applied rewrites72.9%
if -4.0000000000000002e-33 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.99999999999999985e223Initial program 91.1%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6477.8
Applied rewrites77.8%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6470.6
Applied rewrites70.6%
if 4.99999999999999985e223 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 66.9%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.5
Applied rewrites79.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6479.6
Applied rewrites79.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 (- (* c b) (* j (* k 27.0)))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -4e-33)
t_1
(if (<= t_2 2e+69) (fma c b (* -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 = (c * b) - (j * (k * 27.0));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -4e-33) {
tmp = t_1;
} else if (t_2 <= 2e+69) {
tmp = fma(c, b, (-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(c * b) - Float64(j * Float64(k * 27.0))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -4e-33) tmp = t_1; elseif (t_2 <= 2e+69) tmp = fma(c, b, Float64(-4.0 * Float64(a * t))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-33], t$95$1, If[LessEqual[t$95$2, 2e+69], N[(c * b + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := c \cdot b - j \cdot \left(k \cdot 27\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+69}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -4 \cdot \left(a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.0000000000000002e-33 or 2.0000000000000001e69 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 83.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6473.0
Applied rewrites73.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.1
Applied rewrites72.1%
if -4.0000000000000002e-33 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.0000000000000001e69Initial program 90.7%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6475.5
Applied rewrites75.5%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6471.7
Applied rewrites71.7%
Taylor expanded in x around 0
lift-*.f6454.9
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 (* (* j 27.0) k)))
(if (<= t_1 -2e+183)
(* -27.0 (* k j))
(if (<= t_1 5e+223) (fma c b (* -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+183) {
tmp = -27.0 * (k * j);
} else if (t_1 <= 5e+223) {
tmp = fma(c, b, (-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+183) tmp = Float64(-27.0 * Float64(k * j)); elseif (t_1 <= 5e+223) tmp = fma(c, b, Float64(-4.0 * Float64(a * t))); else tmp = Float64(Float64(-27.0 * j) * k); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+183], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+223], N[(c * b + N[(-4.0 * N[(a * t), $MachinePrecision]), $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^{+183}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+223}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -4 \cdot \left(a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.99999999999999989e183Initial program 83.7%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.0
Applied rewrites72.0%
if -1.99999999999999989e183 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.99999999999999985e223Initial program 91.2%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.9
Applied rewrites78.9%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6468.0
Applied rewrites68.0%
Taylor expanded in x around 0
lift-*.f6453.4
Applied rewrites53.4%
if 4.99999999999999985e223 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 66.9%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.5
Applied rewrites79.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6479.6
Applied rewrites79.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 (<= t -2.9e+150)
(* (fma (* z y) (* x 18.0) (* -4.0 a)) t)
(if (<= t 4.5e+59)
(- (fma (* -4.0 i) x (* c b)) (* (* j 27.0) k))
(if (<= t 1.12e+210)
(- (* c b) (fma (* k j) 27.0 (* (* a t) 4.0)))
(* (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 <= -2.9e+150) {
tmp = fma((z * y), (x * 18.0), (-4.0 * a)) * t;
} else if (t <= 4.5e+59) {
tmp = fma((-4.0 * i), x, (c * b)) - ((j * 27.0) * k);
} else if (t <= 1.12e+210) {
tmp = (c * b) - fma((k * j), 27.0, ((a * t) * 4.0));
} 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 <= -2.9e+150) tmp = Float64(fma(Float64(z * y), Float64(x * 18.0), Float64(-4.0 * a)) * t); elseif (t <= 4.5e+59) tmp = Float64(fma(Float64(-4.0 * i), x, Float64(c * b)) - Float64(Float64(j * 27.0) * k)); elseif (t <= 1.12e+210) tmp = Float64(Float64(c * b) - fma(Float64(k * j), 27.0, Float64(Float64(a * t) * 4.0))); else tmp = Float64(fma(Float64(y * x), Float64(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, -2.9e+150], N[(N[(N[(z * y), $MachinePrecision] * N[(x * 18.0), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, 4.5e+59], N[(N[(N[(-4.0 * i), $MachinePrecision] * x + N[(c * b), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e+210], N[(N[(c * b), $MachinePrecision] - N[(N[(k * j), $MachinePrecision] * 27.0 + N[(N[(a * t), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] * N[(z * 18.0), $MachinePrecision] + 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 -2.9 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y, x \cdot 18, -4 \cdot a\right) \cdot t\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+59}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot i, x, c \cdot b\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{+210}:\\
\;\;\;\;c \cdot b - \mathsf{fma}\left(k \cdot j, 27, \left(a \cdot t\right) \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot x, z \cdot 18, -4 \cdot a\right) \cdot t\\
\end{array}
\end{array}
if t < -2.90000000000000011e150Initial program 82.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.6
Applied rewrites83.6%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6483.6
Applied rewrites83.6%
if -2.90000000000000011e150 < t < 4.49999999999999959e59Initial program 88.0%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*l*N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-neg.f64N/A
lower-*.f6491.5
Applied rewrites91.5%
Taylor expanded in t around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6479.8
Applied rewrites79.8%
if 4.49999999999999959e59 < t < 1.12000000000000005e210Initial program 92.2%
Taylor expanded in x around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6475.8
Applied rewrites75.8%
if 1.12000000000000005e210 < t Initial program 78.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6480.3
Applied rewrites80.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6480.3
Applied rewrites80.3%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f6480.3
Applied rewrites80.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
(if (<= t -4.4e+160)
(* (fma (* z y) (* x 18.0) (* -4.0 a)) t)
(if (<= t 4e+59)
(- (* c b) (fma (* i x) 4.0 (* (* k j) 27.0)))
(if (<= t 1.12e+210)
(- (* c b) (fma (* k j) 27.0 (* (* a t) 4.0)))
(* (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 <= -4.4e+160) {
tmp = fma((z * y), (x * 18.0), (-4.0 * a)) * t;
} else if (t <= 4e+59) {
tmp = (c * b) - fma((i * x), 4.0, ((k * j) * 27.0));
} else if (t <= 1.12e+210) {
tmp = (c * b) - fma((k * j), 27.0, ((a * t) * 4.0));
} 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 <= -4.4e+160) tmp = Float64(fma(Float64(z * y), Float64(x * 18.0), Float64(-4.0 * a)) * t); elseif (t <= 4e+59) tmp = Float64(Float64(c * b) - fma(Float64(i * x), 4.0, Float64(Float64(k * j) * 27.0))); elseif (t <= 1.12e+210) tmp = Float64(Float64(c * b) - fma(Float64(k * j), 27.0, Float64(Float64(a * t) * 4.0))); else tmp = Float64(fma(Float64(y * x), Float64(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, -4.4e+160], N[(N[(N[(z * y), $MachinePrecision] * N[(x * 18.0), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, 4e+59], N[(N[(c * b), $MachinePrecision] - N[(N[(i * x), $MachinePrecision] * 4.0 + N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e+210], N[(N[(c * b), $MachinePrecision] - N[(N[(k * j), $MachinePrecision] * 27.0 + N[(N[(a * t), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] * N[(z * 18.0), $MachinePrecision] + 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 -4.4 \cdot 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y, x \cdot 18, -4 \cdot a\right) \cdot t\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+59}:\\
\;\;\;\;c \cdot b - \mathsf{fma}\left(i \cdot x, 4, \left(k \cdot j\right) \cdot 27\right)\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{+210}:\\
\;\;\;\;c \cdot b - \mathsf{fma}\left(k \cdot j, 27, \left(a \cdot t\right) \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot x, z \cdot 18, -4 \cdot a\right) \cdot t\\
\end{array}
\end{array}
if t < -4.39999999999999984e160Initial program 81.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6485.5
Applied rewrites85.5%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6485.6
Applied rewrites85.6%
if -4.39999999999999984e160 < t < 3.99999999999999989e59Initial program 88.1%
Taylor expanded in t around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.9
Applied rewrites78.9%
if 3.99999999999999989e59 < t < 1.12000000000000005e210Initial program 92.2%
Taylor expanded in x around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6475.8
Applied rewrites75.8%
if 1.12000000000000005e210 < t Initial program 78.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6480.3
Applied rewrites80.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6480.3
Applied rewrites80.3%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f6480.3
Applied rewrites80.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
(if (<= t -3.4e+161)
(* (fma (* z y) (* x 18.0) (* -4.0 a)) t)
(if (<= t 2.25e+238)
(- (* c b) (fma 4.0 (fma a t (* i x)) (* (* k j) 27.0)))
(* (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 <= -3.4e+161) {
tmp = fma((z * y), (x * 18.0), (-4.0 * a)) * t;
} else if (t <= 2.25e+238) {
tmp = (c * b) - fma(4.0, fma(a, t, (i * x)), ((k * j) * 27.0));
} 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 <= -3.4e+161) tmp = Float64(fma(Float64(z * y), Float64(x * 18.0), Float64(-4.0 * a)) * t); elseif (t <= 2.25e+238) tmp = Float64(Float64(c * b) - fma(4.0, fma(a, t, Float64(i * x)), Float64(Float64(k * j) * 27.0))); else tmp = Float64(fma(Float64(y * x), Float64(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, -3.4e+161], N[(N[(N[(z * y), $MachinePrecision] * N[(x * 18.0), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, 2.25e+238], N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision] + N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] * N[(z * 18.0), $MachinePrecision] + 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 -3.4 \cdot 10^{+161}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y, x \cdot 18, -4 \cdot a\right) \cdot t\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+238}:\\
\;\;\;\;c \cdot b - \mathsf{fma}\left(4, \mathsf{fma}\left(a, t, i \cdot x\right), \left(k \cdot j\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot x, z \cdot 18, -4 \cdot a\right) \cdot t\\
\end{array}
\end{array}
if t < -3.39999999999999993e161Initial program 81.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6485.5
Applied rewrites85.5%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6485.6
Applied rewrites85.6%
if -3.39999999999999993e161 < t < 2.25e238Initial program 88.2%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6485.0
Applied rewrites85.0%
if 2.25e238 < t Initial program 86.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6481.8
Applied rewrites81.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6481.8
Applied rewrites81.8%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f6481.7
Applied rewrites81.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 (<= t -4.4e+160)
(* (fma (* z y) (* x 18.0) (* -4.0 a)) t)
(if (<= t 1.55e+72)
(- (* c b) (fma (* i x) 4.0 (* (* k j) 27.0)))
(* (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 <= -4.4e+160) {
tmp = fma((z * y), (x * 18.0), (-4.0 * a)) * t;
} else if (t <= 1.55e+72) {
tmp = (c * b) - fma((i * x), 4.0, ((k * j) * 27.0));
} 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 <= -4.4e+160) tmp = Float64(fma(Float64(z * y), Float64(x * 18.0), Float64(-4.0 * a)) * t); elseif (t <= 1.55e+72) tmp = Float64(Float64(c * b) - fma(Float64(i * x), 4.0, Float64(Float64(k * j) * 27.0))); else tmp = Float64(fma(Float64(y * x), Float64(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, -4.4e+160], N[(N[(N[(z * y), $MachinePrecision] * N[(x * 18.0), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, 1.55e+72], N[(N[(c * b), $MachinePrecision] - N[(N[(i * x), $MachinePrecision] * 4.0 + N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] * N[(z * 18.0), $MachinePrecision] + 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 -4.4 \cdot 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y, x \cdot 18, -4 \cdot a\right) \cdot t\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+72}:\\
\;\;\;\;c \cdot b - \mathsf{fma}\left(i \cdot x, 4, \left(k \cdot j\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot x, z \cdot 18, -4 \cdot a\right) \cdot t\\
\end{array}
\end{array}
if t < -4.39999999999999984e160Initial program 81.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6485.5
Applied rewrites85.5%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6485.6
Applied rewrites85.6%
if -4.39999999999999984e160 < t < 1.54999999999999994e72Initial program 88.3%
Taylor expanded in t around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.1
Applied rewrites79.1%
if 1.54999999999999994e72 < t Initial program 87.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6464.9
Applied rewrites64.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6465.0
Applied rewrites65.0%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f6464.9
Applied rewrites64.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 (<= (* b c) -5e+65) (* c b) (if (<= (* b c) 4e+101) (* -27.0 (* k j)) (* c b))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -5e+65) {
tmp = c * b;
} else if ((b * c) <= 4e+101) {
tmp = -27.0 * (k * j);
} else {
tmp = c * b;
}
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) :: tmp
if ((b * c) <= (-5d+65)) then
tmp = c * b
else if ((b * c) <= 4d+101) then
tmp = (-27.0d0) * (k * j)
else
tmp = c * b
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 tmp;
if ((b * c) <= -5e+65) {
tmp = c * b;
} else if ((b * c) <= 4e+101) {
tmp = -27.0 * (k * j);
} else {
tmp = c * b;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -5e+65: tmp = c * b elif (b * c) <= 4e+101: tmp = -27.0 * (k * j) else: tmp = c * b return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -5e+65) tmp = Float64(c * b); elseif (Float64(b * c) <= 4e+101) tmp = Float64(-27.0 * Float64(k * j)); else tmp = Float64(c * b); 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)
tmp = 0.0;
if ((b * c) <= -5e+65)
tmp = c * b;
elseif ((b * c) <= 4e+101)
tmp = -27.0 * (k * j);
else
tmp = c * b;
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_] := If[LessEqual[N[(b * c), $MachinePrecision], -5e+65], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 4e+101], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -5 \cdot 10^{+65}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;b \cdot c \leq 4 \cdot 10^{+101}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if (*.f64 b c) < -4.99999999999999973e65 or 3.9999999999999999e101 < (*.f64 b c) Initial program 85.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6456.7
Applied rewrites56.7%
if -4.99999999999999973e65 < (*.f64 b c) < 3.9999999999999999e101Initial program 88.7%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6434.0
Applied rewrites34.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 (* 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 87.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6425.5
Applied rewrites25.5%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
(t_2
(-
(- (* (* 18.0 t) (* (* x y) z)) t_1)
(- (* (* k j) 27.0) (* c b)))))
(if (< t -1.6210815397541398e-69)
t_2
(if (< t 165.68027943805222)
(+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
t_2))))
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 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
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 = ((a * t) + (i * x)) * 4.0d0
t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
if (t < (-1.6210815397541398d-69)) then
tmp = t_2
else if (t < 165.68027943805222d0) then
tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
else
tmp = t_2
end if
code = tmp
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) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((a * t) + (i * x)) * 4.0 t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)) tmp = 0 if t < -1.6210815397541398e-69: tmp = t_2 elif t < 165.68027943805222: tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0) t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b))) tmp = 0.0 if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = ((a * t) + (i * x)) * 4.0; t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)); tmp = 0.0; if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t\_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
\mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < 165.68027943805222:\\
\;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t\_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2025084
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
:alt
(! :herbie-platform default (if (< t -8105407698770699/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))) (if (< t 8284013971902611/50000000000000) (+ (- (* (* 18 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4)) (- (* c b) (* 27 (* k j)))) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))))))
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))