
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
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)
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
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
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)
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
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 (- INFINITY))
(*
(- t)
(fma
a
x
(-
(fma
j
c
(/ (fma (fma (- z) c (* i a)) b (* (fma (- i) j (* z x)) y)) t)))))
(if (<= t_1 INFINITY) t_1 (* (fma (- x) t (* i b)) a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = -t * fma(a, x, -fma(j, c, (fma(fma(-z, c, (i * a)), b, (fma(-i, j, (z * x)) * y)) / t)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(-x, t, (i * b)) * a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(-t) * fma(a, x, Float64(-fma(j, c, Float64(fma(fma(Float64(-z), c, Float64(i * a)), b, Float64(fma(Float64(-i), j, Float64(z * x)) * y)) / t))))); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(fma(Float64(-x), t, Float64(i * b)) * a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[((-t) * N[(a * x + (-N[(j * c + N[(N[(N[((-z) * c + N[(i * a), $MachinePrecision]), $MachinePrecision] * b + N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[((-x) * t + N[(i * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(-t\right) \cdot \mathsf{fma}\left(a, x, -\mathsf{fma}\left(j, c, \frac{\mathsf{fma}\left(\mathsf{fma}\left(-z, c, i \cdot a\right), b, \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\right)}{t}\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, t, i \cdot b\right) \cdot a\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < -inf.0Initial program 83.7%
Taylor expanded in t around -inf
Applied rewrites92.7%
if -inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 95.9%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 0.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6452.7
Applied rewrites52.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 INFINITY) t_1 (* (fma (- x) t (* i b)) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(-x, t, (i * b)) * a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(fma(Float64(-x), t, Float64(i * b)) * a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[((-x) * t + N[(i * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, t, i \cdot b\right) \cdot a\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 92.6%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 0.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6452.7
Applied rewrites52.7%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<=
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))
INFINITY)
(fma
(fma (- t) a (* z y))
x
(fma (- b) (fma (- i) a (* c z)) (* (fma (- i) y (* c t)) j)))
(* (fma (- x) t (* i b)) a)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))) <= ((double) INFINITY)) {
tmp = fma(fma(-t, a, (z * y)), x, fma(-b, fma(-i, a, (c * z)), (fma(-i, y, (c * t)) * j)));
} else {
tmp = fma(-x, t, (i * b)) * a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) <= Inf) tmp = fma(fma(Float64(-t), a, Float64(z * y)), x, fma(Float64(-b), fma(Float64(-i), a, Float64(c * z)), Float64(fma(Float64(-i), y, Float64(c * t)) * j))); else tmp = Float64(fma(Float64(-x), t, Float64(i * b)) * a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[((-t) * a + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * N[((-i) * a + N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) * t + N[(i * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-t, a, z \cdot y\right), x, \mathsf{fma}\left(-b, \mathsf{fma}\left(-i, a, c \cdot z\right), \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, t, i \cdot b\right) \cdot a\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 92.6%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites92.6%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 0.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6452.7
Applied rewrites52.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) t (* z y)) x)))
(if (or (<= c -2.7e-15) (not (<= c 4.5e-75)))
(fma (fma (- z) b (* j t)) c t_1)
(fma (fma (- y) j (* b a)) i t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-a, t, (z * y)) * x;
double tmp;
if ((c <= -2.7e-15) || !(c <= 4.5e-75)) {
tmp = fma(fma(-z, b, (j * t)), c, t_1);
} else {
tmp = fma(fma(-y, j, (b * a)), i, t_1);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), t, Float64(z * y)) * x) tmp = 0.0 if ((c <= -2.7e-15) || !(c <= 4.5e-75)) tmp = fma(fma(Float64(-z), b, Float64(j * t)), c, t_1); else tmp = fma(fma(Float64(-y), j, Float64(b * a)), i, t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[Or[LessEqual[c, -2.7e-15], N[Not[LessEqual[c, 4.5e-75]], $MachinePrecision]], N[(N[((-z) * b + N[(j * t), $MachinePrecision]), $MachinePrecision] * c + t$95$1), $MachinePrecision], N[(N[((-y) * j + N[(b * a), $MachinePrecision]), $MachinePrecision] * i + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{if}\;c \leq -2.7 \cdot 10^{-15} \lor \neg \left(c \leq 4.5 \cdot 10^{-75}\right):\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-z, b, j \cdot t\right), c, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-y, j, b \cdot a\right), i, t\_1\right)\\
\end{array}
\end{array}
if c < -2.70000000000000009e-15 or 4.5000000000000003e-75 < c Initial program 66.1%
Taylor expanded in i around 0
Applied rewrites76.3%
if -2.70000000000000009e-15 < c < 4.5000000000000003e-75Initial program 79.7%
Taylor expanded in c around 0
Applied rewrites75.8%
Final simplification76.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -5.2e+247)
(* (fma i a (* (- z) c)) b)
(if (<= b 1.55e+56)
(fma (fma (- y) j (* b a)) i (* (fma (- a) t (* z y)) x))
(fma (fma (- i) y (* c t)) j (* (* i b) a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -5.2e+247) {
tmp = fma(i, a, (-z * c)) * b;
} else if (b <= 1.55e+56) {
tmp = fma(fma(-y, j, (b * a)), i, (fma(-a, t, (z * y)) * x));
} else {
tmp = fma(fma(-i, y, (c * t)), j, ((i * b) * a));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -5.2e+247) tmp = Float64(fma(i, a, Float64(Float64(-z) * c)) * b); elseif (b <= 1.55e+56) tmp = fma(fma(Float64(-y), j, Float64(b * a)), i, Float64(fma(Float64(-a), t, Float64(z * y)) * x)); else tmp = fma(fma(Float64(-i), y, Float64(c * t)), j, Float64(Float64(i * b) * a)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -5.2e+247], N[(N[(i * a + N[((-z) * c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 1.55e+56], N[(N[((-y) * j + N[(b * a), $MachinePrecision]), $MachinePrecision] * i + N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j + N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.2 \cdot 10^{+247}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-z\right) \cdot c\right) \cdot b\\
\mathbf{elif}\;b \leq 1.55 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-y, j, b \cdot a\right), i, \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-i, y, c \cdot t\right), j, \left(i \cdot b\right) \cdot a\right)\\
\end{array}
\end{array}
if b < -5.19999999999999981e247Initial program 66.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6434.5
Applied rewrites34.5%
Taylor expanded in x around 0
Applied rewrites21.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6493.8
Applied rewrites93.8%
if -5.19999999999999981e247 < b < 1.55000000000000002e56Initial program 72.9%
Taylor expanded in c around 0
Applied rewrites70.1%
if 1.55000000000000002e56 < b Initial program 71.7%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.2
Applied rewrites72.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6474.4
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-neg.f64N/A
+-commutativeN/A
lift-fma.f6474.4
Applied rewrites74.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- t) a (* y z)) x)) (t_2 (* (fma (- y) j (* b a)) i)))
(if (<= i -5.4e-5)
t_2
(if (<= i -4.2e-73)
t_1
(if (<= i -1.1e-260)
(* (fma (- z) b (* j t)) c)
(if (<= i 9e-82)
t_1
(if (<= i 1.6e+77) (* (fma (- a) x (* j c)) t) t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-t, a, (y * z)) * x;
double t_2 = fma(-y, j, (b * a)) * i;
double tmp;
if (i <= -5.4e-5) {
tmp = t_2;
} else if (i <= -4.2e-73) {
tmp = t_1;
} else if (i <= -1.1e-260) {
tmp = fma(-z, b, (j * t)) * c;
} else if (i <= 9e-82) {
tmp = t_1;
} else if (i <= 1.6e+77) {
tmp = fma(-a, x, (j * c)) * t;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-t), a, Float64(y * z)) * x) t_2 = Float64(fma(Float64(-y), j, Float64(b * a)) * i) tmp = 0.0 if (i <= -5.4e-5) tmp = t_2; elseif (i <= -4.2e-73) tmp = t_1; elseif (i <= -1.1e-260) tmp = Float64(fma(Float64(-z), b, Float64(j * t)) * c); elseif (i <= 9e-82) tmp = t_1; elseif (i <= 1.6e+77) tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-t) * a + N[(y * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-y) * j + N[(b * a), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -5.4e-5], t$95$2, If[LessEqual[i, -4.2e-73], t$95$1, If[LessEqual[i, -1.1e-260], N[(N[((-z) * b + N[(j * t), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[i, 9e-82], t$95$1, If[LessEqual[i, 1.6e+77], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-t, a, y \cdot z\right) \cdot x\\
t_2 := \mathsf{fma}\left(-y, j, b \cdot a\right) \cdot i\\
\mathbf{if}\;i \leq -5.4 \cdot 10^{-5}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;i \leq -4.2 \cdot 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -1.1 \cdot 10^{-260}:\\
\;\;\;\;\mathsf{fma}\left(-z, b, j \cdot t\right) \cdot c\\
\mathbf{elif}\;i \leq 9 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.6 \cdot 10^{+77}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if i < -5.3999999999999998e-5 or 1.6000000000000001e77 < i Initial program 65.0%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6468.5
Applied rewrites68.5%
if -5.3999999999999998e-5 < i < -4.1999999999999997e-73 or -1.10000000000000008e-260 < i < 8.9999999999999997e-82Initial program 83.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6446.5
Applied rewrites46.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6469.8
Applied rewrites69.8%
if -4.1999999999999997e-73 < i < -1.10000000000000008e-260Initial program 74.1%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-inN/A
mul-1-negN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6460.5
Applied rewrites60.5%
if 8.9999999999999997e-82 < i < 1.6000000000000001e77Initial program 70.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6456.3
Applied rewrites56.3%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= i -7.5e-7) (not (<= i 8.6e-122))) (fma (fma (- i) y (* c t)) j (* (* i b) a)) (fma (fma (- t) a (* z y)) x (* b (* (- z) c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((i <= -7.5e-7) || !(i <= 8.6e-122)) {
tmp = fma(fma(-i, y, (c * t)), j, ((i * b) * a));
} else {
tmp = fma(fma(-t, a, (z * y)), x, (b * (-z * c)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((i <= -7.5e-7) || !(i <= 8.6e-122)) tmp = fma(fma(Float64(-i), y, Float64(c * t)), j, Float64(Float64(i * b) * a)); else tmp = fma(fma(Float64(-t), a, Float64(z * y)), x, Float64(b * Float64(Float64(-z) * c))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[i, -7.5e-7], N[Not[LessEqual[i, 8.6e-122]], $MachinePrecision]], N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j + N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(N[((-t) * a + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[(b * N[((-z) * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -7.5 \cdot 10^{-7} \lor \neg \left(i \leq 8.6 \cdot 10^{-122}\right):\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-i, y, c \cdot t\right), j, \left(i \cdot b\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-t, a, z \cdot y\right), x, b \cdot \left(\left(-z\right) \cdot c\right)\right)\\
\end{array}
\end{array}
if i < -7.5000000000000002e-7 or 8.60000000000000037e-122 < i Initial program 67.8%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.6
Applied rewrites63.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.3
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-neg.f64N/A
+-commutativeN/A
lift-fma.f6466.9
Applied rewrites66.9%
if -7.5000000000000002e-7 < i < 8.60000000000000037e-122Initial program 78.9%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites82.8%
Taylor expanded in z around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6468.1
Applied rewrites68.1%
Final simplification67.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- b) c (* y x)) z)))
(if (<= z -5.2e+30)
t_1
(if (<= z -5.8e-207)
(* (fma (- y) i (* c t)) j)
(if (<= z -3.5e-265)
(* (* a b) i)
(if (<= z 2.35e+86) (* (fma (- a) x (* j c)) t) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-b, c, (y * x)) * z;
double tmp;
if (z <= -5.2e+30) {
tmp = t_1;
} else if (z <= -5.8e-207) {
tmp = fma(-y, i, (c * t)) * j;
} else if (z <= -3.5e-265) {
tmp = (a * b) * i;
} else if (z <= 2.35e+86) {
tmp = fma(-a, x, (j * c)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-b), c, Float64(y * x)) * z) tmp = 0.0 if (z <= -5.2e+30) tmp = t_1; elseif (z <= -5.8e-207) tmp = Float64(fma(Float64(-y), i, Float64(c * t)) * j); elseif (z <= -3.5e-265) tmp = Float64(Float64(a * b) * i); elseif (z <= 2.35e+86) tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-b) * c + N[(y * x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -5.2e+30], t$95$1, If[LessEqual[z, -5.8e-207], N[(N[((-y) * i + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[z, -3.5e-265], N[(N[(a * b), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[z, 2.35e+86], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-207}:\\
\;\;\;\;\mathsf{fma}\left(-y, i, c \cdot t\right) \cdot j\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-265}:\\
\;\;\;\;\left(a \cdot b\right) \cdot i\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.19999999999999977e30 or 2.3500000000000001e86 < z Initial program 60.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6472.4
Applied rewrites72.4%
if -5.19999999999999977e30 < z < -5.80000000000000022e-207Initial program 79.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6456.2
Applied rewrites56.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6458.2
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-neg.f64N/A
+-commutativeN/A
lift-fma.f6458.2
Applied rewrites58.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6447.5
Applied rewrites47.5%
if -5.80000000000000022e-207 < z < -3.50000000000000015e-265Initial program 73.3%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6474.7
Applied rewrites74.7%
Taylor expanded in y around 0
Applied rewrites67.6%
if -3.50000000000000015e-265 < z < 2.3500000000000001e86Initial program 80.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6452.8
Applied rewrites52.8%
Final simplification60.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) x (* j c)) t)) (t_2 (* (fma i a (* (- z) c)) b)))
(if (<= b -6.6e+172)
t_2
(if (<= b -8e-30)
t_1
(if (<= b -1.6e-295)
(* (fma (- y) i (* c t)) j)
(if (<= b 3.4e-58) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-a, x, (j * c)) * t;
double t_2 = fma(i, a, (-z * c)) * b;
double tmp;
if (b <= -6.6e+172) {
tmp = t_2;
} else if (b <= -8e-30) {
tmp = t_1;
} else if (b <= -1.6e-295) {
tmp = fma(-y, i, (c * t)) * j;
} else if (b <= 3.4e-58) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), x, Float64(j * c)) * t) t_2 = Float64(fma(i, a, Float64(Float64(-z) * c)) * b) tmp = 0.0 if (b <= -6.6e+172) tmp = t_2; elseif (b <= -8e-30) tmp = t_1; elseif (b <= -1.6e-295) tmp = Float64(fma(Float64(-y), i, Float64(c * t)) * j); elseif (b <= 3.4e-58) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(i * a + N[((-z) * c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -6.6e+172], t$95$2, If[LessEqual[b, -8e-30], t$95$1, If[LessEqual[b, -1.6e-295], N[(N[((-y) * i + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[b, 3.4e-58], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
t_2 := \mathsf{fma}\left(i, a, \left(-z\right) \cdot c\right) \cdot b\\
\mathbf{if}\;b \leq -6.6 \cdot 10^{+172}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -8 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.6 \cdot 10^{-295}:\\
\;\;\;\;\mathsf{fma}\left(-y, i, c \cdot t\right) \cdot j\\
\mathbf{elif}\;b \leq 3.4 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -6.59999999999999965e172 or 3.39999999999999973e-58 < b Initial program 72.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6437.6
Applied rewrites37.6%
Taylor expanded in x around 0
Applied rewrites21.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6469.9
Applied rewrites69.9%
if -6.59999999999999965e172 < b < -8.000000000000001e-30 or -1.6e-295 < b < 3.39999999999999973e-58Initial program 73.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6450.1
Applied rewrites50.1%
if -8.000000000000001e-30 < b < -1.6e-295Initial program 71.2%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6450.5
Applied rewrites50.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6450.5
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-neg.f64N/A
+-commutativeN/A
lift-fma.f6452.4
Applied rewrites52.4%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6448.4
Applied rewrites48.4%
Final simplification57.8%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= z -2.1e+73) (not (<= z 1.95e+43))) (* (fma (- b) c (* y x)) z) (fma (fma (- i) y (* c t)) j (* (* i b) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((z <= -2.1e+73) || !(z <= 1.95e+43)) {
tmp = fma(-b, c, (y * x)) * z;
} else {
tmp = fma(fma(-i, y, (c * t)), j, ((i * b) * a));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((z <= -2.1e+73) || !(z <= 1.95e+43)) tmp = Float64(fma(Float64(-b), c, Float64(y * x)) * z); else tmp = fma(fma(Float64(-i), y, Float64(c * t)), j, Float64(Float64(i * b) * a)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[z, -2.1e+73], N[Not[LessEqual[z, 1.95e+43]], $MachinePrecision]], N[(N[((-b) * c + N[(y * x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j + N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+73} \lor \neg \left(z \leq 1.95 \cdot 10^{+43}\right):\\
\;\;\;\;\mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-i, y, c \cdot t\right), j, \left(i \cdot b\right) \cdot a\right)\\
\end{array}
\end{array}
if z < -2.1000000000000001e73 or 1.95e43 < z Initial program 60.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6473.5
Applied rewrites73.5%
if -2.1000000000000001e73 < z < 1.95e43Initial program 79.4%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6458.5
Applied rewrites58.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6460.4
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-neg.f64N/A
+-commutativeN/A
lift-fma.f6461.0
Applied rewrites61.0%
Final simplification65.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* z y) x)))
(if (<= b -5.6e+172)
(* (* a b) i)
(if (<= b -6.5e-101)
(* (* (- x) a) t)
(if (<= b -3.1e-299)
t_1
(if (<= b 3.8e-152)
(* (- a) (* x t))
(if (<= b 4.9e-60) t_1 (* (* i b) a))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * y) * x;
double tmp;
if (b <= -5.6e+172) {
tmp = (a * b) * i;
} else if (b <= -6.5e-101) {
tmp = (-x * a) * t;
} else if (b <= -3.1e-299) {
tmp = t_1;
} else if (b <= 3.8e-152) {
tmp = -a * (x * t);
} else if (b <= 4.9e-60) {
tmp = t_1;
} else {
tmp = (i * b) * a;
}
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)
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) :: t_1
real(8) :: tmp
t_1 = (z * y) * x
if (b <= (-5.6d+172)) then
tmp = (a * b) * i
else if (b <= (-6.5d-101)) then
tmp = (-x * a) * t
else if (b <= (-3.1d-299)) then
tmp = t_1
else if (b <= 3.8d-152) then
tmp = -a * (x * t)
else if (b <= 4.9d-60) then
tmp = t_1
else
tmp = (i * b) * a
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 t_1 = (z * y) * x;
double tmp;
if (b <= -5.6e+172) {
tmp = (a * b) * i;
} else if (b <= -6.5e-101) {
tmp = (-x * a) * t;
} else if (b <= -3.1e-299) {
tmp = t_1;
} else if (b <= 3.8e-152) {
tmp = -a * (x * t);
} else if (b <= 4.9e-60) {
tmp = t_1;
} else {
tmp = (i * b) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (z * y) * x tmp = 0 if b <= -5.6e+172: tmp = (a * b) * i elif b <= -6.5e-101: tmp = (-x * a) * t elif b <= -3.1e-299: tmp = t_1 elif b <= 3.8e-152: tmp = -a * (x * t) elif b <= 4.9e-60: tmp = t_1 else: tmp = (i * b) * a return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * y) * x) tmp = 0.0 if (b <= -5.6e+172) tmp = Float64(Float64(a * b) * i); elseif (b <= -6.5e-101) tmp = Float64(Float64(Float64(-x) * a) * t); elseif (b <= -3.1e-299) tmp = t_1; elseif (b <= 3.8e-152) tmp = Float64(Float64(-a) * Float64(x * t)); elseif (b <= 4.9e-60) tmp = t_1; else tmp = Float64(Float64(i * b) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (z * y) * x; tmp = 0.0; if (b <= -5.6e+172) tmp = (a * b) * i; elseif (b <= -6.5e-101) tmp = (-x * a) * t; elseif (b <= -3.1e-299) tmp = t_1; elseif (b <= 3.8e-152) tmp = -a * (x * t); elseif (b <= 4.9e-60) tmp = t_1; else tmp = (i * b) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[b, -5.6e+172], N[(N[(a * b), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[b, -6.5e-101], N[(N[((-x) * a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, -3.1e-299], t$95$1, If[LessEqual[b, 3.8e-152], N[((-a) * N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.9e-60], t$95$1, N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y\right) \cdot x\\
\mathbf{if}\;b \leq -5.6 \cdot 10^{+172}:\\
\;\;\;\;\left(a \cdot b\right) \cdot i\\
\mathbf{elif}\;b \leq -6.5 \cdot 10^{-101}:\\
\;\;\;\;\left(\left(-x\right) \cdot a\right) \cdot t\\
\mathbf{elif}\;b \leq -3.1 \cdot 10^{-299}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{-152}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot t\right)\\
\mathbf{elif}\;b \leq 4.9 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\end{array}
\end{array}
if b < -5.5999999999999999e172Initial program 72.6%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6464.0
Applied rewrites64.0%
Taylor expanded in y around 0
Applied rewrites55.3%
if -5.5999999999999999e172 < b < -6.4999999999999996e-101Initial program 69.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6446.9
Applied rewrites46.9%
Taylor expanded in x around inf
Applied rewrites37.0%
if -6.4999999999999996e-101 < b < -3.1e-299 or 3.80000000000000012e-152 < b < 4.89999999999999988e-60Initial program 75.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6464.9
Applied rewrites64.9%
Taylor expanded in x around inf
Applied rewrites45.4%
if -3.1e-299 < b < 3.80000000000000012e-152Initial program 71.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6459.8
Applied rewrites59.8%
Taylor expanded in x around inf
Applied rewrites42.0%
if 4.89999999999999988e-60 < b Initial program 72.6%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.5
Applied rewrites49.5%
Taylor expanded in y around 0
Applied rewrites47.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i a (* (- z) c)) b)))
(if (<= b -2.3e+153)
t_1
(if (<= b -3.3e-271)
(* (fma (- i) j (* z x)) y)
(if (<= b 3.15e-58) (* (fma (- t) a (* y z)) x) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(i, a, (-z * c)) * b;
double tmp;
if (b <= -2.3e+153) {
tmp = t_1;
} else if (b <= -3.3e-271) {
tmp = fma(-i, j, (z * x)) * y;
} else if (b <= 3.15e-58) {
tmp = fma(-t, a, (y * z)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(i, a, Float64(Float64(-z) * c)) * b) tmp = 0.0 if (b <= -2.3e+153) tmp = t_1; elseif (b <= -3.3e-271) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (b <= 3.15e-58) tmp = Float64(fma(Float64(-t), a, Float64(y * z)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a + N[((-z) * c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.3e+153], t$95$1, If[LessEqual[b, -3.3e-271], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[b, 3.15e-58], N[(N[((-t) * a + N[(y * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, a, \left(-z\right) \cdot c\right) \cdot b\\
\mathbf{if}\;b \leq -2.3 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3.3 \cdot 10^{-271}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;b \leq 3.15 \cdot 10^{-58}:\\
\;\;\;\;\mathsf{fma}\left(-t, a, y \cdot z\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.3000000000000001e153 or 3.14999999999999999e-58 < b Initial program 72.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in x around 0
Applied rewrites22.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6467.4
Applied rewrites67.4%
if -2.3000000000000001e153 < b < -3.3000000000000002e-271Initial program 70.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6454.2
Applied rewrites54.2%
if -3.3000000000000002e-271 < b < 3.14999999999999999e-58Initial program 76.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6447.1
Applied rewrites47.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6462.8
Applied rewrites62.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i a (* (- z) c)) b)))
(if (<= b -2.4e+163)
t_1
(if (<= b 4.2e-165)
(* (fma (- y) i (* c t)) j)
(if (<= b 2.3e-65) (* (* z y) x) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(i, a, (-z * c)) * b;
double tmp;
if (b <= -2.4e+163) {
tmp = t_1;
} else if (b <= 4.2e-165) {
tmp = fma(-y, i, (c * t)) * j;
} else if (b <= 2.3e-65) {
tmp = (z * y) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(i, a, Float64(Float64(-z) * c)) * b) tmp = 0.0 if (b <= -2.4e+163) tmp = t_1; elseif (b <= 4.2e-165) tmp = Float64(fma(Float64(-y), i, Float64(c * t)) * j); elseif (b <= 2.3e-65) tmp = Float64(Float64(z * y) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a + N[((-z) * c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.4e+163], t$95$1, If[LessEqual[b, 4.2e-165], N[(N[((-y) * i + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[b, 2.3e-65], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, a, \left(-z\right) \cdot c\right) \cdot b\\
\mathbf{if}\;b \leq -2.4 \cdot 10^{+163}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.2 \cdot 10^{-165}:\\
\;\;\;\;\mathsf{fma}\left(-y, i, c \cdot t\right) \cdot j\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-65}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.3999999999999999e163 or 2.3e-65 < b Initial program 72.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.8
Applied rewrites39.8%
Taylor expanded in x around 0
Applied rewrites22.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6466.6
Applied rewrites66.6%
if -2.3999999999999999e163 < b < 4.1999999999999999e-165Initial program 71.9%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6444.4
Applied rewrites44.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6444.4
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-neg.f64N/A
+-commutativeN/A
lift-fma.f6445.3
Applied rewrites45.3%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6442.7
Applied rewrites42.7%
if 4.1999999999999999e-165 < b < 2.3e-65Initial program 72.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around inf
Applied rewrites56.9%
Final simplification54.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- y) i (* c t)) j)))
(if (<= j -1.05e-22)
t_1
(if (<= j 1.85e-208)
(* (* (- x) a) t)
(if (<= j 1.15e+19) (* (* i b) a) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-y, i, (c * t)) * j;
double tmp;
if (j <= -1.05e-22) {
tmp = t_1;
} else if (j <= 1.85e-208) {
tmp = (-x * a) * t;
} else if (j <= 1.15e+19) {
tmp = (i * b) * a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-y), i, Float64(c * t)) * j) tmp = 0.0 if (j <= -1.05e-22) tmp = t_1; elseif (j <= 1.85e-208) tmp = Float64(Float64(Float64(-x) * a) * t); elseif (j <= 1.15e+19) tmp = Float64(Float64(i * b) * a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-y) * i + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -1.05e-22], t$95$1, If[LessEqual[j, 1.85e-208], N[(N[((-x) * a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[j, 1.15e+19], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, i, c \cdot t\right) \cdot j\\
\mathbf{if}\;j \leq -1.05 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.85 \cdot 10^{-208}:\\
\;\;\;\;\left(\left(-x\right) \cdot a\right) \cdot t\\
\mathbf{elif}\;j \leq 1.15 \cdot 10^{+19}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -1.05000000000000004e-22 or 1.15e19 < j Initial program 74.8%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6460.5
Applied rewrites60.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6463.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-neg.f64N/A
+-commutativeN/A
lift-fma.f6463.7
Applied rewrites63.7%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6454.8
Applied rewrites54.8%
if -1.05000000000000004e-22 < j < 1.8500000000000001e-208Initial program 67.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6444.7
Applied rewrites44.7%
Taylor expanded in x around inf
Applied rewrites40.0%
if 1.8500000000000001e-208 < j < 1.15e19Initial program 77.2%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.9
Applied rewrites49.9%
Taylor expanded in y around 0
Applied rewrites50.3%
Final simplification48.8%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -5.6e+172)
(* (* a b) i)
(if (<= b -2.2e-35)
(* (* (- x) a) t)
(if (<= b 3.9e-165)
(* (* (- j) y) i)
(if (<= b 4.9e-60) (* (* z y) x) (* (* i b) a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -5.6e+172) {
tmp = (a * b) * i;
} else if (b <= -2.2e-35) {
tmp = (-x * a) * t;
} else if (b <= 3.9e-165) {
tmp = (-j * y) * i;
} else if (b <= 4.9e-60) {
tmp = (z * y) * x;
} else {
tmp = (i * b) * a;
}
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)
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) :: tmp
if (b <= (-5.6d+172)) then
tmp = (a * b) * i
else if (b <= (-2.2d-35)) then
tmp = (-x * a) * t
else if (b <= 3.9d-165) then
tmp = (-j * y) * i
else if (b <= 4.9d-60) then
tmp = (z * y) * x
else
tmp = (i * b) * a
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 tmp;
if (b <= -5.6e+172) {
tmp = (a * b) * i;
} else if (b <= -2.2e-35) {
tmp = (-x * a) * t;
} else if (b <= 3.9e-165) {
tmp = (-j * y) * i;
} else if (b <= 4.9e-60) {
tmp = (z * y) * x;
} else {
tmp = (i * b) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -5.6e+172: tmp = (a * b) * i elif b <= -2.2e-35: tmp = (-x * a) * t elif b <= 3.9e-165: tmp = (-j * y) * i elif b <= 4.9e-60: tmp = (z * y) * x else: tmp = (i * b) * a return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -5.6e+172) tmp = Float64(Float64(a * b) * i); elseif (b <= -2.2e-35) tmp = Float64(Float64(Float64(-x) * a) * t); elseif (b <= 3.9e-165) tmp = Float64(Float64(Float64(-j) * y) * i); elseif (b <= 4.9e-60) tmp = Float64(Float64(z * y) * x); else tmp = Float64(Float64(i * b) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -5.6e+172) tmp = (a * b) * i; elseif (b <= -2.2e-35) tmp = (-x * a) * t; elseif (b <= 3.9e-165) tmp = (-j * y) * i; elseif (b <= 4.9e-60) tmp = (z * y) * x; else tmp = (i * b) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -5.6e+172], N[(N[(a * b), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[b, -2.2e-35], N[(N[((-x) * a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, 3.9e-165], N[(N[((-j) * y), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[b, 4.9e-60], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.6 \cdot 10^{+172}:\\
\;\;\;\;\left(a \cdot b\right) \cdot i\\
\mathbf{elif}\;b \leq -2.2 \cdot 10^{-35}:\\
\;\;\;\;\left(\left(-x\right) \cdot a\right) \cdot t\\
\mathbf{elif}\;b \leq 3.9 \cdot 10^{-165}:\\
\;\;\;\;\left(\left(-j\right) \cdot y\right) \cdot i\\
\mathbf{elif}\;b \leq 4.9 \cdot 10^{-60}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\end{array}
\end{array}
if b < -5.5999999999999999e172Initial program 72.6%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6464.0
Applied rewrites64.0%
Taylor expanded in y around 0
Applied rewrites55.3%
if -5.5999999999999999e172 < b < -2.19999999999999994e-35Initial program 68.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.0
Applied rewrites49.0%
Taylor expanded in x around inf
Applied rewrites40.8%
if -2.19999999999999994e-35 < b < 3.8999999999999999e-165Initial program 73.7%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in y around inf
Applied rewrites34.5%
if 3.8999999999999999e-165 < b < 4.89999999999999988e-60Initial program 73.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6458.8
Applied rewrites58.8%
Taylor expanded in x around inf
Applied rewrites54.8%
if 4.89999999999999988e-60 < b Initial program 72.6%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.5
Applied rewrites49.5%
Taylor expanded in y around 0
Applied rewrites47.7%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -5.6e+172)
(* (* a b) i)
(if (<= b -1e-100)
(* (* (- x) a) t)
(if (<= b 2.25e-165)
(* (* (- j) i) y)
(if (<= b 4.9e-60) (* (* z y) x) (* (* i b) a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -5.6e+172) {
tmp = (a * b) * i;
} else if (b <= -1e-100) {
tmp = (-x * a) * t;
} else if (b <= 2.25e-165) {
tmp = (-j * i) * y;
} else if (b <= 4.9e-60) {
tmp = (z * y) * x;
} else {
tmp = (i * b) * a;
}
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)
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) :: tmp
if (b <= (-5.6d+172)) then
tmp = (a * b) * i
else if (b <= (-1d-100)) then
tmp = (-x * a) * t
else if (b <= 2.25d-165) then
tmp = (-j * i) * y
else if (b <= 4.9d-60) then
tmp = (z * y) * x
else
tmp = (i * b) * a
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 tmp;
if (b <= -5.6e+172) {
tmp = (a * b) * i;
} else if (b <= -1e-100) {
tmp = (-x * a) * t;
} else if (b <= 2.25e-165) {
tmp = (-j * i) * y;
} else if (b <= 4.9e-60) {
tmp = (z * y) * x;
} else {
tmp = (i * b) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -5.6e+172: tmp = (a * b) * i elif b <= -1e-100: tmp = (-x * a) * t elif b <= 2.25e-165: tmp = (-j * i) * y elif b <= 4.9e-60: tmp = (z * y) * x else: tmp = (i * b) * a return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -5.6e+172) tmp = Float64(Float64(a * b) * i); elseif (b <= -1e-100) tmp = Float64(Float64(Float64(-x) * a) * t); elseif (b <= 2.25e-165) tmp = Float64(Float64(Float64(-j) * i) * y); elseif (b <= 4.9e-60) tmp = Float64(Float64(z * y) * x); else tmp = Float64(Float64(i * b) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -5.6e+172) tmp = (a * b) * i; elseif (b <= -1e-100) tmp = (-x * a) * t; elseif (b <= 2.25e-165) tmp = (-j * i) * y; elseif (b <= 4.9e-60) tmp = (z * y) * x; else tmp = (i * b) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -5.6e+172], N[(N[(a * b), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[b, -1e-100], N[(N[((-x) * a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, 2.25e-165], N[(N[((-j) * i), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[b, 4.9e-60], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.6 \cdot 10^{+172}:\\
\;\;\;\;\left(a \cdot b\right) \cdot i\\
\mathbf{elif}\;b \leq -1 \cdot 10^{-100}:\\
\;\;\;\;\left(\left(-x\right) \cdot a\right) \cdot t\\
\mathbf{elif}\;b \leq 2.25 \cdot 10^{-165}:\\
\;\;\;\;\left(\left(-j\right) \cdot i\right) \cdot y\\
\mathbf{elif}\;b \leq 4.9 \cdot 10^{-60}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\end{array}
\end{array}
if b < -5.5999999999999999e172Initial program 72.6%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6464.0
Applied rewrites64.0%
Taylor expanded in y around 0
Applied rewrites55.3%
if -5.5999999999999999e172 < b < -1e-100Initial program 69.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6446.9
Applied rewrites46.9%
Taylor expanded in x around inf
Applied rewrites37.0%
if -1e-100 < b < 2.24999999999999996e-165Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6455.8
Applied rewrites55.8%
Taylor expanded in x around 0
Applied rewrites36.3%
if 2.24999999999999996e-165 < b < 4.89999999999999988e-60Initial program 73.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6458.8
Applied rewrites58.8%
Taylor expanded in x around inf
Applied rewrites54.8%
if 4.89999999999999988e-60 < b Initial program 72.6%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.5
Applied rewrites49.5%
Taylor expanded in y around 0
Applied rewrites47.7%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= y -1.9e-48) (not (<= y 1.55e+81))) (* (fma (- i) j (* z x)) y) (* (fma (- x) t (* i b)) a)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((y <= -1.9e-48) || !(y <= 1.55e+81)) {
tmp = fma(-i, j, (z * x)) * y;
} else {
tmp = fma(-x, t, (i * b)) * a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((y <= -1.9e-48) || !(y <= 1.55e+81)) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); else tmp = Float64(fma(Float64(-x), t, Float64(i * b)) * a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[y, -1.9e-48], N[Not[LessEqual[y, 1.55e+81]], $MachinePrecision]], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[((-x) * t + N[(i * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-48} \lor \neg \left(y \leq 1.55 \cdot 10^{+81}\right):\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, t, i \cdot b\right) \cdot a\\
\end{array}
\end{array}
if y < -1.90000000000000001e-48 or 1.55e81 < y Initial program 66.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6461.7
Applied rewrites61.7%
if -1.90000000000000001e-48 < y < 1.55e81Initial program 78.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6461.1
Applied rewrites61.1%
Final simplification61.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= b -2.3e+153) (not (<= b 8.2e-63))) (* (fma i a (* (- z) c)) b) (* (fma (- i) j (* z x)) y)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((b <= -2.3e+153) || !(b <= 8.2e-63)) {
tmp = fma(i, a, (-z * c)) * b;
} else {
tmp = fma(-i, j, (z * x)) * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((b <= -2.3e+153) || !(b <= 8.2e-63)) tmp = Float64(fma(i, a, Float64(Float64(-z) * c)) * b); else tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[b, -2.3e+153], N[Not[LessEqual[b, 8.2e-63]], $MachinePrecision]], N[(N[(i * a + N[((-z) * c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{+153} \lor \neg \left(b \leq 8.2 \cdot 10^{-63}\right):\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-z\right) \cdot c\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\end{array}
\end{array}
if b < -2.3000000000000001e153 or 8.1999999999999995e-63 < b Initial program 72.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
Taylor expanded in x around 0
Applied rewrites22.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6466.3
Applied rewrites66.3%
if -2.3000000000000001e153 < b < 8.1999999999999995e-63Initial program 72.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6453.0
Applied rewrites53.0%
Final simplification58.9%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -2.5e+163)
(* (* a b) i)
(if (<= b 3.8e-152)
(* (- a) (* x t))
(if (<= b 4.9e-60) (* (* z y) x) (* (* i b) a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -2.5e+163) {
tmp = (a * b) * i;
} else if (b <= 3.8e-152) {
tmp = -a * (x * t);
} else if (b <= 4.9e-60) {
tmp = (z * y) * x;
} else {
tmp = (i * b) * a;
}
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)
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) :: tmp
if (b <= (-2.5d+163)) then
tmp = (a * b) * i
else if (b <= 3.8d-152) then
tmp = -a * (x * t)
else if (b <= 4.9d-60) then
tmp = (z * y) * x
else
tmp = (i * b) * a
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 tmp;
if (b <= -2.5e+163) {
tmp = (a * b) * i;
} else if (b <= 3.8e-152) {
tmp = -a * (x * t);
} else if (b <= 4.9e-60) {
tmp = (z * y) * x;
} else {
tmp = (i * b) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -2.5e+163: tmp = (a * b) * i elif b <= 3.8e-152: tmp = -a * (x * t) elif b <= 4.9e-60: tmp = (z * y) * x else: tmp = (i * b) * a return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -2.5e+163) tmp = Float64(Float64(a * b) * i); elseif (b <= 3.8e-152) tmp = Float64(Float64(-a) * Float64(x * t)); elseif (b <= 4.9e-60) tmp = Float64(Float64(z * y) * x); else tmp = Float64(Float64(i * b) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -2.5e+163) tmp = (a * b) * i; elseif (b <= 3.8e-152) tmp = -a * (x * t); elseif (b <= 4.9e-60) tmp = (z * y) * x; else tmp = (i * b) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -2.5e+163], N[(N[(a * b), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[b, 3.8e-152], N[((-a) * N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.9e-60], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.5 \cdot 10^{+163}:\\
\;\;\;\;\left(a \cdot b\right) \cdot i\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{-152}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot t\right)\\
\mathbf{elif}\;b \leq 4.9 \cdot 10^{-60}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\end{array}
\end{array}
if b < -2.5e163Initial program 72.7%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6459.9
Applied rewrites59.9%
Taylor expanded in y around 0
Applied rewrites52.2%
if -2.5e163 < b < 3.80000000000000012e-152Initial program 70.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6444.3
Applied rewrites44.3%
Taylor expanded in x around inf
Applied rewrites31.7%
if 3.80000000000000012e-152 < b < 4.89999999999999988e-60Initial program 78.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6465.7
Applied rewrites65.7%
Taylor expanded in x around inf
Applied rewrites57.4%
if 4.89999999999999988e-60 < b Initial program 72.6%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.5
Applied rewrites49.5%
Taylor expanded in y around 0
Applied rewrites47.7%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= b -1.6e+27) (not (<= b 4.9e-60))) (* (* i b) a) (* (* z y) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((b <= -1.6e+27) || !(b <= 4.9e-60)) {
tmp = (i * b) * a;
} else {
tmp = (z * y) * x;
}
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)
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) :: tmp
if ((b <= (-1.6d+27)) .or. (.not. (b <= 4.9d-60))) then
tmp = (i * b) * a
else
tmp = (z * y) * x
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 tmp;
if ((b <= -1.6e+27) || !(b <= 4.9e-60)) {
tmp = (i * b) * a;
} else {
tmp = (z * y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (b <= -1.6e+27) or not (b <= 4.9e-60): tmp = (i * b) * a else: tmp = (z * y) * x return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((b <= -1.6e+27) || !(b <= 4.9e-60)) tmp = Float64(Float64(i * b) * a); else tmp = Float64(Float64(z * y) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((b <= -1.6e+27) || ~((b <= 4.9e-60))) tmp = (i * b) * a; else tmp = (z * y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[b, -1.6e+27], N[Not[LessEqual[b, 4.9e-60]], $MachinePrecision]], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.6 \cdot 10^{+27} \lor \neg \left(b \leq 4.9 \cdot 10^{-60}\right):\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\end{array}
\end{array}
if b < -1.60000000000000008e27 or 4.89999999999999988e-60 < b Initial program 71.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6448.1
Applied rewrites48.1%
Taylor expanded in y around 0
Applied rewrites42.8%
if -1.60000000000000008e27 < b < 4.89999999999999988e-60Initial program 73.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6454.2
Applied rewrites54.2%
Taylor expanded in x around inf
Applied rewrites33.5%
Final simplification38.5%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= z -8.6e+58) (not (<= z 4.6e+33))) (* (* z y) x) (* (* j t) c)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((z <= -8.6e+58) || !(z <= 4.6e+33)) {
tmp = (z * y) * x;
} else {
tmp = (j * t) * c;
}
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)
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) :: tmp
if ((z <= (-8.6d+58)) .or. (.not. (z <= 4.6d+33))) then
tmp = (z * y) * x
else
tmp = (j * t) * c
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 tmp;
if ((z <= -8.6e+58) || !(z <= 4.6e+33)) {
tmp = (z * y) * x;
} else {
tmp = (j * t) * c;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (z <= -8.6e+58) or not (z <= 4.6e+33): tmp = (z * y) * x else: tmp = (j * t) * c return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((z <= -8.6e+58) || !(z <= 4.6e+33)) tmp = Float64(Float64(z * y) * x); else tmp = Float64(Float64(j * t) * c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((z <= -8.6e+58) || ~((z <= 4.6e+33))) tmp = (z * y) * x; else tmp = (j * t) * c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[z, -8.6e+58], N[Not[LessEqual[z, 4.6e+33]], $MachinePrecision]], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+58} \lor \neg \left(z \leq 4.6 \cdot 10^{+33}\right):\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\end{array}
\end{array}
if z < -8.59999999999999982e58 or 4.60000000000000021e33 < z Initial program 62.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6455.8
Applied rewrites55.8%
Taylor expanded in x around inf
Applied rewrites48.9%
if -8.59999999999999982e58 < z < 4.60000000000000021e33Initial program 78.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6443.7
Applied rewrites43.7%
Taylor expanded in x around 0
Applied rewrites23.9%
Final simplification33.9%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= b -6.6e+172) (* (* a b) i) (if (<= b 4.9e-60) (* (* z x) y) (* (* i b) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -6.6e+172) {
tmp = (a * b) * i;
} else if (b <= 4.9e-60) {
tmp = (z * x) * y;
} else {
tmp = (i * b) * a;
}
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)
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) :: tmp
if (b <= (-6.6d+172)) then
tmp = (a * b) * i
else if (b <= 4.9d-60) then
tmp = (z * x) * y
else
tmp = (i * b) * a
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 tmp;
if (b <= -6.6e+172) {
tmp = (a * b) * i;
} else if (b <= 4.9e-60) {
tmp = (z * x) * y;
} else {
tmp = (i * b) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -6.6e+172: tmp = (a * b) * i elif b <= 4.9e-60: tmp = (z * x) * y else: tmp = (i * b) * a return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -6.6e+172) tmp = Float64(Float64(a * b) * i); elseif (b <= 4.9e-60) tmp = Float64(Float64(z * x) * y); else tmp = Float64(Float64(i * b) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -6.6e+172) tmp = (a * b) * i; elseif (b <= 4.9e-60) tmp = (z * x) * y; else tmp = (i * b) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -6.6e+172], N[(N[(a * b), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[b, 4.9e-60], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.6 \cdot 10^{+172}:\\
\;\;\;\;\left(a \cdot b\right) \cdot i\\
\mathbf{elif}\;b \leq 4.9 \cdot 10^{-60}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\end{array}
\end{array}
if b < -6.59999999999999965e172Initial program 71.8%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6466.0
Applied rewrites66.0%
Taylor expanded in y around 0
Applied rewrites57.0%
if -6.59999999999999965e172 < b < 4.89999999999999988e-60Initial program 72.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6451.1
Applied rewrites51.1%
Taylor expanded in x around inf
Applied rewrites30.4%
if 4.89999999999999988e-60 < b Initial program 72.6%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.5
Applied rewrites49.5%
Taylor expanded in y around 0
Applied rewrites47.7%
(FPCore (x y z t a b c i j) :precision binary64 (* (* j t) c))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (j * t) * c;
}
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)
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
code = (j * t) * c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (j * t) * c;
}
def code(x, y, z, t, a, b, c, i, j): return (j * t) * c
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(j * t) * c) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (j * t) * c; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]
\begin{array}{l}
\\
\left(j \cdot t\right) \cdot c
\end{array}
Initial program 72.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6441.4
Applied rewrites41.4%
Taylor expanded in x around 0
Applied rewrites19.5%
(FPCore (x y z t a b c i j) :precision binary64 (* (* c t) j))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (c * t) * j;
}
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)
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
code = (c * t) * j
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (c * t) * j;
}
def code(x, y, z, t, a, b, c, i, j): return (c * t) * j
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(c * t) * j) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (c * t) * j; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision]
\begin{array}{l}
\\
\left(c \cdot t\right) \cdot j
\end{array}
Initial program 72.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6441.4
Applied rewrites41.4%
Taylor expanded in x around 0
Applied rewrites19.5%
Applied rewrites18.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(/
(* j (- (pow (* c t) 2.0) (pow (* i y) 2.0)))
(+ (* c t) (* i y)))))
(t_2
(-
(* x (- (* z y) (* a t)))
(- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j)))))
(if (< t -8.120978919195912e-33)
t_2
(if (< t -4.712553818218485e-169)
t_1
(if (< t -7.633533346031584e-308)
t_2
(if (< t 1.0535888557455487e-139) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (pow((c * t), 2.0) - pow((i * y), 2.0))) / ((c * t) + (i * y)));
double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
double tmp;
if (t < -8.120978919195912e-33) {
tmp = t_2;
} else if (t < -4.712553818218485e-169) {
tmp = t_1;
} else if (t < -7.633533346031584e-308) {
tmp = t_2;
} else if (t < 1.0535888557455487e-139) {
tmp = t_1;
} 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)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ** 2.0d0) - ((i * y) ** 2.0d0))) / ((c * t) + (i * y)))
t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j))
if (t < (-8.120978919195912d-33)) then
tmp = t_2
else if (t < (-4.712553818218485d-169)) then
tmp = t_1
else if (t < (-7.633533346031584d-308)) then
tmp = t_2
else if (t < 1.0535888557455487d-139) then
tmp = t_1
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 t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (Math.pow((c * t), 2.0) - Math.pow((i * y), 2.0))) / ((c * t) + (i * y)));
double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
double tmp;
if (t < -8.120978919195912e-33) {
tmp = t_2;
} else if (t < -4.712553818218485e-169) {
tmp = t_1;
} else if (t < -7.633533346031584e-308) {
tmp = t_2;
} else if (t < 1.0535888557455487e-139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (math.pow((c * t), 2.0) - math.pow((i * y), 2.0))) / ((c * t) + (i * y))) t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j)) tmp = 0 if t < -8.120978919195912e-33: tmp = t_2 elif t < -4.712553818218485e-169: tmp = t_1 elif t < -7.633533346031584e-308: tmp = t_2 elif t < 1.0535888557455487e-139: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(Float64(j * Float64((Float64(c * t) ^ 2.0) - (Float64(i * y) ^ 2.0))) / Float64(Float64(c * t) + Float64(i * y)))) t_2 = Float64(Float64(x * Float64(Float64(z * y) - Float64(a * t))) - Float64(Float64(b * Float64(Float64(z * c) - Float64(a * i))) - Float64(Float64(Float64(c * t) - Float64(y * i)) * j))) tmp = 0.0 if (t < -8.120978919195912e-33) tmp = t_2; elseif (t < -4.712553818218485e-169) tmp = t_1; elseif (t < -7.633533346031584e-308) tmp = t_2; elseif (t < 1.0535888557455487e-139) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ^ 2.0) - ((i * y) ^ 2.0))) / ((c * t) + (i * y))); t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j)); tmp = 0.0; if (t < -8.120978919195912e-33) tmp = t_2; elseif (t < -4.712553818218485e-169) tmp = t_1; elseif (t < -7.633533346031584e-308) tmp = t_2; elseif (t < 1.0535888557455487e-139) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(j * N[(N[Power[N[(c * t), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(i * y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * t), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[(z * c), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * t), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -8.120978919195912e-33], t$95$2, If[Less[t, -4.712553818218485e-169], t$95$1, If[Less[t, -7.633533346031584e-308], t$95$2, If[Less[t, 1.0535888557455487e-139], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\
t_2 := x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\
\mathbf{if}\;t < -8.120978919195912 \cdot 10^{-33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < -4.712553818218485 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < -7.633533346031584 \cdot 10^{-308}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < 1.0535888557455487 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024364
(FPCore (x y z t a b c i j)
:name "Linear.Matrix:det33 from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (if (< t -1015122364899489/125000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -942510763643697/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (if (< t -238547917063487/3125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t 10535888557455487/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))