
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
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) - (t * i)))) + (j * ((c * a) - (y * i)));
}
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) - (t * i)))) + (j * ((c * a) - (y * i)))
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) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
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(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); 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[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
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) - (t * i)))) + (j * ((c * a) - (y * i)));
}
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) - (t * i)))) + (j * ((c * a) - (y * i)))
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) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
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(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); 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[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c a) (* y i)))))
(if (<=
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) t_1)
INFINITY)
(+ (fma (- (* z y) (* a t)) x (* (- b) (- (* c z) (* i t)))) t_1)
(* (- (* j a) (* b z)) c))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * a) - (y * i));
double tmp;
if ((((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + t_1) <= ((double) INFINITY)) {
tmp = fma(((z * y) - (a * t)), x, (-b * ((c * z) - (i * t)))) + t_1;
} else {
tmp = ((j * a) - (b * z)) * c;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(c * a) - Float64(y * i))) tmp = 0.0 if (Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + t_1) <= Inf) tmp = Float64(fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(-b) * Float64(Float64(c * z) - Float64(i * t)))) + t_1); else tmp = Float64(Float64(Float64(j * a) - Float64(b * z)) * c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, 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[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], Infinity], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(-b\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 91.5%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.5%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 0.0%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6444.9
Applied rewrites44.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
(* j (- (* c a) (* y i))))))
(if (<= t_1 INFINITY) t_1 (* (- (* j a) (* b z)) c))))
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) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = ((j * a) - (b * z)) * c;
}
return tmp;
}
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) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = ((j * a) - (b * z)) * c;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = ((j * a) - (b * z)) * c 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(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(Float64(j * a) - Float64(b * z)) * c); 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) - (t * i)))) + (j * ((c * a) - (y * i))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = ((j * a) - (b * z)) * c; 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[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 91.5%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 0.0%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6444.9
Applied rewrites44.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* c z) (* i t)) b)))
(if (<= x 2e+17)
(- (* (- (* c a) (* i y)) j) t_1)
(- (* (- (* z y) (* a t)) 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 = ((c * z) - (i * t)) * b;
double tmp;
if (x <= 2e+17) {
tmp = (((c * a) - (i * y)) * j) - t_1;
} else {
tmp = (((z * y) - (a * t)) * x) - t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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 = ((c * z) - (i * t)) * b
if (x <= 2d+17) then
tmp = (((c * a) - (i * y)) * j) - t_1
else
tmp = (((z * y) - (a * t)) * x) - t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((c * z) - (i * t)) * b;
double tmp;
if (x <= 2e+17) {
tmp = (((c * a) - (i * y)) * j) - t_1;
} else {
tmp = (((z * y) - (a * t)) * x) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((c * z) - (i * t)) * b tmp = 0 if x <= 2e+17: tmp = (((c * a) - (i * y)) * j) - t_1 else: tmp = (((z * y) - (a * t)) * x) - t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(c * z) - Float64(i * t)) * b) tmp = 0.0 if (x <= 2e+17) tmp = Float64(Float64(Float64(Float64(c * a) - Float64(i * y)) * j) - t_1); else tmp = Float64(Float64(Float64(Float64(z * y) - Float64(a * t)) * x) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((c * z) - (i * t)) * b; tmp = 0.0; if (x <= 2e+17) tmp = (((c * a) - (i * y)) * j) - t_1; else tmp = (((z * y) - (a * t)) * x) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[x, 2e+17], N[(N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot z - i \cdot t\right) \cdot b\\
\mathbf{if}\;x \leq 2 \cdot 10^{+17}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x - t\_1\\
\end{array}
\end{array}
if x < 2e17Initial program 73.4%
Taylor expanded in x around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6463.8
Applied rewrites63.8%
if 2e17 < x Initial program 73.9%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.3
Applied rewrites67.3%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= x 2.2e+17) (- (* (- (* c a) (* i y)) j) (* (- (* c z) (* i t)) b)) (- (* (- (* z y) (* a t)) x) (* (* c z) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= 2.2e+17) {
tmp = (((c * a) - (i * y)) * j) - (((c * z) - (i * t)) * b);
} else {
tmp = (((z * y) - (a * t)) * x) - ((c * z) * b);
}
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 (x <= 2.2d+17) then
tmp = (((c * a) - (i * y)) * j) - (((c * z) - (i * t)) * b)
else
tmp = (((z * y) - (a * t)) * x) - ((c * z) * b)
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 (x <= 2.2e+17) {
tmp = (((c * a) - (i * y)) * j) - (((c * z) - (i * t)) * b);
} else {
tmp = (((z * y) - (a * t)) * x) - ((c * z) * b);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= 2.2e+17: tmp = (((c * a) - (i * y)) * j) - (((c * z) - (i * t)) * b) else: tmp = (((z * y) - (a * t)) * x) - ((c * z) * b) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= 2.2e+17) tmp = Float64(Float64(Float64(Float64(c * a) - Float64(i * y)) * j) - Float64(Float64(Float64(c * z) - Float64(i * t)) * b)); else tmp = Float64(Float64(Float64(Float64(z * y) - Float64(a * t)) * x) - Float64(Float64(c * z) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (x <= 2.2e+17) tmp = (((c * a) - (i * y)) * j) - (((c * z) - (i * t)) * b); else tmp = (((z * y) - (a * t)) * x) - ((c * z) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, 2.2e+17], N[(N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision] - N[(N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.2 \cdot 10^{+17}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j - \left(c \cdot z - i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z\right) \cdot b\\
\end{array}
\end{array}
if x < 2.2e17Initial program 73.4%
Taylor expanded in x around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6463.8
Applied rewrites63.8%
if 2.2e17 < x Initial program 73.9%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.3
Applied rewrites67.3%
Taylor expanded in z around inf
lift-*.f6463.8
Applied rewrites63.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- b) (* c z)))
(t_2 (* j (- (* c a) (* y i))))
(t_3 (* (- (* y x) (* c b)) z)))
(if (<= z -1.55e+196)
t_3
(if (<= z -1.25e-39)
(+ t_1 t_2)
(if (<= z 2.7e+15)
(+ (* (* i t) b) t_2)
(if (<= z 1.25e+64) (fma (- a) (* x t) t_1) t_3))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -b * (c * z);
double t_2 = j * ((c * a) - (y * i));
double t_3 = ((y * x) - (c * b)) * z;
double tmp;
if (z <= -1.55e+196) {
tmp = t_3;
} else if (z <= -1.25e-39) {
tmp = t_1 + t_2;
} else if (z <= 2.7e+15) {
tmp = ((i * t) * b) + t_2;
} else if (z <= 1.25e+64) {
tmp = fma(-a, (x * t), t_1);
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-b) * Float64(c * z)) t_2 = Float64(j * Float64(Float64(c * a) - Float64(y * i))) t_3 = Float64(Float64(Float64(y * x) - Float64(c * b)) * z) tmp = 0.0 if (z <= -1.55e+196) tmp = t_3; elseif (z <= -1.25e-39) tmp = Float64(t_1 + t_2); elseif (z <= 2.7e+15) tmp = Float64(Float64(Float64(i * t) * b) + t_2); elseif (z <= 1.25e+64) tmp = fma(Float64(-a), Float64(x * t), t_1); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.55e+196], t$95$3, If[LessEqual[z, -1.25e-39], N[(t$95$1 + t$95$2), $MachinePrecision], If[LessEqual[z, 2.7e+15], N[(N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[z, 1.25e+64], N[((-a) * N[(x * t), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-b\right) \cdot \left(c \cdot z\right)\\
t_2 := j \cdot \left(c \cdot a - y \cdot i\right)\\
t_3 := \left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+196}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-39}:\\
\;\;\;\;t\_1 + t\_2\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+15}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b + t\_2\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(-a, x \cdot t, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -1.55000000000000005e196 or 1.25e64 < z Initial program 63.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.3
Applied rewrites67.3%
if -1.55000000000000005e196 < z < -1.25e-39Initial program 72.8%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.1%
Taylor expanded in c around inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lift-*.f6450.3
Applied rewrites50.3%
if -1.25e-39 < z < 2.7e15Initial program 79.9%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6459.9
Applied rewrites59.9%
if 2.7e15 < z < 1.25e64Initial program 77.8%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites78.8%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites58.3%
Taylor expanded in z around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lift-neg.f64N/A
lift-*.f6438.5
Applied rewrites38.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* y x) (* c b)) z)))
(if (<= z -1.8e+187)
t_1
(if (<= z 2.7e+15)
(+ (* (* i t) b) (* j (- (* c a) (* y i))))
(if (<= z 1.25e+64) (fma (- a) (* x t) (* (- b) (* c z))) 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 = ((y * x) - (c * b)) * z;
double tmp;
if (z <= -1.8e+187) {
tmp = t_1;
} else if (z <= 2.7e+15) {
tmp = ((i * t) * b) + (j * ((c * a) - (y * i)));
} else if (z <= 1.25e+64) {
tmp = fma(-a, (x * t), (-b * (c * z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(y * x) - Float64(c * b)) * z) tmp = 0.0 if (z <= -1.8e+187) tmp = t_1; elseif (z <= 2.7e+15) tmp = Float64(Float64(Float64(i * t) * b) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (z <= 1.25e+64) tmp = fma(Float64(-a), Float64(x * t), Float64(Float64(-b) * Float64(c * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.8e+187], t$95$1, If[LessEqual[z, 2.7e+15], N[(N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+64], N[((-a) * N[(x * t), $MachinePrecision] + N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+15}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(-a, x \cdot t, \left(-b\right) \cdot \left(c \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.80000000000000018e187 or 1.25e64 < z Initial program 62.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.2
Applied rewrites67.2%
if -1.80000000000000018e187 < z < 2.7e15Initial program 78.1%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6455.7
Applied rewrites55.7%
if 2.7e15 < z < 1.25e64Initial program 77.8%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites78.8%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites58.3%
Taylor expanded in z around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lift-neg.f64N/A
lift-*.f6438.5
Applied rewrites38.5%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= i -3.8e+157)
(* (fma (- j) y (* b t)) i)
(if (<= i 4.6e-219)
(- (* (- (* z y) (* a t)) x) (* (* c z) b))
(if (<= i 2300000000000.0)
(* (- (* j a) (* b z)) c)
(* (fma b t (- (* j y))) i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -3.8e+157) {
tmp = fma(-j, y, (b * t)) * i;
} else if (i <= 4.6e-219) {
tmp = (((z * y) - (a * t)) * x) - ((c * z) * b);
} else if (i <= 2300000000000.0) {
tmp = ((j * a) - (b * z)) * c;
} else {
tmp = fma(b, t, -(j * y)) * i;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -3.8e+157) tmp = Float64(fma(Float64(-j), y, Float64(b * t)) * i); elseif (i <= 4.6e-219) tmp = Float64(Float64(Float64(Float64(z * y) - Float64(a * t)) * x) - Float64(Float64(c * z) * b)); elseif (i <= 2300000000000.0) tmp = Float64(Float64(Float64(j * a) - Float64(b * z)) * c); else tmp = Float64(fma(b, t, Float64(-Float64(j * y))) * i); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -3.8e+157], N[(N[((-j) * y + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[i, 4.6e-219], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2300000000000.0], N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(N[(b * t + (-N[(j * y), $MachinePrecision])), $MachinePrecision] * i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -3.8 \cdot 10^{+157}:\\
\;\;\;\;\mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i\\
\mathbf{elif}\;i \leq 4.6 \cdot 10^{-219}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z\right) \cdot b\\
\mathbf{elif}\;i \leq 2300000000000:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, t, -j \cdot y\right) \cdot i\\
\end{array}
\end{array}
if i < -3.8000000000000001e157Initial program 61.4%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.2%
Taylor expanded in i around inf
*-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6469.8
Applied rewrites69.8%
if -3.8000000000000001e157 < i < 4.59999999999999977e-219Initial program 77.5%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.9
Applied rewrites61.9%
Taylor expanded in z around inf
lift-*.f6455.4
Applied rewrites55.4%
if 4.59999999999999977e-219 < i < 2.3e12Initial program 79.7%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6444.3
Applied rewrites44.3%
if 2.3e12 < i Initial program 67.4%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6453.7
Applied rewrites53.7%
Taylor expanded in i around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= y -6.3e+153)
(* (fma (- j) y (* b t)) i)
(if (<= y -4.8e-97)
(fma (- a) (* x t) (* (- b) (* c z)))
(if (<= y 1.32e-23)
(* (- (* j a) (* b z)) c)
(* (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 (y <= -6.3e+153) {
tmp = fma(-j, y, (b * t)) * i;
} else if (y <= -4.8e-97) {
tmp = fma(-a, (x * t), (-b * (c * z)));
} else if (y <= 1.32e-23) {
tmp = ((j * a) - (b * z)) * c;
} 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 (y <= -6.3e+153) tmp = Float64(fma(Float64(-j), y, Float64(b * t)) * i); elseif (y <= -4.8e-97) tmp = fma(Float64(-a), Float64(x * t), Float64(Float64(-b) * Float64(c * z))); elseif (y <= 1.32e-23) tmp = Float64(Float64(Float64(j * a) - Float64(b * z)) * c); 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[LessEqual[y, -6.3e+153], N[(N[((-j) * y + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[y, -4.8e-97], N[((-a) * N[(x * t), $MachinePrecision] + N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.32e-23], N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.3 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-97}:\\
\;\;\;\;\mathsf{fma}\left(-a, x \cdot t, \left(-b\right) \cdot \left(c \cdot z\right)\right)\\
\mathbf{elif}\;y \leq 1.32 \cdot 10^{-23}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\end{array}
\end{array}
if y < -6.3000000000000001e153Initial program 59.2%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.1%
Taylor expanded in i around inf
*-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6448.6
Applied rewrites48.6%
if -6.3000000000000001e153 < y < -4.8e-97Initial program 75.7%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.0%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites58.2%
Taylor expanded in z around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lift-neg.f64N/A
lift-*.f6437.2
Applied rewrites37.2%
if -4.8e-97 < y < 1.31999999999999994e-23Initial program 81.5%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6446.7
Applied rewrites46.7%
if 1.31999999999999994e-23 < y Initial program 66.9%
Taylor expanded in y 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-*.f6458.2
Applied rewrites58.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* c a) (* i y)) j)))
(if (<= j -1.52e+33)
t_1
(if (<= j -2.1e-180)
(* (- (* y x) (* c b)) z)
(if (<= j 3.3e-58) (* (fma (- a) x (* i b)) 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 = ((c * a) - (i * y)) * j;
double tmp;
if (j <= -1.52e+33) {
tmp = t_1;
} else if (j <= -2.1e-180) {
tmp = ((y * x) - (c * b)) * z;
} else if (j <= 3.3e-58) {
tmp = fma(-a, x, (i * b)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(c * a) - Float64(i * y)) * j) tmp = 0.0 if (j <= -1.52e+33) tmp = t_1; elseif (j <= -2.1e-180) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); elseif (j <= 3.3e-58) tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * 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[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -1.52e+33], t$95$1, If[LessEqual[j, -2.1e-180], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[j, 3.3e-58], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{if}\;j \leq -1.52 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq -2.1 \cdot 10^{-180}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{elif}\;j \leq 3.3 \cdot 10^{-58}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -1.5200000000000001e33 or 3.30000000000000026e-58 < j Initial program 73.7%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6458.5
Applied rewrites58.5%
if -1.5200000000000001e33 < j < -2.0999999999999999e-180Initial program 73.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.0
Applied rewrites43.0%
if -2.0999999999999999e-180 < j < 3.30000000000000026e-58Initial program 73.2%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.0%
Taylor expanded in t around inf
*-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/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%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* i t) (* c z)) b))) (if (<= b -1.8e+22) t_1 (if (<= b 4.7e+45) (* (- (* c a) (* i y)) j) 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 = ((i * t) - (c * z)) * b;
double tmp;
if (b <= -1.8e+22) {
tmp = t_1;
} else if (b <= 4.7e+45) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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 = ((i * t) - (c * z)) * b
if (b <= (-1.8d+22)) then
tmp = t_1
else if (b <= 4.7d+45) then
tmp = ((c * a) - (i * y)) * j
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * t) - (c * z)) * b;
double tmp;
if (b <= -1.8e+22) {
tmp = t_1;
} else if (b <= 4.7e+45) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * t) - (c * z)) * b tmp = 0 if b <= -1.8e+22: tmp = t_1 elif b <= 4.7e+45: tmp = ((c * a) - (i * y)) * j else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * t) - Float64(c * z)) * b) tmp = 0.0 if (b <= -1.8e+22) tmp = t_1; elseif (b <= 4.7e+45) tmp = Float64(Float64(Float64(c * a) - Float64(i * y)) * j); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((i * t) - (c * z)) * b; tmp = 0.0; if (b <= -1.8e+22) tmp = t_1; elseif (b <= 4.7e+45) tmp = ((c * a) - (i * y)) * j; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.8e+22], t$95$1, If[LessEqual[b, 4.7e+45], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -1.8 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.7 \cdot 10^{+45}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.8e22 or 4.70000000000000002e45 < b Initial program 73.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6461.8
Applied rewrites61.8%
if -1.8e22 < b < 4.70000000000000002e45Initial program 73.9%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6445.2
Applied rewrites45.2%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= b -7e+76) (* (* i b) t) (if (<= b 4.3e+72) (* (- (* c a) (* i y)) j) (* (- b) (* c z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -7e+76) {
tmp = (i * b) * t;
} else if (b <= 4.3e+72) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = -b * (c * z);
}
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 <= (-7d+76)) then
tmp = (i * b) * t
else if (b <= 4.3d+72) then
tmp = ((c * a) - (i * y)) * j
else
tmp = -b * (c * z)
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 <= -7e+76) {
tmp = (i * b) * t;
} else if (b <= 4.3e+72) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = -b * (c * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -7e+76: tmp = (i * b) * t elif b <= 4.3e+72: tmp = ((c * a) - (i * y)) * j else: tmp = -b * (c * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -7e+76) tmp = Float64(Float64(i * b) * t); elseif (b <= 4.3e+72) tmp = Float64(Float64(Float64(c * a) - Float64(i * y)) * j); else tmp = Float64(Float64(-b) * Float64(c * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -7e+76) tmp = (i * b) * t; elseif (b <= 4.3e+72) tmp = ((c * a) - (i * y)) * j; else tmp = -b * (c * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -7e+76], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, 4.3e+72], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{+76}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\mathbf{elif}\;b \leq 4.3 \cdot 10^{+72}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;\left(-b\right) \cdot \left(c \cdot z\right)\\
\end{array}
\end{array}
if b < -7.00000000000000001e76Initial program 74.7%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.0%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6436.5
Applied rewrites36.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.3
Applied rewrites37.3%
if -7.00000000000000001e76 < b < 4.3000000000000001e72Initial program 73.9%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6444.0
Applied rewrites44.0%
if 4.3000000000000001e72 < b Initial program 71.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6446.5
Applied rewrites46.5%
Taylor expanded in x around 0
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lift-*.f6436.8
Applied rewrites36.8%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= c -1350000000000.0)
(* (- b) (* c z))
(if (<= c 1.7e-241)
(* (* i t) b)
(if (<= c 2.7e+73) (* (* (- t) x) a) (* (* (- b) c) z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (c <= -1350000000000.0) {
tmp = -b * (c * z);
} else if (c <= 1.7e-241) {
tmp = (i * t) * b;
} else if (c <= 2.7e+73) {
tmp = (-t * x) * a;
} else {
tmp = (-b * c) * z;
}
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 (c <= (-1350000000000.0d0)) then
tmp = -b * (c * z)
else if (c <= 1.7d-241) then
tmp = (i * t) * b
else if (c <= 2.7d+73) then
tmp = (-t * x) * a
else
tmp = (-b * c) * z
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 (c <= -1350000000000.0) {
tmp = -b * (c * z);
} else if (c <= 1.7e-241) {
tmp = (i * t) * b;
} else if (c <= 2.7e+73) {
tmp = (-t * x) * a;
} else {
tmp = (-b * c) * z;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if c <= -1350000000000.0: tmp = -b * (c * z) elif c <= 1.7e-241: tmp = (i * t) * b elif c <= 2.7e+73: tmp = (-t * x) * a else: tmp = (-b * c) * z return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (c <= -1350000000000.0) tmp = Float64(Float64(-b) * Float64(c * z)); elseif (c <= 1.7e-241) tmp = Float64(Float64(i * t) * b); elseif (c <= 2.7e+73) tmp = Float64(Float64(Float64(-t) * x) * a); else tmp = Float64(Float64(Float64(-b) * c) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (c <= -1350000000000.0) tmp = -b * (c * z); elseif (c <= 1.7e-241) tmp = (i * t) * b; elseif (c <= 2.7e+73) tmp = (-t * x) * a; else tmp = (-b * c) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[c, -1350000000000.0], N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.7e-241], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[c, 2.7e+73], N[(N[((-t) * x), $MachinePrecision] * a), $MachinePrecision], N[(N[((-b) * c), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1350000000000:\\
\;\;\;\;\left(-b\right) \cdot \left(c \cdot z\right)\\
\mathbf{elif}\;c \leq 1.7 \cdot 10^{-241}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;c \leq 2.7 \cdot 10^{+73}:\\
\;\;\;\;\left(\left(-t\right) \cdot x\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-b\right) \cdot c\right) \cdot z\\
\end{array}
\end{array}
if c < -1.35e12Initial program 68.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6446.4
Applied rewrites46.4%
Taylor expanded in x around 0
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lift-*.f6435.5
Applied rewrites35.5%
if -1.35e12 < c < 1.6999999999999999e-241Initial program 80.6%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites81.3%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites55.3%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6425.5
Applied rewrites25.5%
if 1.6999999999999999e-241 < c < 2.6999999999999999e73Initial program 78.3%
Taylor expanded in a 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.7
Applied rewrites34.7%
Taylor expanded in x around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lower-*.f6424.6
Applied rewrites24.6%
if 2.6999999999999999e73 < c Initial program 62.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6446.3
Applied rewrites46.3%
Taylor expanded in x around 0
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6436.7
Applied rewrites36.7%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= b -95000000000.0) (* (* i b) t) (if (<= b 7.5e+27) (* (* (- a) t) x) (* (- b) (* c z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -95000000000.0) {
tmp = (i * b) * t;
} else if (b <= 7.5e+27) {
tmp = (-a * t) * x;
} else {
tmp = -b * (c * z);
}
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 <= (-95000000000.0d0)) then
tmp = (i * b) * t
else if (b <= 7.5d+27) then
tmp = (-a * t) * x
else
tmp = -b * (c * z)
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 <= -95000000000.0) {
tmp = (i * b) * t;
} else if (b <= 7.5e+27) {
tmp = (-a * t) * x;
} else {
tmp = -b * (c * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -95000000000.0: tmp = (i * b) * t elif b <= 7.5e+27: tmp = (-a * t) * x else: tmp = -b * (c * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -95000000000.0) tmp = Float64(Float64(i * b) * t); elseif (b <= 7.5e+27) tmp = Float64(Float64(Float64(-a) * t) * x); else tmp = Float64(Float64(-b) * Float64(c * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -95000000000.0) tmp = (i * b) * t; elseif (b <= 7.5e+27) tmp = (-a * t) * x; else tmp = -b * (c * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -95000000000.0], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, 7.5e+27], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -95000000000:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\mathbf{elif}\;b \leq 7.5 \cdot 10^{+27}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(-b\right) \cdot \left(c \cdot z\right)\\
\end{array}
\end{array}
if b < -9.5e10Initial program 74.5%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.5%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6433.0
Applied rewrites33.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6433.5
Applied rewrites33.5%
if -9.5e10 < b < 7.5000000000000002e27Initial program 73.9%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.8
Applied rewrites45.8%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6424.9
Applied rewrites24.9%
if 7.5000000000000002e27 < b Initial program 71.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.4
Applied rewrites45.4%
Taylor expanded in x around 0
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lift-*.f6434.8
Applied rewrites34.8%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= b -95000000000.0) (* (* i b) t) (if (<= b 7e+27) (* (* (- a) x) t) (* (- b) (* c z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -95000000000.0) {
tmp = (i * b) * t;
} else if (b <= 7e+27) {
tmp = (-a * x) * t;
} else {
tmp = -b * (c * z);
}
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 <= (-95000000000.0d0)) then
tmp = (i * b) * t
else if (b <= 7d+27) then
tmp = (-a * x) * t
else
tmp = -b * (c * z)
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 <= -95000000000.0) {
tmp = (i * b) * t;
} else if (b <= 7e+27) {
tmp = (-a * x) * t;
} else {
tmp = -b * (c * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -95000000000.0: tmp = (i * b) * t elif b <= 7e+27: tmp = (-a * x) * t else: tmp = -b * (c * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -95000000000.0) tmp = Float64(Float64(i * b) * t); elseif (b <= 7e+27) tmp = Float64(Float64(Float64(-a) * x) * t); else tmp = Float64(Float64(-b) * Float64(c * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -95000000000.0) tmp = (i * b) * t; elseif (b <= 7e+27) tmp = (-a * x) * t; else tmp = -b * (c * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -95000000000.0], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, 7e+27], N[(N[((-a) * x), $MachinePrecision] * t), $MachinePrecision], N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -95000000000:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\mathbf{elif}\;b \leq 7 \cdot 10^{+27}:\\
\;\;\;\;\left(\left(-a\right) \cdot x\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(-b\right) \cdot \left(c \cdot z\right)\\
\end{array}
\end{array}
if b < -9.5e10Initial program 74.5%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.5%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6433.0
Applied rewrites33.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6433.5
Applied rewrites33.5%
if -9.5e10 < b < 7.0000000000000004e27Initial program 73.9%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.8
Applied rewrites45.8%
Taylor expanded in y around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
associate-*r*N/A
lift-neg.f64N/A
mul-1-negN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6425.1
Applied rewrites25.1%
if 7.0000000000000004e27 < b Initial program 71.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.4
Applied rewrites45.4%
Taylor expanded in x around 0
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lift-*.f6434.8
Applied rewrites34.8%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- b) (* c z)))) (if (<= c -1350000000000.0) t_1 (if (<= c 1.8e+83) (* (* i t) b) 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 = -b * (c * z);
double tmp;
if (c <= -1350000000000.0) {
tmp = t_1;
} else if (c <= 1.8e+83) {
tmp = (i * t) * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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 = -b * (c * z)
if (c <= (-1350000000000.0d0)) then
tmp = t_1
else if (c <= 1.8d+83) then
tmp = (i * t) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -b * (c * z);
double tmp;
if (c <= -1350000000000.0) {
tmp = t_1;
} else if (c <= 1.8e+83) {
tmp = (i * t) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = -b * (c * z) tmp = 0 if c <= -1350000000000.0: tmp = t_1 elif c <= 1.8e+83: tmp = (i * t) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-b) * Float64(c * z)) tmp = 0.0 if (c <= -1350000000000.0) tmp = t_1; elseif (c <= 1.8e+83) tmp = Float64(Float64(i * t) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = -b * (c * z); tmp = 0.0; if (c <= -1350000000000.0) tmp = t_1; elseif (c <= 1.8e+83) tmp = (i * t) * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1350000000000.0], t$95$1, If[LessEqual[c, 1.8e+83], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-b\right) \cdot \left(c \cdot z\right)\\
\mathbf{if}\;c \leq -1350000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 1.8 \cdot 10^{+83}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.35e12 or 1.7999999999999999e83 < c Initial program 65.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6446.5
Applied rewrites46.5%
Taylor expanded in x around 0
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lift-*.f6436.3
Applied rewrites36.3%
if -1.35e12 < c < 1.7999999999999999e83Initial program 79.4%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.0%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.9%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6425.0
Applied rewrites25.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -1.05e-108)
(* i (* b t))
(if (<= t 8e-129)
(* (* j c) a)
(if (<= t 1.66e-38) (* y (* x z)) (* (* i t) b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.05e-108) {
tmp = i * (b * t);
} else if (t <= 8e-129) {
tmp = (j * c) * a;
} else if (t <= 1.66e-38) {
tmp = y * (x * z);
} else {
tmp = (i * t) * b;
}
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 (t <= (-1.05d-108)) then
tmp = i * (b * t)
else if (t <= 8d-129) then
tmp = (j * c) * a
else if (t <= 1.66d-38) then
tmp = y * (x * z)
else
tmp = (i * t) * b
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 (t <= -1.05e-108) {
tmp = i * (b * t);
} else if (t <= 8e-129) {
tmp = (j * c) * a;
} else if (t <= 1.66e-38) {
tmp = y * (x * z);
} else {
tmp = (i * t) * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -1.05e-108: tmp = i * (b * t) elif t <= 8e-129: tmp = (j * c) * a elif t <= 1.66e-38: tmp = y * (x * z) else: tmp = (i * t) * b return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -1.05e-108) tmp = Float64(i * Float64(b * t)); elseif (t <= 8e-129) tmp = Float64(Float64(j * c) * a); elseif (t <= 1.66e-38) tmp = Float64(y * Float64(x * z)); else tmp = Float64(Float64(i * t) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -1.05e-108) tmp = i * (b * t); elseif (t <= 8e-129) tmp = (j * c) * a; elseif (t <= 1.66e-38) tmp = y * (x * z); else tmp = (i * t) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.05e-108], N[(i * N[(b * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8e-129], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 1.66e-38], N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-108}:\\
\;\;\;\;i \cdot \left(b \cdot t\right)\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-129}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{elif}\;t \leq 1.66 \cdot 10^{-38}:\\
\;\;\;\;y \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\end{array}
\end{array}
if t < -1.05e-108Initial program 70.1%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.3%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.0%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6428.7
Applied rewrites28.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6428.2
Applied rewrites28.2%
if -1.05e-108 < t < 7.9999999999999994e-129Initial program 79.7%
Taylor expanded in a 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-*.f6430.9
Applied rewrites30.9%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6425.9
Applied rewrites25.9%
if 7.9999999999999994e-129 < t < 1.66000000000000006e-38Initial program 81.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.7
Applied rewrites43.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6424.6
Applied rewrites24.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6425.6
Applied rewrites25.6%
if 1.66000000000000006e-38 < t Initial program 68.8%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites70.2%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.6%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6431.7
Applied rewrites31.7%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= z -5.5e+91) (* (* y z) x) (if (<= z 1.15e+20) (* (* i b) t) (* y (* x z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -5.5e+91) {
tmp = (y * z) * x;
} else if (z <= 1.15e+20) {
tmp = (i * b) * t;
} else {
tmp = y * (x * z);
}
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 <= (-5.5d+91)) then
tmp = (y * z) * x
else if (z <= 1.15d+20) then
tmp = (i * b) * t
else
tmp = y * (x * z)
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 <= -5.5e+91) {
tmp = (y * z) * x;
} else if (z <= 1.15e+20) {
tmp = (i * b) * t;
} else {
tmp = y * (x * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -5.5e+91: tmp = (y * z) * x elif z <= 1.15e+20: tmp = (i * b) * t else: tmp = y * (x * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -5.5e+91) tmp = Float64(Float64(y * z) * x); elseif (z <= 1.15e+20) tmp = Float64(Float64(i * b) * t); else tmp = Float64(y * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -5.5e+91) tmp = (y * z) * x; elseif (z <= 1.15e+20) tmp = (i * b) * t; else tmp = y * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -5.5e+91], N[(N[(y * z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.15e+20], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+91}:\\
\;\;\;\;\left(y \cdot z\right) \cdot x\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+20}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -5.4999999999999998e91Initial program 62.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6466.9
Applied rewrites66.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -5.4999999999999998e91 < z < 1.15e20Initial program 79.4%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.1%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.1%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6425.5
Applied rewrites25.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6424.7
Applied rewrites24.7%
if 1.15e20 < z Initial program 67.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6460.1
Applied rewrites60.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6435.3
Applied rewrites35.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* y (* x z)))) (if (<= z -5.5e+91) t_1 (if (<= z 1.15e+20) (* (* i b) 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 = y * (x * z);
double tmp;
if (z <= -5.5e+91) {
tmp = t_1;
} else if (z <= 1.15e+20) {
tmp = (i * b) * t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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 = y * (x * z)
if (z <= (-5.5d+91)) then
tmp = t_1
else if (z <= 1.15d+20) then
tmp = (i * b) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = y * (x * z);
double tmp;
if (z <= -5.5e+91) {
tmp = t_1;
} else if (z <= 1.15e+20) {
tmp = (i * b) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = y * (x * z) tmp = 0 if z <= -5.5e+91: tmp = t_1 elif z <= 1.15e+20: tmp = (i * b) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(y * Float64(x * z)) tmp = 0.0 if (z <= -5.5e+91) tmp = t_1; elseif (z <= 1.15e+20) tmp = Float64(Float64(i * b) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = y * (x * z); tmp = 0.0; if (z <= -5.5e+91) tmp = t_1; elseif (z <= 1.15e+20) tmp = (i * b) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+91], t$95$1, If[LessEqual[z, 1.15e+20], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+20}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.4999999999999998e91 or 1.15e20 < z Initial program 65.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.1
Applied rewrites63.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6436.9
Applied rewrites36.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6436.5
Applied rewrites36.5%
if -5.4999999999999998e91 < z < 1.15e20Initial program 79.4%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.1%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.1%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6425.5
Applied rewrites25.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6424.7
Applied rewrites24.7%
(FPCore (x y z t a b c i j) :precision binary64 (* (* i t) b))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (i * t) * b;
}
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 = (i * t) * b
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 (i * t) * b;
}
def code(x, y, z, t, a, b, c, i, j): return (i * t) * b
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(i * t) * b) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (i * t) * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]
\begin{array}{l}
\\
\left(i \cdot t\right) \cdot b
\end{array}
Initial program 73.5%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.6%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6421.7
Applied rewrites21.7%
(FPCore (x y z t a b c i j) :precision binary64 (* (* i b) t))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (i * b) * t;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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 = (i * b) * t
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (i * b) * t;
}
def code(x, y, z, t, a, b, c, i, j): return (i * b) * t
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(i * b) * t) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (i * b) * t; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\left(i \cdot b\right) \cdot t
\end{array}
Initial program 73.5%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.6%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6421.7
Applied rewrites21.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.5
Applied rewrites21.5%
(FPCore (x y z t a b c i j) :precision binary64 (* i (* b t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return i * (b * t);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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 = i * (b * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return i * (b * t);
}
def code(x, y, z, t, a, b, c, i, j): return i * (b * t)
function code(x, y, z, t, a, b, c, i, j) return Float64(i * Float64(b * t)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = i * (b * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(i * N[(b * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
i \cdot \left(b \cdot t\right)
\end{array}
Initial program 73.5%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.6%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6421.7
Applied rewrites21.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6421.7
Applied rewrites21.7%
herbie shell --seed 2025119
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))