
(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 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
t_1)
INFINITY)
(-
(fma
(* t (* 18.0 x))
(* z y)
(fma (* -4.0 a) t (fma c b (* (* -4.0 x) i))))
t_1)
(* (fma (* (* t y) z) 18.0 (* -4.0 i)) x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - t_1) <= ((double) INFINITY)) {
tmp = fma((t * (18.0 * x)), (z * y), fma((-4.0 * a), t, fma(c, b, ((-4.0 * x) * i)))) - t_1;
} else {
tmp = fma(((t * y) * z), 18.0, (-4.0 * i)) * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - t_1) <= Inf) tmp = Float64(fma(Float64(t * Float64(18.0 * x)), Float64(z * y), fma(Float64(-4.0 * a), t, fma(c, b, Float64(Float64(-4.0 * x) * i)))) - t_1); else tmp = Float64(fma(Float64(Float64(t * y) * z), 18.0, Float64(-4.0 * i)) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], Infinity], N[(N[(N[(t * N[(18.0 * x), $MachinePrecision]), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(N[(-4.0 * a), $MachinePrecision] * t + N[(c * b + N[(N[(-4.0 * x), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision] * 18.0 + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(t \cdot \left(18 \cdot x\right), z \cdot y, \mathsf{fma}\left(-4 \cdot a, t, \mathsf{fma}\left(c, b, \left(-4 \cdot x\right) \cdot i\right)\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\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.9%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
Applied rewrites95.2%
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 j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6419.0
Applied rewrites19.0%
Taylor expanded in x around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.8
Applied rewrites71.8%
Applied rewrites75.2%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))
INFINITY)
(fma
c
b
(-
(* (fma z (* y (* 18.0 x)) (* -4.0 a)) t)
(fma k (* 27.0 j) (* i (* 4.0 x)))))
(* (fma (* (* t y) z) 18.0 (* -4.0 i)) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= ((double) INFINITY)) {
tmp = fma(c, b, ((fma(z, (y * (18.0 * x)), (-4.0 * a)) * t) - fma(k, (27.0 * j), (i * (4.0 * x)))));
} else {
tmp = fma(((t * y) * z), 18.0, (-4.0 * i)) * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) <= Inf) tmp = fma(c, b, Float64(Float64(fma(z, Float64(y * Float64(18.0 * x)), Float64(-4.0 * a)) * t) - fma(k, Float64(27.0 * j), Float64(i * Float64(4.0 * x))))); else tmp = Float64(fma(Float64(Float64(t * y) * z), 18.0, Float64(-4.0 * i)) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], Infinity], N[(c * b + N[(N[(N[(z * N[(y * N[(18.0 * x), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] - N[(k * N[(27.0 * j), $MachinePrecision] + N[(i * N[(4.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision] * 18.0 + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(z, y \cdot \left(18 \cdot x\right), -4 \cdot a\right) \cdot t - \mathsf{fma}\left(k, 27 \cdot j, i \cdot \left(4 \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\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.9%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites94.9%
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 j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6419.0
Applied rewrites19.0%
Taylor expanded in x around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.8
Applied rewrites71.8%
Applied rewrites75.2%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))
INFINITY)
(fma
(* -27.0 j)
k
(fma (fma z (* y (* 18.0 x)) (* -4.0 a)) t (fma c b (* (* -4.0 x) i))))
(* (fma (* (* t y) z) 18.0 (* -4.0 i)) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= ((double) INFINITY)) {
tmp = fma((-27.0 * j), k, fma(fma(z, (y * (18.0 * x)), (-4.0 * a)), t, fma(c, b, ((-4.0 * x) * i))));
} else {
tmp = fma(((t * y) * z), 18.0, (-4.0 * i)) * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) <= Inf) tmp = fma(Float64(-27.0 * j), k, fma(fma(z, Float64(y * Float64(18.0 * x)), Float64(-4.0 * a)), t, fma(c, b, Float64(Float64(-4.0 * x) * i)))); else tmp = Float64(fma(Float64(Float64(t * y) * z), 18.0, Float64(-4.0 * i)) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(z * N[(y * N[(18.0 * x), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t + N[(c * b + N[(N[(-4.0 * x), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision] * 18.0 + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(z, y \cdot \left(18 \cdot x\right), -4 \cdot a\right), t, \mathsf{fma}\left(c, b, \left(-4 \cdot x\right) \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\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.9%
Applied rewrites94.9%
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 j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6419.0
Applied rewrites19.0%
Taylor expanded in x around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.8
Applied rewrites71.8%
Applied rewrites75.2%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma (* -4.0 t) a (* -27.0 (* k j)))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -2e+173)
(fma c b (* -27.0 (* j k)))
(if (<= t_2 -2e+16)
t_1
(if (<= t_2 -5e-80)
(* (* (* y 18.0) (* x z)) t)
(if (<= t_2 1e+70) (fma (* -4.0 a) t (* b c)) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = fma((-4.0 * t), a, (-27.0 * (k * j)));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+173) {
tmp = fma(c, b, (-27.0 * (j * k)));
} else if (t_2 <= -2e+16) {
tmp = t_1;
} else if (t_2 <= -5e-80) {
tmp = ((y * 18.0) * (x * z)) * t;
} else if (t_2 <= 1e+70) {
tmp = fma((-4.0 * a), t, (b * c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(Float64(-4.0 * t), a, Float64(-27.0 * Float64(k * j))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e+173) tmp = fma(c, b, Float64(-27.0 * Float64(j * k))); elseif (t_2 <= -2e+16) tmp = t_1; elseif (t_2 <= -5e-80) tmp = Float64(Float64(Float64(y * 18.0) * Float64(x * z)) * t); elseif (t_2 <= 1e+70) tmp = fma(Float64(-4.0 * a), t, Float64(b * c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(-4.0 * t), $MachinePrecision] * a + N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+173], N[(c * b + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e+16], t$95$1, If[LessEqual[t$95$2, -5e-80], N[(N[(N[(y * 18.0), $MachinePrecision] * N[(x * z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$2, 1e+70], N[(N[(-4.0 * a), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-4 \cdot t, a, -27 \cdot \left(k \cdot j\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+173}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-80}:\\
\;\;\;\;\left(\left(y \cdot 18\right) \cdot \left(x \cdot z\right)\right) \cdot t\\
\mathbf{elif}\;t\_2 \leq 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, t, b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2e173Initial program 78.7%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6462.7
Applied rewrites62.7%
Taylor expanded in t around 0
Applied rewrites67.2%
Applied rewrites69.6%
if -2e173 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2e16 or 1.00000000000000007e70 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 79.3%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.0
Applied rewrites63.0%
Taylor expanded in t around 0
Applied rewrites48.7%
Applied rewrites48.7%
Taylor expanded in b around 0
Applied rewrites63.0%
if -2e16 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5e-80Initial program 84.1%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f646.2
Applied rewrites6.2%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6478.7
Applied rewrites78.7%
Taylor expanded in x around inf
Applied rewrites58.2%
Applied rewrites61.8%
if -5e-80 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000007e70Initial program 89.1%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6458.5
Applied rewrites58.5%
Taylor expanded in t around 0
Applied rewrites34.0%
Taylor expanded in j around 0
Applied rewrites55.5%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* -4.0 a) t)) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -2e+93)
(* (* k -27.0) j)
(if (<= t_2 -5e-220)
t_1
(if (<= t_2 0.0)
(* (* -4.0 x) i)
(if (<= t_2 500000000.0) t_1 (* (* -27.0 j) k)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (-4.0 * a) * t;
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+93) {
tmp = (k * -27.0) * j;
} else if (t_2 <= -5e-220) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = (-4.0 * x) * i;
} else if (t_2 <= 500000000.0) {
tmp = t_1;
} else {
tmp = (-27.0 * j) * k;
}
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 = ((-4.0d0) * a) * t
t_2 = (j * 27.0d0) * k
if (t_2 <= (-2d+93)) then
tmp = (k * (-27.0d0)) * j
else if (t_2 <= (-5d-220)) then
tmp = t_1
else if (t_2 <= 0.0d0) then
tmp = ((-4.0d0) * x) * i
else if (t_2 <= 500000000.0d0) then
tmp = t_1
else
tmp = ((-27.0d0) * j) * k
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 = (-4.0 * a) * t;
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+93) {
tmp = (k * -27.0) * j;
} else if (t_2 <= -5e-220) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = (-4.0 * x) * i;
} else if (t_2 <= 500000000.0) {
tmp = t_1;
} else {
tmp = (-27.0 * j) * k;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = (-4.0 * a) * t t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -2e+93: tmp = (k * -27.0) * j elif t_2 <= -5e-220: tmp = t_1 elif t_2 <= 0.0: tmp = (-4.0 * x) * i elif t_2 <= 500000000.0: tmp = t_1 else: tmp = (-27.0 * j) * k return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(-4.0 * a) * t) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e+93) tmp = Float64(Float64(k * -27.0) * j); elseif (t_2 <= -5e-220) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(Float64(-4.0 * x) * i); elseif (t_2 <= 500000000.0) tmp = t_1; else tmp = Float64(Float64(-27.0 * j) * k); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = (-4.0 * a) * t; t_2 = (j * 27.0) * k; tmp = 0.0; if (t_2 <= -2e+93) tmp = (k * -27.0) * j; elseif (t_2 <= -5e-220) tmp = t_1; elseif (t_2 <= 0.0) tmp = (-4.0 * x) * i; elseif (t_2 <= 500000000.0) tmp = t_1; else tmp = (-27.0 * j) * k; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(-4.0 * a), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+93], N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[t$95$2, -5e-220], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(-4.0 * x), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$2, 500000000.0], t$95$1, N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-4 \cdot a\right) \cdot t\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+93}:\\
\;\;\;\;\left(k \cdot -27\right) \cdot j\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-220}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\left(-4 \cdot x\right) \cdot i\\
\mathbf{elif}\;t\_2 \leq 500000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.00000000000000009e93Initial program 79.4%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6452.3
Applied rewrites52.3%
Applied rewrites52.3%
if -2.00000000000000009e93 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5.0000000000000002e-220 or 0.0 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5e8Initial program 90.1%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f645.2
Applied rewrites5.2%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6465.6
Applied rewrites65.6%
Taylor expanded in x around 0
Applied rewrites37.6%
if -5.0000000000000002e-220 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 0.0Initial program 83.4%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
if 5e8 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 80.0%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6453.9
Applied rewrites53.9%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* -27.0 j) k)) (t_2 (* (* -4.0 a) t)) (t_3 (* (* j 27.0) k)))
(if (<= t_3 -2e+93)
t_1
(if (<= t_3 -5e-220)
t_2
(if (<= t_3 0.0) (* (* -4.0 x) i) (if (<= t_3 500000000.0) t_2 t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (-27.0 * j) * k;
double t_2 = (-4.0 * a) * t;
double t_3 = (j * 27.0) * k;
double tmp;
if (t_3 <= -2e+93) {
tmp = t_1;
} else if (t_3 <= -5e-220) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = (-4.0 * x) * i;
} else if (t_3 <= 500000000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
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) :: t_3
real(8) :: tmp
t_1 = ((-27.0d0) * j) * k
t_2 = ((-4.0d0) * a) * t
t_3 = (j * 27.0d0) * k
if (t_3 <= (-2d+93)) then
tmp = t_1
else if (t_3 <= (-5d-220)) then
tmp = t_2
else if (t_3 <= 0.0d0) then
tmp = ((-4.0d0) * x) * i
else if (t_3 <= 500000000.0d0) then
tmp = t_2
else
tmp = t_1
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 = (-27.0 * j) * k;
double t_2 = (-4.0 * a) * t;
double t_3 = (j * 27.0) * k;
double tmp;
if (t_3 <= -2e+93) {
tmp = t_1;
} else if (t_3 <= -5e-220) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = (-4.0 * x) * i;
} else if (t_3 <= 500000000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = (-27.0 * j) * k t_2 = (-4.0 * a) * t t_3 = (j * 27.0) * k tmp = 0 if t_3 <= -2e+93: tmp = t_1 elif t_3 <= -5e-220: tmp = t_2 elif t_3 <= 0.0: tmp = (-4.0 * x) * i elif t_3 <= 500000000.0: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(-27.0 * j) * k) t_2 = Float64(Float64(-4.0 * a) * t) t_3 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_3 <= -2e+93) tmp = t_1; elseif (t_3 <= -5e-220) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(Float64(-4.0 * x) * i); elseif (t_3 <= 500000000.0) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = (-27.0 * j) * k; t_2 = (-4.0 * a) * t; t_3 = (j * 27.0) * k; tmp = 0.0; if (t_3 <= -2e+93) tmp = t_1; elseif (t_3 <= -5e-220) tmp = t_2; elseif (t_3 <= 0.0) tmp = (-4.0 * x) * i; elseif (t_3 <= 500000000.0) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-4.0 * a), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+93], t$95$1, If[LessEqual[t$95$3, -5e-220], t$95$2, If[LessEqual[t$95$3, 0.0], N[(N[(-4.0 * x), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$3, 500000000.0], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-27 \cdot j\right) \cdot k\\
t_2 := \left(-4 \cdot a\right) \cdot t\\
t_3 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-220}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\left(-4 \cdot x\right) \cdot i\\
\mathbf{elif}\;t\_3 \leq 500000000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.00000000000000009e93 or 5e8 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 79.7%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6453.1
Applied rewrites53.1%
if -2.00000000000000009e93 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5.0000000000000002e-220 or 0.0 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5e8Initial program 90.1%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f645.2
Applied rewrites5.2%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6465.6
Applied rewrites65.6%
Taylor expanded in x around 0
Applied rewrites37.6%
if -5.0000000000000002e-220 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 0.0Initial program 83.4%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -2e+186)
(fma c b (* -27.0 (* j k)))
(if (<= t_1 -1e-161)
(* (fma (* z x) (* 18.0 y) (* a -4.0)) t)
(if (<= t_1 4e+225)
(fma c b (* (fma t a (* i x)) -4.0))
(* (* -27.0 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+186) {
tmp = fma(c, b, (-27.0 * (j * k)));
} else if (t_1 <= -1e-161) {
tmp = fma((z * x), (18.0 * y), (a * -4.0)) * t;
} else if (t_1 <= 4e+225) {
tmp = fma(c, b, (fma(t, a, (i * x)) * -4.0));
} else {
tmp = (-27.0 * j) * k;
}
return tmp;
}
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+186) tmp = fma(c, b, Float64(-27.0 * Float64(j * k))); elseif (t_1 <= -1e-161) tmp = Float64(fma(Float64(z * x), Float64(18.0 * y), Float64(a * -4.0)) * t); elseif (t_1 <= 4e+225) tmp = fma(c, b, Float64(fma(t, a, Float64(i * x)) * -4.0)); else tmp = Float64(Float64(-27.0 * j) * k); end return tmp end
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+186], N[(c * b + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-161], N[(N[(N[(z * x), $MachinePrecision] * N[(18.0 * y), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, 4e+225], N[(c * b + N[(N[(t * a + N[(i * x), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+186}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-161}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot x, 18 \cdot y, a \cdot -4\right) \cdot t\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+225}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(t, a, i \cdot x\right) \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.99999999999999996e186Initial program 75.1%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.1
Applied rewrites67.1%
Taylor expanded in t around 0
Applied rewrites72.5%
Applied rewrites75.3%
if -1.99999999999999996e186 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.00000000000000003e-161Initial program 86.8%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6464.8
Applied rewrites64.8%
Applied rewrites67.6%
if -1.00000000000000003e-161 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 3.99999999999999971e225Initial program 87.7%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites91.6%
Taylor expanded in y around 0
associate--r+N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
distribute-lft-outN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.9
Applied rewrites78.9%
Taylor expanded in j around 0
Applied rewrites74.4%
if 3.99999999999999971e225 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 75.2%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6487.4
Applied rewrites87.4%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -2e+186)
(fma c b (* -27.0 (* j k)))
(if (<= t_1 -5e-80)
(* (fma -4.0 i (* (* (* z y) t) 18.0)) x)
(if (<= t_1 4e+225)
(fma c b (* (fma t a (* i x)) -4.0))
(* (* -27.0 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+186) {
tmp = fma(c, b, (-27.0 * (j * k)));
} else if (t_1 <= -5e-80) {
tmp = fma(-4.0, i, (((z * y) * t) * 18.0)) * x;
} else if (t_1 <= 4e+225) {
tmp = fma(c, b, (fma(t, a, (i * x)) * -4.0));
} else {
tmp = (-27.0 * j) * k;
}
return tmp;
}
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+186) tmp = fma(c, b, Float64(-27.0 * Float64(j * k))); elseif (t_1 <= -5e-80) tmp = Float64(fma(-4.0, i, Float64(Float64(Float64(z * y) * t) * 18.0)) * x); elseif (t_1 <= 4e+225) tmp = fma(c, b, Float64(fma(t, a, Float64(i * x)) * -4.0)); else tmp = Float64(Float64(-27.0 * j) * k); end return tmp end
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+186], N[(c * b + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-80], N[(N[(-4.0 * i + N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 4e+225], N[(c * b + N[(N[(t * a + N[(i * x), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+186}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-80}:\\
\;\;\;\;\mathsf{fma}\left(-4, i, \left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right) \cdot x\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+225}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(t, a, i \cdot x\right) \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.99999999999999996e186Initial program 75.1%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.1
Applied rewrites67.1%
Taylor expanded in t around 0
Applied rewrites72.5%
Applied rewrites75.3%
if -1.99999999999999996e186 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5e-80Initial program 85.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6458.2
Applied rewrites58.2%
if -5e-80 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 3.99999999999999971e225Initial program 88.1%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites92.3%
Taylor expanded in y around 0
associate--r+N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
distribute-lft-outN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.6
Applied rewrites78.6%
Taylor expanded in j around 0
Applied rewrites74.3%
if 3.99999999999999971e225 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 75.2%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6487.4
Applied rewrites87.4%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma c b (* -27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -5e+56)
t_1
(if (<= t_2 -5e-80)
(* (* (* y 18.0) (* x z)) t)
(if (<= t_2 20000.0) (fma (* -4.0 a) t (* b c)) t_1)))))
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(c, b, (-27.0 * (j * k)));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e+56) {
tmp = t_1;
} else if (t_2 <= -5e-80) {
tmp = ((y * 18.0) * (x * z)) * t;
} else if (t_2 <= 20000.0) {
tmp = fma((-4.0 * a), t, (b * c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(c, b, Float64(-27.0 * Float64(j * k))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -5e+56) tmp = t_1; elseif (t_2 <= -5e-80) tmp = Float64(Float64(Float64(y * 18.0) * Float64(x * z)) * t); elseif (t_2 <= 20000.0) tmp = fma(Float64(-4.0 * a), t, Float64(b * c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(c * b + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+56], t$95$1, If[LessEqual[t$95$2, -5e-80], N[(N[(N[(y * 18.0), $MachinePrecision] * N[(x * z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$2, 20000.0], N[(N[(-4.0 * a), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-80}:\\
\;\;\;\;\left(\left(y \cdot 18\right) \cdot \left(x \cdot z\right)\right) \cdot t\\
\mathbf{elif}\;t\_2 \leq 20000:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, t, b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5.00000000000000024e56 or 2e4 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 80.6%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6464.3
Applied rewrites64.3%
Taylor expanded in t around 0
Applied rewrites60.7%
Applied rewrites61.7%
if -5.00000000000000024e56 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5e-80Initial program 82.7%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f647.7
Applied rewrites7.7%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Taylor expanded in x around inf
Applied rewrites52.4%
Applied rewrites55.1%
if -5e-80 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e4Initial program 88.7%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.2
Applied rewrites57.2%
Taylor expanded in t around 0
Applied rewrites29.8%
Taylor expanded in j around 0
Applied rewrites56.3%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma c b (* -27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -2e+186)
t_1
(if (<= t_2 -5e-80)
(* (* (* (* y z) t) 18.0) x)
(if (<= t_2 20000.0) (fma (* -4.0 a) t (* b c)) t_1)))))
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(c, b, (-27.0 * (j * k)));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+186) {
tmp = t_1;
} else if (t_2 <= -5e-80) {
tmp = (((y * z) * t) * 18.0) * x;
} else if (t_2 <= 20000.0) {
tmp = fma((-4.0 * a), t, (b * c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(c, b, Float64(-27.0 * Float64(j * k))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e+186) tmp = t_1; elseif (t_2 <= -5e-80) tmp = Float64(Float64(Float64(Float64(y * z) * t) * 18.0) * x); elseif (t_2 <= 20000.0) tmp = fma(Float64(-4.0 * a), t, Float64(b * c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(c * b + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+186], t$95$1, If[LessEqual[t$95$2, -5e-80], N[(N[(N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$2, 20000.0], N[(N[(-4.0 * a), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+186}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-80}:\\
\;\;\;\;\left(\left(\left(y \cdot z\right) \cdot t\right) \cdot 18\right) \cdot x\\
\mathbf{elif}\;t\_2 \leq 20000:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, t, b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.99999999999999996e186 or 2e4 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 78.2%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.9
Applied rewrites67.9%
Taylor expanded in t around 0
Applied rewrites68.0%
Applied rewrites69.1%
if -1.99999999999999996e186 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5e-80Initial program 85.7%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6413.3
Applied rewrites13.3%
Taylor expanded in x around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6458.2
Applied rewrites58.2%
Taylor expanded in y around inf
Applied rewrites45.4%
if -5e-80 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e4Initial program 88.7%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.2
Applied rewrites57.2%
Taylor expanded in t around 0
Applied rewrites29.8%
Taylor expanded in j around 0
Applied rewrites56.3%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma c b (* -27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -5e+56)
t_1
(if (<= t_2 -5e-80)
(* (* (* (* y z) x) t) 18.0)
(if (<= t_2 20000.0) (fma (* -4.0 a) t (* b c)) t_1)))))
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(c, b, (-27.0 * (j * k)));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e+56) {
tmp = t_1;
} else if (t_2 <= -5e-80) {
tmp = (((y * z) * x) * t) * 18.0;
} else if (t_2 <= 20000.0) {
tmp = fma((-4.0 * a), t, (b * c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(c, b, Float64(-27.0 * Float64(j * k))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -5e+56) tmp = t_1; elseif (t_2 <= -5e-80) tmp = Float64(Float64(Float64(Float64(y * z) * x) * t) * 18.0); elseif (t_2 <= 20000.0) tmp = fma(Float64(-4.0 * a), t, Float64(b * c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(c * b + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+56], t$95$1, If[LessEqual[t$95$2, -5e-80], N[(N[(N[(N[(y * z), $MachinePrecision] * x), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision], If[LessEqual[t$95$2, 20000.0], N[(N[(-4.0 * a), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-80}:\\
\;\;\;\;\left(\left(\left(y \cdot z\right) \cdot x\right) \cdot t\right) \cdot 18\\
\mathbf{elif}\;t\_2 \leq 20000:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, t, b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5.00000000000000024e56 or 2e4 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 80.6%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6464.3
Applied rewrites64.3%
Taylor expanded in t around 0
Applied rewrites60.7%
Applied rewrites61.7%
if -5.00000000000000024e56 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5e-80Initial program 82.7%
Taylor expanded in i around 0
+-commutativeN/A
associate--r+N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
Applied rewrites83.1%
Taylor expanded in x around inf
Applied rewrites52.5%
if -5e-80 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e4Initial program 88.7%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.2
Applied rewrites57.2%
Taylor expanded in t around 0
Applied rewrites29.8%
Taylor expanded in j around 0
Applied rewrites56.3%
(FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= z -1.08e-110) (not (<= z 3.1e+197))) (fma (* -27.0 j) k (fma (fma -4.0 a (* (* (* y x) z) 18.0)) t (* c b))) (fma c b (fma -4.0 (fma t a (* i x)) (* -27.0 (* k j))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((z <= -1.08e-110) || !(z <= 3.1e+197)) {
tmp = fma((-27.0 * j), k, fma(fma(-4.0, a, (((y * x) * z) * 18.0)), t, (c * b)));
} else {
tmp = fma(c, b, fma(-4.0, fma(t, a, (i * x)), (-27.0 * (k * j))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((z <= -1.08e-110) || !(z <= 3.1e+197)) tmp = fma(Float64(-27.0 * j), k, fma(fma(-4.0, a, Float64(Float64(Float64(y * x) * z) * 18.0)), t, Float64(c * b))); else tmp = fma(c, b, fma(-4.0, fma(t, a, Float64(i * x)), Float64(-27.0 * Float64(k * j)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[z, -1.08e-110], N[Not[LessEqual[z, 3.1e+197]], $MachinePrecision]], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(-4.0 * a + N[(N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * t + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * b + N[(-4.0 * N[(t * a + N[(i * x), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{-110} \lor \neg \left(z \leq 3.1 \cdot 10^{+197}\right):\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(-4, a, \left(\left(y \cdot x\right) \cdot z\right) \cdot 18\right), t, c \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(-4, \mathsf{fma}\left(t, a, i \cdot x\right), -27 \cdot \left(k \cdot j\right)\right)\right)\\
\end{array}
\end{array}
if z < -1.07999999999999995e-110 or 3.1e197 < z Initial program 83.1%
Taylor expanded in i around 0
+-commutativeN/A
associate--r+N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
Applied rewrites80.7%
Applied rewrites84.7%
if -1.07999999999999995e-110 < z < 3.1e197Initial program 85.8%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites88.7%
Taylor expanded in y around 0
associate--r+N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
distribute-lft-outN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.6
Applied rewrites82.6%
Final simplification83.6%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= t -6.7e+38)
(fma (* -27.0 j) k (fma (fma -4.0 a (* (* (* z y) x) 18.0)) t (* c b)))
(if (<= t 3e-55)
(fma c b (fma -4.0 (fma t a (* i x)) (* -27.0 (* k j))))
(fma c b (fma (fma (* (* y z) x) 18.0 (* -4.0 a)) t (* (* i x) -4.0))))))
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 <= -6.7e+38) {
tmp = fma((-27.0 * j), k, fma(fma(-4.0, a, (((z * y) * x) * 18.0)), t, (c * b)));
} else if (t <= 3e-55) {
tmp = fma(c, b, fma(-4.0, fma(t, a, (i * x)), (-27.0 * (k * j))));
} else {
tmp = fma(c, b, fma(fma(((y * z) * x), 18.0, (-4.0 * a)), t, ((i * x) * -4.0)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (t <= -6.7e+38) tmp = fma(Float64(-27.0 * j), k, fma(fma(-4.0, a, Float64(Float64(Float64(z * y) * x) * 18.0)), t, Float64(c * b))); elseif (t <= 3e-55) tmp = fma(c, b, fma(-4.0, fma(t, a, Float64(i * x)), Float64(-27.0 * Float64(k * j)))); else tmp = fma(c, b, fma(fma(Float64(Float64(y * z) * x), 18.0, Float64(-4.0 * a)), t, Float64(Float64(i * x) * -4.0))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[t, -6.7e+38], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(-4.0 * a + N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * t + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e-55], N[(c * b + N[(-4.0 * N[(t * a + N[(i * x), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * b + N[(N[(N[(N[(y * z), $MachinePrecision] * x), $MachinePrecision] * 18.0 + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t + N[(N[(i * x), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.7 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(-4, a, \left(\left(z \cdot y\right) \cdot x\right) \cdot 18\right), t, c \cdot b\right)\right)\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(-4, \mathsf{fma}\left(t, a, i \cdot x\right), -27 \cdot \left(k \cdot j\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot z\right) \cdot x, 18, -4 \cdot a\right), t, \left(i \cdot x\right) \cdot -4\right)\right)\\
\end{array}
\end{array}
if t < -6.70000000000000025e38Initial program 84.9%
Taylor expanded in i around 0
+-commutativeN/A
associate--r+N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
Applied rewrites87.5%
if -6.70000000000000025e38 < t < 3.00000000000000016e-55Initial program 84.2%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites85.9%
Taylor expanded in y around 0
associate--r+N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
distribute-lft-outN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6489.5
Applied rewrites89.5%
if 3.00000000000000016e-55 < t Initial program 84.7%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites88.6%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6487.6
Applied rewrites87.6%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -1e+201)
(fma c b (* -27.0 (* j k)))
(if (<= t_1 4e+225)
(fma c b (* (fma t a (* i x)) -4.0))
(* (* -27.0 j) k)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -1e+201) {
tmp = fma(c, b, (-27.0 * (j * k)));
} else if (t_1 <= 4e+225) {
tmp = fma(c, b, (fma(t, a, (i * x)) * -4.0));
} else {
tmp = (-27.0 * j) * k;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -1e+201) tmp = fma(c, b, Float64(-27.0 * Float64(j * k))); elseif (t_1 <= 4e+225) tmp = fma(c, b, Float64(fma(t, a, Float64(i * x)) * -4.0)); else tmp = Float64(Float64(-27.0 * j) * k); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+201], N[(c * b + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+225], N[(c * b + N[(N[(t * a + N[(i * x), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+201}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+225}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(t, a, i \cdot x\right) \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.00000000000000004e201Initial program 71.2%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0
Applied rewrites68.0%
Taylor expanded in t around 0
Applied rewrites74.3%
Applied rewrites77.6%
if -1.00000000000000004e201 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 3.99999999999999971e225Initial program 87.7%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites91.2%
Taylor expanded in y around 0
associate--r+N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
distribute-lft-outN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6474.2
Applied rewrites74.2%
Taylor expanded in j around 0
Applied rewrites67.6%
if 3.99999999999999971e225 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 75.2%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6487.4
Applied rewrites87.4%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (or (<= t_1 -2e+93) (not (<= t_1 20000.0)))
(fma c b (* -27.0 (* j k)))
(fma (* -4.0 a) t (* b c)))))
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+93) || !(t_1 <= 20000.0)) {
tmp = fma(c, b, (-27.0 * (j * k)));
} else {
tmp = fma((-4.0 * a), t, (b * c));
}
return tmp;
}
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+93) || !(t_1 <= 20000.0)) tmp = fma(c, b, Float64(-27.0 * Float64(j * k))); else tmp = fma(Float64(-4.0 * a), t, Float64(b * c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+93], N[Not[LessEqual[t$95$1, 20000.0]], $MachinePrecision]], N[(c * b + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * a), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+93} \lor \neg \left(t\_1 \leq 20000\right):\\
\;\;\;\;\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, t, b \cdot c\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.00000000000000009e93 or 2e4 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 79.9%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.8
Applied rewrites63.8%
Taylor expanded in t around 0
Applied rewrites62.0%
Applied rewrites63.0%
if -2.00000000000000009e93 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e4Initial program 87.7%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6454.0
Applied rewrites54.0%
Taylor expanded in t around 0
Applied rewrites26.3%
Taylor expanded in j around 0
Applied rewrites51.8%
Final simplification56.3%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= y -2.1e+243)
(* (fma (* z x) (* 18.0 y) (* a -4.0)) t)
(if (<= y 3700000000.0)
(fma c b (fma -4.0 (fma t a (* i x)) (* -27.0 (* k j))))
(* (fma (* (* t y) z) 18.0 (* -4.0 i)) x))))
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 (y <= -2.1e+243) {
tmp = fma((z * x), (18.0 * y), (a * -4.0)) * t;
} else if (y <= 3700000000.0) {
tmp = fma(c, b, fma(-4.0, fma(t, a, (i * x)), (-27.0 * (k * j))));
} else {
tmp = fma(((t * y) * z), 18.0, (-4.0 * i)) * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (y <= -2.1e+243) tmp = Float64(fma(Float64(z * x), Float64(18.0 * y), Float64(a * -4.0)) * t); elseif (y <= 3700000000.0) tmp = fma(c, b, fma(-4.0, fma(t, a, Float64(i * x)), Float64(-27.0 * Float64(k * j)))); else tmp = Float64(fma(Float64(Float64(t * y) * z), 18.0, Float64(-4.0 * i)) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[y, -2.1e+243], N[(N[(N[(z * x), $MachinePrecision] * N[(18.0 * y), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 3700000000.0], N[(c * b + N[(-4.0 * N[(t * a + N[(i * x), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision] * 18.0 + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+243}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot x, 18 \cdot y, a \cdot -4\right) \cdot t\\
\mathbf{elif}\;y \leq 3700000000:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(-4, \mathsf{fma}\left(t, a, i \cdot x\right), -27 \cdot \left(k \cdot j\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\right) \cdot x\\
\end{array}
\end{array}
if y < -2.0999999999999999e243Initial program 78.5%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6415.9
Applied rewrites15.9%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6465.3
Applied rewrites65.3%
Applied rewrites71.5%
if -2.0999999999999999e243 < y < 3.7e9Initial program 90.2%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites92.5%
Taylor expanded in y around 0
associate--r+N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
distribute-lft-outN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6486.8
Applied rewrites86.8%
if 3.7e9 < y Initial program 71.8%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6423.3
Applied rewrites23.3%
Taylor expanded in x around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6458.9
Applied rewrites58.9%
Applied rewrites58.8%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (or (<= t_1 -2e+93) (not (<= t_1 500000000.0)))
(* (* -27.0 j) k)
(* (* -4.0 a) t))))
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+93) || !(t_1 <= 500000000.0)) {
tmp = (-27.0 * j) * k;
} else {
tmp = (-4.0 * a) * t;
}
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) :: tmp
t_1 = (j * 27.0d0) * k
if ((t_1 <= (-2d+93)) .or. (.not. (t_1 <= 500000000.0d0))) then
tmp = ((-27.0d0) * j) * k
else
tmp = ((-4.0d0) * a) * t
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 = (j * 27.0) * k;
double tmp;
if ((t_1 <= -2e+93) || !(t_1 <= 500000000.0)) {
tmp = (-27.0 * j) * k;
} else {
tmp = (-4.0 * a) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if (t_1 <= -2e+93) or not (t_1 <= 500000000.0): tmp = (-27.0 * j) * k else: tmp = (-4.0 * a) * t return tmp
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+93) || !(t_1 <= 500000000.0)) tmp = Float64(Float64(-27.0 * j) * k); else tmp = Float64(Float64(-4.0 * a) * t); end return tmp end
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+93) || ~((t_1 <= 500000000.0))) tmp = (-27.0 * j) * k; else tmp = (-4.0 * a) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+93], N[Not[LessEqual[t$95$1, 500000000.0]], $MachinePrecision]], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision], N[(N[(-4.0 * a), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+93} \lor \neg \left(t\_1 \leq 500000000\right):\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\left(-4 \cdot a\right) \cdot t\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.00000000000000009e93 or 5e8 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 79.7%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6453.1
Applied rewrites53.1%
if -2.00000000000000009e93 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5e8Initial program 87.7%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f644.1
Applied rewrites4.1%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6455.5
Applied rewrites55.5%
Taylor expanded in x around 0
Applied rewrites30.4%
Final simplification39.4%
(FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= t -1e+91) (not (<= t 1.2e+49))) (* (fma (* z x) (* 18.0 y) (* a -4.0)) t) (fma (* -4.0 i) x (fma -27.0 (* k j) (* b c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -1e+91) || !(t <= 1.2e+49)) {
tmp = fma((z * x), (18.0 * y), (a * -4.0)) * t;
} else {
tmp = fma((-4.0 * i), x, fma(-27.0, (k * j), (b * c)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -1e+91) || !(t <= 1.2e+49)) tmp = Float64(fma(Float64(z * x), Float64(18.0 * y), Float64(a * -4.0)) * t); else tmp = fma(Float64(-4.0 * i), x, fma(-27.0, Float64(k * j), Float64(b * c))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[t, -1e+91], N[Not[LessEqual[t, 1.2e+49]], $MachinePrecision]], N[(N[(N[(z * x), $MachinePrecision] * N[(18.0 * y), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], N[(N[(-4.0 * i), $MachinePrecision] * x + N[(-27.0 * N[(k * j), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+91} \lor \neg \left(t \leq 1.2 \cdot 10^{+49}\right):\\
\;\;\;\;\mathsf{fma}\left(z \cdot x, 18 \cdot y, a \cdot -4\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot i, x, \mathsf{fma}\left(-27, k \cdot j, b \cdot c\right)\right)\\
\end{array}
\end{array}
if t < -1.00000000000000008e91 or 1.2e49 < t Initial program 84.8%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6411.9
Applied rewrites11.9%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6477.1
Applied rewrites77.1%
Applied rewrites77.3%
if -1.00000000000000008e91 < t < 1.2e49Initial program 84.4%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6431.0
Applied rewrites31.0%
Taylor expanded in t around 0
associate--r+N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6477.8
Applied rewrites77.8%
Final simplification77.6%
(FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= t -1.75e+124) (not (<= t 1.52e+64))) (* (* -4.0 a) t) (fma c b (* -27.0 (* j k)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -1.75e+124) || !(t <= 1.52e+64)) {
tmp = (-4.0 * a) * t;
} else {
tmp = fma(c, b, (-27.0 * (j * k)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -1.75e+124) || !(t <= 1.52e+64)) tmp = Float64(Float64(-4.0 * a) * t); else tmp = fma(c, b, Float64(-27.0 * Float64(j * k))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[t, -1.75e+124], N[Not[LessEqual[t, 1.52e+64]], $MachinePrecision]], N[(N[(-4.0 * a), $MachinePrecision] * t), $MachinePrecision], N[(c * b + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+124} \lor \neg \left(t \leq 1.52 \cdot 10^{+64}\right):\\
\;\;\;\;\left(-4 \cdot a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)\\
\end{array}
\end{array}
if t < -1.7500000000000001e124 or 1.52e64 < t Initial program 82.9%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6412.0
Applied rewrites12.0%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6479.8
Applied rewrites79.8%
Taylor expanded in x around 0
Applied rewrites45.4%
if -1.7500000000000001e124 < t < 1.52e64Initial program 85.4%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6459.1
Applied rewrites59.1%
Taylor expanded in t around 0
Applied rewrites52.6%
Applied rewrites53.2%
Final simplification50.5%
(FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= t -1.75e+124) (not (<= t 1.52e+64))) (* (* -4.0 a) t) (fma -27.0 (* k j) (* b c))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -1.75e+124) || !(t <= 1.52e+64)) {
tmp = (-4.0 * a) * t;
} else {
tmp = fma(-27.0, (k * j), (b * c));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -1.75e+124) || !(t <= 1.52e+64)) tmp = Float64(Float64(-4.0 * a) * t); else tmp = fma(-27.0, Float64(k * j), Float64(b * c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[t, -1.75e+124], N[Not[LessEqual[t, 1.52e+64]], $MachinePrecision]], N[(N[(-4.0 * a), $MachinePrecision] * t), $MachinePrecision], N[(-27.0 * N[(k * j), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+124} \lor \neg \left(t \leq 1.52 \cdot 10^{+64}\right):\\
\;\;\;\;\left(-4 \cdot a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27, k \cdot j, b \cdot c\right)\\
\end{array}
\end{array}
if t < -1.7500000000000001e124 or 1.52e64 < t Initial program 82.9%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6412.0
Applied rewrites12.0%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6479.8
Applied rewrites79.8%
Taylor expanded in x around 0
Applied rewrites45.4%
if -1.7500000000000001e124 < t < 1.52e64Initial program 85.4%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6459.1
Applied rewrites59.1%
Taylor expanded in t around 0
Applied rewrites52.6%
Final simplification50.1%
(FPCore (x y z t a b c i j k) :precision binary64 (* (* -4.0 a) t))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (-4.0 * a) * t;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = ((-4.0d0) * a) * t
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (-4.0 * a) * t;
}
def code(x, y, z, t, a, b, c, i, j, k): return (-4.0 * a) * t
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(-4.0 * a) * t) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (-4.0 * a) * t; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(-4.0 * a), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\left(-4 \cdot a\right) \cdot t
\end{array}
Initial program 84.5%
Taylor expanded in j around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6423.6
Applied rewrites23.6%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6444.7
Applied rewrites44.7%
Taylor expanded in x around 0
Applied rewrites21.8%
(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 2024352
(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)))