
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) y (* c t)) j)))
(if (<=
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))
INFINITY)
(fma (fma i a (* (- c) z)) b (fma (fma z y (* (- t) a)) x t_1))
(fma (* b a) i t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, y, (c * t)) * j;
double tmp;
if ((((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))) <= ((double) INFINITY)) {
tmp = fma(fma(i, a, (-c * z)), b, fma(fma(z, y, (-t * a)), x, t_1));
} else {
tmp = fma((b * a), i, t_1);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), y, Float64(c * t)) * j) tmp = 0.0 if (Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) <= Inf) tmp = fma(fma(i, a, Float64(Float64(-c) * z)), b, fma(fma(z, y, Float64(Float64(-t) * a)), x, t_1)); else tmp = fma(Float64(b * a), i, t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $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[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b + N[(N[(z * y + N[((-t) * a), $MachinePrecision]), $MachinePrecision] * x + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(b * a), $MachinePrecision] * i + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\
\mathbf{if}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right), b, \mathsf{fma}\left(\mathsf{fma}\left(z, y, \left(-t\right) \cdot a\right), x, t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot a, i, t\_1\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 91.8%
Taylor expanded in b around 0
Applied rewrites91.8%
lift-neg.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
distribute-lft-neg-outN/A
mul-1-negN/A
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6491.8
Applied rewrites91.8%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 0.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites35.6%
Taylor expanded in z around 0
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lift-fma.f64N/A
lift-neg.f64N/A
lift-*.f6445.3
Applied rewrites45.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (* b a) i (* (fma (- i) y (* c t)) j))))
(if (<= j -3.2e+71)
t_1
(if (<= j 1e+48)
(fma
(fma i a (* (- c) z))
b
(fma (fma z y (* (- t) a)) x (* (* c t) 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 = fma((b * a), i, (fma(-i, y, (c * t)) * j));
double tmp;
if (j <= -3.2e+71) {
tmp = t_1;
} else if (j <= 1e+48) {
tmp = fma(fma(i, a, (-c * z)), b, fma(fma(z, y, (-t * a)), x, ((c * t) * j)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(b * a), i, Float64(fma(Float64(-i), y, Float64(c * t)) * j)) tmp = 0.0 if (j <= -3.2e+71) tmp = t_1; elseif (j <= 1e+48) tmp = fma(fma(i, a, Float64(Float64(-c) * z)), b, fma(fma(z, y, Float64(Float64(-t) * a)), x, Float64(Float64(c * t) * j))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * i + N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -3.2e+71], t$95$1, If[LessEqual[j, 1e+48], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b + N[(N[(z * y + N[((-t) * a), $MachinePrecision]), $MachinePrecision] * x + N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b \cdot a, i, \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\right)\\
\mathbf{if}\;j \leq -3.2 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 10^{+48}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right), b, \mathsf{fma}\left(\mathsf{fma}\left(z, y, \left(-t\right) \cdot a\right), x, \left(c \cdot t\right) \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -3.20000000000000023e71 or 1.00000000000000004e48 < j Initial program 73.6%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites73.3%
Taylor expanded in z around 0
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lift-fma.f64N/A
lift-neg.f64N/A
lift-*.f6469.7
Applied rewrites69.7%
if -3.20000000000000023e71 < j < 1.00000000000000004e48Initial program 73.9%
Taylor expanded in b around 0
Applied rewrites76.3%
lift-neg.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
distribute-lft-neg-outN/A
mul-1-negN/A
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6476.2
Applied rewrites76.2%
Taylor expanded in y around 0
lift-*.f6473.5
Applied rewrites73.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (* b a) i (* (fma (- i) y (* c t)) j))))
(if (<= j -5.2e+67)
t_1
(if (<= j -6.2e-173)
(* (fma y x (* (- b) c)) z)
(if (<= j 1.6e-302)
(* (fma (- t) x (* i b)) a)
(if (<= j 6.6e+44) (* (fma (- a) t (* z y)) x) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma((b * a), i, (fma(-i, y, (c * t)) * j));
double tmp;
if (j <= -5.2e+67) {
tmp = t_1;
} else if (j <= -6.2e-173) {
tmp = fma(y, x, (-b * c)) * z;
} else if (j <= 1.6e-302) {
tmp = fma(-t, x, (i * b)) * a;
} else if (j <= 6.6e+44) {
tmp = fma(-a, t, (z * y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(b * a), i, Float64(fma(Float64(-i), y, Float64(c * t)) * j)) tmp = 0.0 if (j <= -5.2e+67) tmp = t_1; elseif (j <= -6.2e-173) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); elseif (j <= 1.6e-302) tmp = Float64(fma(Float64(-t), x, Float64(i * b)) * a); elseif (j <= 6.6e+44) tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * i + N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -5.2e+67], t$95$1, If[LessEqual[j, -6.2e-173], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[j, 1.6e-302], N[(N[((-t) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[j, 6.6e+44], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b \cdot a, i, \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\right)\\
\mathbf{if}\;j \leq -5.2 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq -6.2 \cdot 10^{-173}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{elif}\;j \leq 1.6 \cdot 10^{-302}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, i \cdot b\right) \cdot a\\
\mathbf{elif}\;j \leq 6.6 \cdot 10^{+44}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -5.2000000000000001e67 or 6.60000000000000027e44 < j Initial program 73.5%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites73.2%
Taylor expanded in z around 0
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lift-fma.f64N/A
lift-neg.f64N/A
lift-*.f6469.4
Applied rewrites69.4%
if -5.2000000000000001e67 < j < -6.20000000000000011e-173Initial program 75.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6442.9
Applied rewrites42.9%
if -6.20000000000000011e-173 < j < 1.59999999999999989e-302Initial program 74.6%
Taylor expanded in b around 0
Applied rewrites76.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6447.5
Applied rewrites47.5%
if 1.59999999999999989e-302 < j < 6.60000000000000027e44Initial program 72.8%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6443.1
Applied rewrites43.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (* b a) i (* (fma (- i) y (* c t)) j))))
(if (<= j -7.5e+69)
t_1
(if (<= j 6.5e+45)
(fma (fma (- a) t (* z y)) x (* (- b) (fma (- a) i (* 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 = fma((b * a), i, (fma(-i, y, (c * t)) * j));
double tmp;
if (j <= -7.5e+69) {
tmp = t_1;
} else if (j <= 6.5e+45) {
tmp = fma(fma(-a, t, (z * y)), x, (-b * fma(-a, i, (c * z))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(b * a), i, Float64(fma(Float64(-i), y, Float64(c * t)) * j)) tmp = 0.0 if (j <= -7.5e+69) tmp = t_1; elseif (j <= 6.5e+45) tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(-b) * fma(Float64(-a), i, 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[(b * a), $MachinePrecision] * i + N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -7.5e+69], t$95$1, If[LessEqual[j, 6.5e+45], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * N[((-a) * i + N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b \cdot a, i, \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\right)\\
\mathbf{if}\;j \leq -7.5 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 6.5 \cdot 10^{+45}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-a, i, c \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -7.49999999999999939e69 or 6.50000000000000034e45 < j Initial program 73.6%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites73.2%
Taylor expanded in z around 0
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lift-fma.f64N/A
lift-neg.f64N/A
lift-*.f6469.5
Applied rewrites69.5%
if -7.49999999999999939e69 < j < 6.50000000000000034e45Initial program 73.9%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i a (* (- c) z)) b)) (t_2 (* (fma (- a) t (* z y)) x)))
(if (<= x -1.8e+85)
t_2
(if (<= x -6.6e-263)
(* (fma j t (* (- b) z)) c)
(if (<= x 2e-304)
t_1
(if (<= x 21000.0)
(* (fma (- b) z (* j t)) c)
(if (<= x 1e+88) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(i, a, (-c * z)) * b;
double t_2 = fma(-a, t, (z * y)) * x;
double tmp;
if (x <= -1.8e+85) {
tmp = t_2;
} else if (x <= -6.6e-263) {
tmp = fma(j, t, (-b * z)) * c;
} else if (x <= 2e-304) {
tmp = t_1;
} else if (x <= 21000.0) {
tmp = fma(-b, z, (j * t)) * c;
} else if (x <= 1e+88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(i, a, Float64(Float64(-c) * z)) * b) t_2 = Float64(fma(Float64(-a), t, Float64(z * y)) * x) tmp = 0.0 if (x <= -1.8e+85) tmp = t_2; elseif (x <= -6.6e-263) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (x <= 2e-304) tmp = t_1; elseif (x <= 21000.0) tmp = Float64(fma(Float64(-b), z, Float64(j * t)) * c); elseif (x <= 1e+88) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.8e+85], t$95$2, If[LessEqual[x, -6.6e-263], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 2e-304], t$95$1, If[LessEqual[x, 21000.0], N[(N[((-b) * z + N[(j * t), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 1e+88], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
t_2 := \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -1.8 \cdot 10^{+85}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -6.6 \cdot 10^{-263}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-304}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 21000:\\
\;\;\;\;\mathsf{fma}\left(-b, z, j \cdot t\right) \cdot c\\
\mathbf{elif}\;x \leq 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -1.7999999999999999e85 or 9.99999999999999959e87 < x Initial program 73.3%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6466.4
Applied rewrites66.4%
if -1.7999999999999999e85 < x < -6.5999999999999994e-263Initial program 75.0%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6443.1
Applied rewrites43.1%
if -6.5999999999999994e-263 < x < 1.99999999999999994e-304 or 21000 < x < 9.99999999999999959e87Initial program 74.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6440.9
Applied rewrites40.9%
if 1.99999999999999994e-304 < x < 21000Initial program 72.8%
Taylor expanded in b around 0
Applied rewrites75.0%
Taylor expanded in c around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma y x (* (- b) c)) z)))
(if (<= j -3.4e+71)
(* (- i) (* j y))
(if (<= j -1.85e-172)
t_1
(if (<= j 5.8e-303)
(* (fma i a (* (- c) z)) b)
(if (<= j 2.15e+46)
t_1
(if (<= j 3.4e+81)
(* (fma j t (* (- b) z)) c)
(* (* (- i) j) y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(y, x, (-b * c)) * z;
double tmp;
if (j <= -3.4e+71) {
tmp = -i * (j * y);
} else if (j <= -1.85e-172) {
tmp = t_1;
} else if (j <= 5.8e-303) {
tmp = fma(i, a, (-c * z)) * b;
} else if (j <= 2.15e+46) {
tmp = t_1;
} else if (j <= 3.4e+81) {
tmp = fma(j, t, (-b * z)) * c;
} else {
tmp = (-i * j) * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(y, x, Float64(Float64(-b) * c)) * z) tmp = 0.0 if (j <= -3.4e+71) tmp = Float64(Float64(-i) * Float64(j * y)); elseif (j <= -1.85e-172) tmp = t_1; elseif (j <= 5.8e-303) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); elseif (j <= 2.15e+46) tmp = t_1; elseif (j <= 3.4e+81) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); else tmp = Float64(Float64(Float64(-i) * j) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[j, -3.4e+71], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -1.85e-172], t$95$1, If[LessEqual[j, 5.8e-303], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[j, 2.15e+46], t$95$1, If[LessEqual[j, 3.4e+81], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{if}\;j \leq -3.4 \cdot 10^{+71}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\
\mathbf{elif}\;j \leq -1.85 \cdot 10^{-172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 5.8 \cdot 10^{-303}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;j \leq 2.15 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 3.4 \cdot 10^{+81}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\end{array}
\end{array}
if j < -3.3999999999999998e71Initial program 74.6%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6448.4
Applied rewrites48.4%
Taylor expanded in y around inf
lower-*.f6439.3
Applied rewrites39.3%
if -3.3999999999999998e71 < j < -1.85e-172 or 5.80000000000000028e-303 < j < 2.15000000000000002e46Initial program 73.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6444.3
Applied rewrites44.3%
if -1.85e-172 < j < 5.80000000000000028e-303Initial program 74.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6450.5
Applied rewrites50.5%
if 2.15000000000000002e46 < j < 3.40000000000000003e81Initial program 73.4%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6441.7
Applied rewrites41.7%
if 3.40000000000000003e81 < j Initial program 72.6%
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-*.f6447.7
Applied rewrites47.7%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6439.0
Applied rewrites39.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (* b a) i (* (fma (- i) y (* c t)) j))))
(if (<= j -7.2e+69)
t_1
(if (<= j 1.05e-259)
(fma (fma i a (* (- c) z)) b (* (* y x) z))
(if (<= j 6.6e+44) (* (fma (- a) t (* z y)) x) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma((b * a), i, (fma(-i, y, (c * t)) * j));
double tmp;
if (j <= -7.2e+69) {
tmp = t_1;
} else if (j <= 1.05e-259) {
tmp = fma(fma(i, a, (-c * z)), b, ((y * x) * z));
} else if (j <= 6.6e+44) {
tmp = fma(-a, t, (z * y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(b * a), i, Float64(fma(Float64(-i), y, Float64(c * t)) * j)) tmp = 0.0 if (j <= -7.2e+69) tmp = t_1; elseif (j <= 1.05e-259) tmp = fma(fma(i, a, Float64(Float64(-c) * z)), b, Float64(Float64(y * x) * z)); elseif (j <= 6.6e+44) tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * i + N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -7.2e+69], t$95$1, If[LessEqual[j, 1.05e-259], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b + N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 6.6e+44], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b \cdot a, i, \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\right)\\
\mathbf{if}\;j \leq -7.2 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.05 \cdot 10^{-259}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right), b, \left(y \cdot x\right) \cdot z\right)\\
\mathbf{elif}\;j \leq 6.6 \cdot 10^{+44}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -7.2000000000000005e69 or 6.60000000000000027e44 < j Initial program 73.6%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites73.2%
Taylor expanded in z around 0
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lift-fma.f64N/A
lift-neg.f64N/A
lift-*.f6469.4
Applied rewrites69.4%
if -7.2000000000000005e69 < j < 1.04999999999999999e-259Initial program 74.4%
Taylor expanded in b around 0
Applied rewrites76.6%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6460.9
Applied rewrites60.9%
if 1.04999999999999999e-259 < j < 6.60000000000000027e44Initial program 73.1%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6442.6
Applied rewrites42.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* i a) b)) (t_2 (* (* z x) y)))
(if (<= x -6.2e+26)
t_2
(if (<= x -2.55e-108)
t_1
(if (<= x -5e-187)
(* (* j c) t)
(if (<= x 1.55e-134)
(- (* c (* b z)))
(if (<= x 21000.0) (* (* j t) c) (if (<= x 1e+88) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * a) * b;
double t_2 = (z * x) * y;
double tmp;
if (x <= -6.2e+26) {
tmp = t_2;
} else if (x <= -2.55e-108) {
tmp = t_1;
} else if (x <= -5e-187) {
tmp = (j * c) * t;
} else if (x <= 1.55e-134) {
tmp = -(c * (b * z));
} else if (x <= 21000.0) {
tmp = (j * t) * c;
} else if (x <= 1e+88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (i * a) * b
t_2 = (z * x) * y
if (x <= (-6.2d+26)) then
tmp = t_2
else if (x <= (-2.55d-108)) then
tmp = t_1
else if (x <= (-5d-187)) then
tmp = (j * c) * t
else if (x <= 1.55d-134) then
tmp = -(c * (b * z))
else if (x <= 21000.0d0) then
tmp = (j * t) * c
else if (x <= 1d+88) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * a) * b;
double t_2 = (z * x) * y;
double tmp;
if (x <= -6.2e+26) {
tmp = t_2;
} else if (x <= -2.55e-108) {
tmp = t_1;
} else if (x <= -5e-187) {
tmp = (j * c) * t;
} else if (x <= 1.55e-134) {
tmp = -(c * (b * z));
} else if (x <= 21000.0) {
tmp = (j * t) * c;
} else if (x <= 1e+88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (i * a) * b t_2 = (z * x) * y tmp = 0 if x <= -6.2e+26: tmp = t_2 elif x <= -2.55e-108: tmp = t_1 elif x <= -5e-187: tmp = (j * c) * t elif x <= 1.55e-134: tmp = -(c * (b * z)) elif x <= 21000.0: tmp = (j * t) * c elif x <= 1e+88: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * a) * b) t_2 = Float64(Float64(z * x) * y) tmp = 0.0 if (x <= -6.2e+26) tmp = t_2; elseif (x <= -2.55e-108) tmp = t_1; elseif (x <= -5e-187) tmp = Float64(Float64(j * c) * t); elseif (x <= 1.55e-134) tmp = Float64(-Float64(c * Float64(b * z))); elseif (x <= 21000.0) tmp = Float64(Float64(j * t) * c); elseif (x <= 1e+88) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (i * a) * b; t_2 = (z * x) * y; tmp = 0.0; if (x <= -6.2e+26) tmp = t_2; elseif (x <= -2.55e-108) tmp = t_1; elseif (x <= -5e-187) tmp = (j * c) * t; elseif (x <= 1.55e-134) tmp = -(c * (b * z)); elseif (x <= 21000.0) tmp = (j * t) * c; elseif (x <= 1e+88) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[x, -6.2e+26], t$95$2, If[LessEqual[x, -2.55e-108], t$95$1, If[LessEqual[x, -5e-187], N[(N[(j * c), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[x, 1.55e-134], (-N[(c * N[(b * z), $MachinePrecision]), $MachinePrecision]), If[LessEqual[x, 21000.0], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 1e+88], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot a\right) \cdot b\\
t_2 := \left(z \cdot x\right) \cdot y\\
\mathbf{if}\;x \leq -6.2 \cdot 10^{+26}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -2.55 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-187}:\\
\;\;\;\;\left(j \cdot c\right) \cdot t\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-134}:\\
\;\;\;\;-c \cdot \left(b \cdot z\right)\\
\mathbf{elif}\;x \leq 21000:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\mathbf{elif}\;x \leq 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -6.1999999999999999e26 or 9.99999999999999959e87 < x Initial program 73.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-*.f6447.0
Applied rewrites47.0%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6436.0
Applied rewrites36.0%
if -6.1999999999999999e26 < x < -2.5500000000000001e-108 or 21000 < x < 9.99999999999999959e87Initial program 77.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6440.9
Applied rewrites40.9%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f6422.8
Applied rewrites22.8%
if -2.5500000000000001e-108 < x < -4.9999999999999996e-187Initial program 71.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6431.6
Applied rewrites31.6%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6426.3
Applied rewrites26.3%
if -4.9999999999999996e-187 < x < 1.55000000000000003e-134Initial program 71.5%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites76.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6427.8
Applied rewrites27.8%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6427.1
Applied rewrites27.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6426.5
Applied rewrites26.5%
if 1.55000000000000003e-134 < x < 21000Initial program 74.8%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites67.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6423.8
Applied rewrites23.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* i a) b)) (t_2 (* (* z x) y)))
(if (<= x -6.2e+26)
t_2
(if (<= x -2.55e-108)
t_1
(if (<= x -5e-243)
(* (* j c) t)
(if (<= x 2e-304)
t_1
(if (<= x 21000.0) (* (* j t) c) (if (<= x 1e+88) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * a) * b;
double t_2 = (z * x) * y;
double tmp;
if (x <= -6.2e+26) {
tmp = t_2;
} else if (x <= -2.55e-108) {
tmp = t_1;
} else if (x <= -5e-243) {
tmp = (j * c) * t;
} else if (x <= 2e-304) {
tmp = t_1;
} else if (x <= 21000.0) {
tmp = (j * t) * c;
} else if (x <= 1e+88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (i * a) * b
t_2 = (z * x) * y
if (x <= (-6.2d+26)) then
tmp = t_2
else if (x <= (-2.55d-108)) then
tmp = t_1
else if (x <= (-5d-243)) then
tmp = (j * c) * t
else if (x <= 2d-304) then
tmp = t_1
else if (x <= 21000.0d0) then
tmp = (j * t) * c
else if (x <= 1d+88) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * a) * b;
double t_2 = (z * x) * y;
double tmp;
if (x <= -6.2e+26) {
tmp = t_2;
} else if (x <= -2.55e-108) {
tmp = t_1;
} else if (x <= -5e-243) {
tmp = (j * c) * t;
} else if (x <= 2e-304) {
tmp = t_1;
} else if (x <= 21000.0) {
tmp = (j * t) * c;
} else if (x <= 1e+88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (i * a) * b t_2 = (z * x) * y tmp = 0 if x <= -6.2e+26: tmp = t_2 elif x <= -2.55e-108: tmp = t_1 elif x <= -5e-243: tmp = (j * c) * t elif x <= 2e-304: tmp = t_1 elif x <= 21000.0: tmp = (j * t) * c elif x <= 1e+88: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * a) * b) t_2 = Float64(Float64(z * x) * y) tmp = 0.0 if (x <= -6.2e+26) tmp = t_2; elseif (x <= -2.55e-108) tmp = t_1; elseif (x <= -5e-243) tmp = Float64(Float64(j * c) * t); elseif (x <= 2e-304) tmp = t_1; elseif (x <= 21000.0) tmp = Float64(Float64(j * t) * c); elseif (x <= 1e+88) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (i * a) * b; t_2 = (z * x) * y; tmp = 0.0; if (x <= -6.2e+26) tmp = t_2; elseif (x <= -2.55e-108) tmp = t_1; elseif (x <= -5e-243) tmp = (j * c) * t; elseif (x <= 2e-304) tmp = t_1; elseif (x <= 21000.0) tmp = (j * t) * c; elseif (x <= 1e+88) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[x, -6.2e+26], t$95$2, If[LessEqual[x, -2.55e-108], t$95$1, If[LessEqual[x, -5e-243], N[(N[(j * c), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[x, 2e-304], t$95$1, If[LessEqual[x, 21000.0], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 1e+88], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot a\right) \cdot b\\
t_2 := \left(z \cdot x\right) \cdot y\\
\mathbf{if}\;x \leq -6.2 \cdot 10^{+26}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -2.55 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-243}:\\
\;\;\;\;\left(j \cdot c\right) \cdot t\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-304}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 21000:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\mathbf{elif}\;x \leq 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -6.1999999999999999e26 or 9.99999999999999959e87 < x Initial program 73.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-*.f6447.0
Applied rewrites47.0%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6436.0
Applied rewrites36.0%
if -6.1999999999999999e26 < x < -2.5500000000000001e-108 or -5e-243 < x < 1.99999999999999994e-304 or 21000 < x < 9.99999999999999959e87Initial program 75.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6442.3
Applied rewrites42.3%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f6423.9
Applied rewrites23.9%
if -2.5500000000000001e-108 < x < -5e-243Initial program 72.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6430.7
Applied rewrites30.7%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6425.6
Applied rewrites25.6%
if 1.99999999999999994e-304 < x < 21000Initial program 72.8%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites72.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6424.6
Applied rewrites24.6%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -6.5e+70)
(* (- i) (* j y))
(if (<= j -3.2e-180)
(* (* z x) y)
(if (<= j 1.55e-302)
(* (* i b) a)
(if (<= j 3.5e+49)
(* (* z y) x)
(if (<= j 1.2e+81) (* (* c t) j) (* (* (- i) j) y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -6.5e+70) {
tmp = -i * (j * y);
} else if (j <= -3.2e-180) {
tmp = (z * x) * y;
} else if (j <= 1.55e-302) {
tmp = (i * b) * a;
} else if (j <= 3.5e+49) {
tmp = (z * y) * x;
} else if (j <= 1.2e+81) {
tmp = (c * t) * j;
} else {
tmp = (-i * j) * y;
}
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 (j <= (-6.5d+70)) then
tmp = -i * (j * y)
else if (j <= (-3.2d-180)) then
tmp = (z * x) * y
else if (j <= 1.55d-302) then
tmp = (i * b) * a
else if (j <= 3.5d+49) then
tmp = (z * y) * x
else if (j <= 1.2d+81) then
tmp = (c * t) * j
else
tmp = (-i * j) * y
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 (j <= -6.5e+70) {
tmp = -i * (j * y);
} else if (j <= -3.2e-180) {
tmp = (z * x) * y;
} else if (j <= 1.55e-302) {
tmp = (i * b) * a;
} else if (j <= 3.5e+49) {
tmp = (z * y) * x;
} else if (j <= 1.2e+81) {
tmp = (c * t) * j;
} else {
tmp = (-i * j) * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -6.5e+70: tmp = -i * (j * y) elif j <= -3.2e-180: tmp = (z * x) * y elif j <= 1.55e-302: tmp = (i * b) * a elif j <= 3.5e+49: tmp = (z * y) * x elif j <= 1.2e+81: tmp = (c * t) * j else: tmp = (-i * j) * y return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -6.5e+70) tmp = Float64(Float64(-i) * Float64(j * y)); elseif (j <= -3.2e-180) tmp = Float64(Float64(z * x) * y); elseif (j <= 1.55e-302) tmp = Float64(Float64(i * b) * a); elseif (j <= 3.5e+49) tmp = Float64(Float64(z * y) * x); elseif (j <= 1.2e+81) tmp = Float64(Float64(c * t) * j); else tmp = Float64(Float64(Float64(-i) * j) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -6.5e+70) tmp = -i * (j * y); elseif (j <= -3.2e-180) tmp = (z * x) * y; elseif (j <= 1.55e-302) tmp = (i * b) * a; elseif (j <= 3.5e+49) tmp = (z * y) * x; elseif (j <= 1.2e+81) tmp = (c * t) * j; else tmp = (-i * j) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -6.5e+70], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -3.2e-180], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[j, 1.55e-302], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[j, 3.5e+49], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[j, 1.2e+81], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -6.5 \cdot 10^{+70}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\
\mathbf{elif}\;j \leq -3.2 \cdot 10^{-180}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;j \leq 1.55 \cdot 10^{-302}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{+49}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;j \leq 1.2 \cdot 10^{+81}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\end{array}
\end{array}
if j < -6.49999999999999978e70Initial program 74.5%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6448.4
Applied rewrites48.4%
Taylor expanded in y around inf
lower-*.f6439.3
Applied rewrites39.3%
if -6.49999999999999978e70 < j < -3.20000000000000015e-180Initial program 75.3%
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-*.f6436.8
Applied rewrites36.8%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6424.8
Applied rewrites24.8%
if -3.20000000000000015e-180 < j < 1.54999999999999992e-302Initial program 74.3%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites48.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.0
Applied rewrites28.0%
if 1.54999999999999992e-302 < j < 3.49999999999999975e49Initial program 72.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-*.f6433.8
Applied rewrites33.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6424.6
Applied rewrites24.6%
if 3.49999999999999975e49 < j < 1.19999999999999995e81Initial program 73.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f6445.0
Applied rewrites45.0%
Taylor expanded in y around 0
lift-*.f6424.0
Applied rewrites24.0%
if 1.19999999999999995e81 < j Initial program 72.5%
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-*.f6447.7
Applied rewrites47.7%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6438.9
Applied rewrites38.9%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -6.5e+70)
(* (* (- i) y) j)
(if (<= j -3.2e-180)
(* (* z x) y)
(if (<= j 1.55e-302)
(* (* i b) a)
(if (<= j 3.5e+49)
(* (* z y) x)
(if (<= j 1.2e+81) (* (* c t) j) (* (* (- i) j) y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -6.5e+70) {
tmp = (-i * y) * j;
} else if (j <= -3.2e-180) {
tmp = (z * x) * y;
} else if (j <= 1.55e-302) {
tmp = (i * b) * a;
} else if (j <= 3.5e+49) {
tmp = (z * y) * x;
} else if (j <= 1.2e+81) {
tmp = (c * t) * j;
} else {
tmp = (-i * j) * y;
}
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 (j <= (-6.5d+70)) then
tmp = (-i * y) * j
else if (j <= (-3.2d-180)) then
tmp = (z * x) * y
else if (j <= 1.55d-302) then
tmp = (i * b) * a
else if (j <= 3.5d+49) then
tmp = (z * y) * x
else if (j <= 1.2d+81) then
tmp = (c * t) * j
else
tmp = (-i * j) * y
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 (j <= -6.5e+70) {
tmp = (-i * y) * j;
} else if (j <= -3.2e-180) {
tmp = (z * x) * y;
} else if (j <= 1.55e-302) {
tmp = (i * b) * a;
} else if (j <= 3.5e+49) {
tmp = (z * y) * x;
} else if (j <= 1.2e+81) {
tmp = (c * t) * j;
} else {
tmp = (-i * j) * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -6.5e+70: tmp = (-i * y) * j elif j <= -3.2e-180: tmp = (z * x) * y elif j <= 1.55e-302: tmp = (i * b) * a elif j <= 3.5e+49: tmp = (z * y) * x elif j <= 1.2e+81: tmp = (c * t) * j else: tmp = (-i * j) * y return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -6.5e+70) tmp = Float64(Float64(Float64(-i) * y) * j); elseif (j <= -3.2e-180) tmp = Float64(Float64(z * x) * y); elseif (j <= 1.55e-302) tmp = Float64(Float64(i * b) * a); elseif (j <= 3.5e+49) tmp = Float64(Float64(z * y) * x); elseif (j <= 1.2e+81) tmp = Float64(Float64(c * t) * j); else tmp = Float64(Float64(Float64(-i) * j) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -6.5e+70) tmp = (-i * y) * j; elseif (j <= -3.2e-180) tmp = (z * x) * y; elseif (j <= 1.55e-302) tmp = (i * b) * a; elseif (j <= 3.5e+49) tmp = (z * y) * x; elseif (j <= 1.2e+81) tmp = (c * t) * j; else tmp = (-i * j) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -6.5e+70], N[(N[((-i) * y), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[j, -3.2e-180], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[j, 1.55e-302], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[j, 3.5e+49], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[j, 1.2e+81], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -6.5 \cdot 10^{+70}:\\
\;\;\;\;\left(\left(-i\right) \cdot y\right) \cdot j\\
\mathbf{elif}\;j \leq -3.2 \cdot 10^{-180}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;j \leq 1.55 \cdot 10^{-302}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{+49}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;j \leq 1.2 \cdot 10^{+81}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\end{array}
\end{array}
if j < -6.49999999999999978e70Initial program 74.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f6465.4
Applied rewrites65.4%
Taylor expanded in y around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6437.2
Applied rewrites37.2%
if -6.49999999999999978e70 < j < -3.20000000000000015e-180Initial program 75.3%
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-*.f6436.8
Applied rewrites36.8%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6424.8
Applied rewrites24.8%
if -3.20000000000000015e-180 < j < 1.54999999999999992e-302Initial program 74.3%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites48.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.0
Applied rewrites28.0%
if 1.54999999999999992e-302 < j < 3.49999999999999975e49Initial program 72.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-*.f6433.8
Applied rewrites33.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6424.6
Applied rewrites24.6%
if 3.49999999999999975e49 < j < 1.19999999999999995e81Initial program 73.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f6445.0
Applied rewrites45.0%
Taylor expanded in y around 0
lift-*.f6424.0
Applied rewrites24.0%
if 1.19999999999999995e81 < j Initial program 72.5%
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-*.f6447.7
Applied rewrites47.7%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6438.9
Applied rewrites38.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* (- i) j) y)))
(if (<= j -6.5e+70)
t_1
(if (<= j -3.2e-180)
(* (* z x) y)
(if (<= j 1.55e-302)
(* (* i b) a)
(if (<= j 3.5e+49)
(* (* z y) x)
(if (<= j 1.2e+81) (* (* c t) 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 * j) * y;
double tmp;
if (j <= -6.5e+70) {
tmp = t_1;
} else if (j <= -3.2e-180) {
tmp = (z * x) * y;
} else if (j <= 1.55e-302) {
tmp = (i * b) * a;
} else if (j <= 3.5e+49) {
tmp = (z * y) * x;
} else if (j <= 1.2e+81) {
tmp = (c * t) * 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 * j) * y
if (j <= (-6.5d+70)) then
tmp = t_1
else if (j <= (-3.2d-180)) then
tmp = (z * x) * y
else if (j <= 1.55d-302) then
tmp = (i * b) * a
else if (j <= 3.5d+49) then
tmp = (z * y) * x
else if (j <= 1.2d+81) then
tmp = (c * t) * 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 * j) * y;
double tmp;
if (j <= -6.5e+70) {
tmp = t_1;
} else if (j <= -3.2e-180) {
tmp = (z * x) * y;
} else if (j <= 1.55e-302) {
tmp = (i * b) * a;
} else if (j <= 3.5e+49) {
tmp = (z * y) * x;
} else if (j <= 1.2e+81) {
tmp = (c * t) * j;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-i * j) * y tmp = 0 if j <= -6.5e+70: tmp = t_1 elif j <= -3.2e-180: tmp = (z * x) * y elif j <= 1.55e-302: tmp = (i * b) * a elif j <= 3.5e+49: tmp = (z * y) * x elif j <= 1.2e+81: tmp = (c * t) * j else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(-i) * j) * y) tmp = 0.0 if (j <= -6.5e+70) tmp = t_1; elseif (j <= -3.2e-180) tmp = Float64(Float64(z * x) * y); elseif (j <= 1.55e-302) tmp = Float64(Float64(i * b) * a); elseif (j <= 3.5e+49) tmp = Float64(Float64(z * y) * x); elseif (j <= 1.2e+81) tmp = Float64(Float64(c * t) * 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 * j) * y; tmp = 0.0; if (j <= -6.5e+70) tmp = t_1; elseif (j <= -3.2e-180) tmp = (z * x) * y; elseif (j <= 1.55e-302) tmp = (i * b) * a; elseif (j <= 3.5e+49) tmp = (z * y) * x; elseif (j <= 1.2e+81) tmp = (c * t) * 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[((-i) * j), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[j, -6.5e+70], t$95$1, If[LessEqual[j, -3.2e-180], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[j, 1.55e-302], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[j, 3.5e+49], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[j, 1.2e+81], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{if}\;j \leq -6.5 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq -3.2 \cdot 10^{-180}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;j \leq 1.55 \cdot 10^{-302}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{+49}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;j \leq 1.2 \cdot 10^{+81}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -6.49999999999999978e70 or 1.19999999999999995e81 < j Initial program 73.5%
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-*.f6447.7
Applied rewrites47.7%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6439.1
Applied rewrites39.1%
if -6.49999999999999978e70 < j < -3.20000000000000015e-180Initial program 75.3%
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-*.f6436.8
Applied rewrites36.8%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6424.8
Applied rewrites24.8%
if -3.20000000000000015e-180 < j < 1.54999999999999992e-302Initial program 74.3%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites48.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.0
Applied rewrites28.0%
if 1.54999999999999992e-302 < j < 3.49999999999999975e49Initial program 72.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-*.f6433.8
Applied rewrites33.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6424.6
Applied rewrites24.6%
if 3.49999999999999975e49 < j < 1.19999999999999995e81Initial program 73.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f6445.0
Applied rewrites45.0%
Taylor expanded in y around 0
lift-*.f6424.0
Applied rewrites24.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) y (* c t)) j)))
(if (<= j -8.5e+69)
t_1
(if (<= j -6.2e-173)
(* (fma y x (* (- b) c)) z)
(if (<= j 1.6e-302)
(* (fma (- t) x (* i b)) a)
(if (<= j 3.4e+49) (* (fma (- a) t (* z y)) x) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, y, (c * t)) * j;
double tmp;
if (j <= -8.5e+69) {
tmp = t_1;
} else if (j <= -6.2e-173) {
tmp = fma(y, x, (-b * c)) * z;
} else if (j <= 1.6e-302) {
tmp = fma(-t, x, (i * b)) * a;
} else if (j <= 3.4e+49) {
tmp = fma(-a, t, (z * y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), y, Float64(c * t)) * j) tmp = 0.0 if (j <= -8.5e+69) tmp = t_1; elseif (j <= -6.2e-173) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); elseif (j <= 1.6e-302) tmp = Float64(fma(Float64(-t), x, Float64(i * b)) * a); elseif (j <= 3.4e+49) tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -8.5e+69], t$95$1, If[LessEqual[j, -6.2e-173], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[j, 1.6e-302], N[(N[((-t) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[j, 3.4e+49], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\
\mathbf{if}\;j \leq -8.5 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq -6.2 \cdot 10^{-173}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{elif}\;j \leq 1.6 \cdot 10^{-302}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, i \cdot b\right) \cdot a\\
\mathbf{elif}\;j \leq 3.4 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -8.5000000000000002e69 or 3.4000000000000001e49 < j Initial program 73.6%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f6463.7
Applied rewrites63.7%
if -8.5000000000000002e69 < j < -6.20000000000000011e-173Initial program 75.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6442.9
Applied rewrites42.9%
if -6.20000000000000011e-173 < j < 1.59999999999999989e-302Initial program 74.6%
Taylor expanded in b around 0
Applied rewrites76.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6447.5
Applied rewrites47.5%
if 1.59999999999999989e-302 < j < 3.4000000000000001e49Initial program 72.9%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6443.3
Applied rewrites43.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) y (* c t)) j)))
(if (<= j -8.5e+69)
t_1
(if (<= j -1.85e-172)
(* (fma y x (* (- b) c)) z)
(if (<= j 2.2e-303)
(* (fma i a (* (- c) z)) b)
(if (<= j 3.4e+49) (* (fma (- a) t (* z y)) x) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, y, (c * t)) * j;
double tmp;
if (j <= -8.5e+69) {
tmp = t_1;
} else if (j <= -1.85e-172) {
tmp = fma(y, x, (-b * c)) * z;
} else if (j <= 2.2e-303) {
tmp = fma(i, a, (-c * z)) * b;
} else if (j <= 3.4e+49) {
tmp = fma(-a, t, (z * y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), y, Float64(c * t)) * j) tmp = 0.0 if (j <= -8.5e+69) tmp = t_1; elseif (j <= -1.85e-172) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); elseif (j <= 2.2e-303) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); elseif (j <= 3.4e+49) tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -8.5e+69], t$95$1, If[LessEqual[j, -1.85e-172], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[j, 2.2e-303], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[j, 3.4e+49], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\
\mathbf{if}\;j \leq -8.5 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq -1.85 \cdot 10^{-172}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{elif}\;j \leq 2.2 \cdot 10^{-303}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;j \leq 3.4 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -8.5000000000000002e69 or 3.4000000000000001e49 < j Initial program 73.6%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f6463.7
Applied rewrites63.7%
if -8.5000000000000002e69 < j < -1.85e-172Initial program 75.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6442.9
Applied rewrites42.9%
if -1.85e-172 < j < 2.20000000000000014e-303Initial program 74.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6450.4
Applied rewrites50.4%
if 2.20000000000000014e-303 < j < 3.4000000000000001e49Initial program 72.8%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6443.3
Applied rewrites43.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i a (* (- c) z)) b)) (t_2 (* (fma j t (* (- b) z)) c)))
(if (<= c -1.35e-98)
t_2
(if (<= c -6.4e-188)
t_1
(if (<= c 6.5e-115) (* (* (- i) y) j) (if (<= c 9.2e-13) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(i, a, (-c * z)) * b;
double t_2 = fma(j, t, (-b * z)) * c;
double tmp;
if (c <= -1.35e-98) {
tmp = t_2;
} else if (c <= -6.4e-188) {
tmp = t_1;
} else if (c <= 6.5e-115) {
tmp = (-i * y) * j;
} else if (c <= 9.2e-13) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(i, a, Float64(Float64(-c) * z)) * b) t_2 = Float64(fma(j, t, Float64(Float64(-b) * z)) * c) tmp = 0.0 if (c <= -1.35e-98) tmp = t_2; elseif (c <= -6.4e-188) tmp = t_1; elseif (c <= 6.5e-115) tmp = Float64(Float64(Float64(-i) * y) * j); elseif (c <= 9.2e-13) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[c, -1.35e-98], t$95$2, If[LessEqual[c, -6.4e-188], t$95$1, If[LessEqual[c, 6.5e-115], N[(N[((-i) * y), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[c, 9.2e-13], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
t_2 := \mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{if}\;c \leq -1.35 \cdot 10^{-98}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq -6.4 \cdot 10^{-188}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 6.5 \cdot 10^{-115}:\\
\;\;\;\;\left(\left(-i\right) \cdot y\right) \cdot j\\
\mathbf{elif}\;c \leq 9.2 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -1.3499999999999999e-98 or 9.19999999999999917e-13 < c Initial program 68.6%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6455.1
Applied rewrites55.1%
if -1.3499999999999999e-98 < c < -6.40000000000000044e-188 or 6.50000000000000033e-115 < c < 9.19999999999999917e-13Initial program 80.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6435.3
Applied rewrites35.3%
if -6.40000000000000044e-188 < c < 6.50000000000000033e-115Initial program 81.3%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f6432.7
Applied rewrites32.7%
Taylor expanded in y around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6429.0
Applied rewrites29.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) j (* z x)) y)))
(if (<= y -8.6e-39)
t_1
(if (<= y 3.15e-127)
(* (fma (- a) x (* j c)) t)
(if (<= y 3.9e+56) (* (fma i a (* (- c) z)) 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 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -8.6e-39) {
tmp = t_1;
} else if (y <= 3.15e-127) {
tmp = fma(-a, x, (j * c)) * t;
} else if (y <= 3.9e+56) {
tmp = fma(i, a, (-c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), j, Float64(z * x)) * y) tmp = 0.0 if (y <= -8.6e-39) tmp = t_1; elseif (y <= 3.15e-127) tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); elseif (y <= 3.9e+56) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -8.6e-39], t$95$1, If[LessEqual[y, 3.15e-127], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 3.9e+56], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -8.6 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.15 \cdot 10^{-127}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.5999999999999999e-39 or 3.89999999999999994e56 < y Initial program 66.8%
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-*.f6459.5
Applied rewrites59.5%
if -8.5999999999999999e-39 < y < 3.1499999999999999e-127Initial program 81.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6446.0
Applied rewrites46.0%
if 3.1499999999999999e-127 < y < 3.89999999999999994e56Initial program 78.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6440.2
Applied rewrites40.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) t (* z y)) x)))
(if (<= x -1.8e+85)
t_1
(if (<= x 145000000.0)
(* (fma j t (* (- b) z)) c)
(if (<= x 1e+88) (* (fma i a (* (- c) z)) 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 = fma(-a, t, (z * y)) * x;
double tmp;
if (x <= -1.8e+85) {
tmp = t_1;
} else if (x <= 145000000.0) {
tmp = fma(j, t, (-b * z)) * c;
} else if (x <= 1e+88) {
tmp = fma(i, a, (-c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), t, Float64(z * y)) * x) tmp = 0.0 if (x <= -1.8e+85) tmp = t_1; elseif (x <= 145000000.0) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (x <= 1e+88) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.8e+85], t$95$1, If[LessEqual[x, 145000000.0], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 1e+88], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -1.8 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 145000000:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;x \leq 10^{+88}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.7999999999999999e85 or 9.99999999999999959e87 < x Initial program 73.3%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6466.4
Applied rewrites66.4%
if -1.7999999999999999e85 < x < 1.45e8Initial program 73.8%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6444.8
Applied rewrites44.8%
if 1.45e8 < x < 9.99999999999999959e87Initial program 76.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6438.7
Applied rewrites38.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* z y) x)) (t_2 (* (* j t) c)))
(if (<= j -2.2e+97)
t_2
(if (<= j -3.2e-180)
t_1
(if (<= j 1.55e-302) (* (* i b) a) (if (<= j 3.5e+49) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * y) * x;
double t_2 = (j * t) * c;
double tmp;
if (j <= -2.2e+97) {
tmp = t_2;
} else if (j <= -3.2e-180) {
tmp = t_1;
} else if (j <= 1.55e-302) {
tmp = (i * b) * a;
} else if (j <= 3.5e+49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z * y) * x
t_2 = (j * t) * c
if (j <= (-2.2d+97)) then
tmp = t_2
else if (j <= (-3.2d-180)) then
tmp = t_1
else if (j <= 1.55d-302) then
tmp = (i * b) * a
else if (j <= 3.5d+49) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * y) * x;
double t_2 = (j * t) * c;
double tmp;
if (j <= -2.2e+97) {
tmp = t_2;
} else if (j <= -3.2e-180) {
tmp = t_1;
} else if (j <= 1.55e-302) {
tmp = (i * b) * a;
} else if (j <= 3.5e+49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (z * y) * x t_2 = (j * t) * c tmp = 0 if j <= -2.2e+97: tmp = t_2 elif j <= -3.2e-180: tmp = t_1 elif j <= 1.55e-302: tmp = (i * b) * a elif j <= 3.5e+49: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * y) * x) t_2 = Float64(Float64(j * t) * c) tmp = 0.0 if (j <= -2.2e+97) tmp = t_2; elseif (j <= -3.2e-180) tmp = t_1; elseif (j <= 1.55e-302) tmp = Float64(Float64(i * b) * a); elseif (j <= 3.5e+49) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (z * y) * x; t_2 = (j * t) * c; tmp = 0.0; if (j <= -2.2e+97) tmp = t_2; elseif (j <= -3.2e-180) tmp = t_1; elseif (j <= 1.55e-302) tmp = (i * b) * a; elseif (j <= 3.5e+49) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[j, -2.2e+97], t$95$2, If[LessEqual[j, -3.2e-180], t$95$1, If[LessEqual[j, 1.55e-302], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[j, 3.5e+49], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y\right) \cdot x\\
t_2 := \left(j \cdot t\right) \cdot c\\
\mathbf{if}\;j \leq -2.2 \cdot 10^{+97}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;j \leq -3.2 \cdot 10^{-180}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.55 \cdot 10^{-302}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if j < -2.2000000000000001e97 or 3.49999999999999975e49 < j Initial program 73.1%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites73.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
if -2.2000000000000001e97 < j < -3.20000000000000015e-180 or 1.54999999999999992e-302 < j < 3.49999999999999975e49Initial program 74.2%
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-*.f6435.0
Applied rewrites35.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6424.1
Applied rewrites24.1%
if -3.20000000000000015e-180 < j < 1.54999999999999992e-302Initial program 74.3%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites48.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.0
Applied rewrites28.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -1.05e+119)
(* (- i) (* j y))
(if (<= j 4.5e+49)
(* (fma i a (* (- c) z)) b)
(if (<= j 1.2e+81) (* (* c t) j) (* (* (- i) j) y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -1.05e+119) {
tmp = -i * (j * y);
} else if (j <= 4.5e+49) {
tmp = fma(i, a, (-c * z)) * b;
} else if (j <= 1.2e+81) {
tmp = (c * t) * j;
} else {
tmp = (-i * j) * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -1.05e+119) tmp = Float64(Float64(-i) * Float64(j * y)); elseif (j <= 4.5e+49) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); elseif (j <= 1.2e+81) tmp = Float64(Float64(c * t) * j); else tmp = Float64(Float64(Float64(-i) * j) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -1.05e+119], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 4.5e+49], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[j, 1.2e+81], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -1.05 \cdot 10^{+119}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\
\mathbf{elif}\;j \leq 4.5 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;j \leq 1.2 \cdot 10^{+81}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\end{array}
\end{array}
if j < -1.04999999999999991e119Initial program 72.7%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6450.4
Applied rewrites50.4%
Taylor expanded in y around inf
lower-*.f6442.4
Applied rewrites42.4%
if -1.04999999999999991e119 < j < 4.49999999999999982e49Initial program 74.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6444.4
Applied rewrites44.4%
if 4.49999999999999982e49 < j < 1.19999999999999995e81Initial program 73.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f6445.0
Applied rewrites45.0%
Taylor expanded in y around 0
lift-*.f6424.0
Applied rewrites24.0%
if 1.19999999999999995e81 < j Initial program 72.5%
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-*.f6447.7
Applied rewrites47.7%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6438.9
Applied rewrites38.9%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -2.5e+42)
(* (* j t) c)
(if (<= t 1.75e+55)
(- (* c (* b z)))
(if (<= t 2.15e+219) (* (* (- a) x) t) (* (* c t) j)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -2.5e+42) {
tmp = (j * t) * c;
} else if (t <= 1.75e+55) {
tmp = -(c * (b * z));
} else if (t <= 2.15e+219) {
tmp = (-a * x) * t;
} else {
tmp = (c * t) * j;
}
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 <= (-2.5d+42)) then
tmp = (j * t) * c
else if (t <= 1.75d+55) then
tmp = -(c * (b * z))
else if (t <= 2.15d+219) then
tmp = (-a * x) * t
else
tmp = (c * t) * j
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 <= -2.5e+42) {
tmp = (j * t) * c;
} else if (t <= 1.75e+55) {
tmp = -(c * (b * z));
} else if (t <= 2.15e+219) {
tmp = (-a * x) * t;
} else {
tmp = (c * t) * j;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -2.5e+42: tmp = (j * t) * c elif t <= 1.75e+55: tmp = -(c * (b * z)) elif t <= 2.15e+219: tmp = (-a * x) * t else: tmp = (c * t) * j return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -2.5e+42) tmp = Float64(Float64(j * t) * c); elseif (t <= 1.75e+55) tmp = Float64(-Float64(c * Float64(b * z))); elseif (t <= 2.15e+219) tmp = Float64(Float64(Float64(-a) * x) * t); else tmp = Float64(Float64(c * t) * j); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -2.5e+42) tmp = (j * t) * c; elseif (t <= 1.75e+55) tmp = -(c * (b * z)); elseif (t <= 2.15e+219) tmp = (-a * x) * t; else tmp = (c * t) * j; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -2.5e+42], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t, 1.75e+55], (-N[(c * N[(b * z), $MachinePrecision]), $MachinePrecision]), If[LessEqual[t, 2.15e+219], N[(N[((-a) * x), $MachinePrecision] * t), $MachinePrecision], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+42}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+55}:\\
\;\;\;\;-c \cdot \left(b \cdot z\right)\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{+219}:\\
\;\;\;\;\left(\left(-a\right) \cdot x\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\end{array}
\end{array}
if t < -2.50000000000000003e42Initial program 66.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites54.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6436.3
Applied rewrites36.3%
if -2.50000000000000003e42 < t < 1.75000000000000005e55Initial program 80.8%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites66.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6426.0
Applied rewrites26.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.5
Applied rewrites25.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6426.4
Applied rewrites26.4%
if 1.75000000000000005e55 < t < 2.1499999999999999e219Initial program 65.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6458.5
Applied rewrites58.5%
Taylor expanded in x around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6432.9
Applied rewrites32.9%
if 2.1499999999999999e219 < t Initial program 55.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f6448.2
Applied rewrites48.2%
Taylor expanded in y around 0
lift-*.f6441.5
Applied rewrites41.5%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* z y) x))) (if (<= x -6.2e+26) t_1 (if (<= x 9e+87) (* (* i b) a) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * y) * x;
double tmp;
if (x <= -6.2e+26) {
tmp = t_1;
} else if (x <= 9e+87) {
tmp = (i * b) * a;
} 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 = (z * y) * x
if (x <= (-6.2d+26)) then
tmp = t_1
else if (x <= 9d+87) then
tmp = (i * b) * a
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 = (z * y) * x;
double tmp;
if (x <= -6.2e+26) {
tmp = t_1;
} else if (x <= 9e+87) {
tmp = (i * b) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (z * y) * x tmp = 0 if x <= -6.2e+26: tmp = t_1 elif x <= 9e+87: tmp = (i * b) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * y) * x) tmp = 0.0 if (x <= -6.2e+26) tmp = t_1; elseif (x <= 9e+87) tmp = Float64(Float64(i * b) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (z * y) * x; tmp = 0.0; if (x <= -6.2e+26) tmp = t_1; elseif (x <= 9e+87) tmp = (i * b) * a; 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[(z * y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -6.2e+26], t$95$1, If[LessEqual[x, 9e+87], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -6.2 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+87}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.1999999999999999e26 or 9.0000000000000005e87 < x Initial program 73.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-*.f6447.0
Applied rewrites47.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6435.1
Applied rewrites35.1%
if -6.1999999999999999e26 < x < 9.0000000000000005e87Initial program 73.7%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites71.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.3
Applied rewrites25.3%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* z y) x))) (if (<= z -2.15e-37) t_1 (if (<= z 1.05e-224) (* (* b a) i) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * y) * x;
double tmp;
if (z <= -2.15e-37) {
tmp = t_1;
} else if (z <= 1.05e-224) {
tmp = (b * a) * i;
} 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 = (z * y) * x
if (z <= (-2.15d-37)) then
tmp = t_1
else if (z <= 1.05d-224) then
tmp = (b * a) * i
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 = (z * y) * x;
double tmp;
if (z <= -2.15e-37) {
tmp = t_1;
} else if (z <= 1.05e-224) {
tmp = (b * a) * i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (z * y) * x tmp = 0 if z <= -2.15e-37: tmp = t_1 elif z <= 1.05e-224: tmp = (b * a) * i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * y) * x) tmp = 0.0 if (z <= -2.15e-37) tmp = t_1; elseif (z <= 1.05e-224) tmp = Float64(Float64(b * a) * i); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (z * y) * x; tmp = 0.0; if (z <= -2.15e-37) tmp = t_1; elseif (z <= 1.05e-224) tmp = (b * a) * i; 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[(z * y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -2.15e-37], t$95$1, If[LessEqual[z, 1.05e-224], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y\right) \cdot x\\
\mathbf{if}\;z \leq -2.15 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-224}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.14999999999999984e-37 or 1.05000000000000003e-224 < z Initial program 70.3%
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-*.f6442.3
Applied rewrites42.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6427.3
Applied rewrites27.3%
if -2.14999999999999984e-37 < z < 1.05000000000000003e-224Initial program 82.2%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
Applied rewrites67.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.9
Applied rewrites25.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6426.5
Applied rewrites26.5%
(FPCore (x y z t a b c i j) :precision binary64 (* (* z y) x))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (z * y) * x;
}
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 = (z * y) * x
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 (z * y) * x;
}
def code(x, y, z, t, a, b, c, i, j): return (z * y) * x
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(z * y) * x) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (z * y) * x; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot y\right) \cdot x
\end{array}
Initial program 73.8%
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-*.f6439.5
Applied rewrites39.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.7
Applied rewrites21.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(/
(* j (- (pow (* c t) 2.0) (pow (* i y) 2.0)))
(+ (* c t) (* i y)))))
(t_2
(-
(* x (- (* z y) (* a t)))
(- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j)))))
(if (< t -8.120978919195912e-33)
t_2
(if (< t -4.712553818218485e-169)
t_1
(if (< t -7.633533346031584e-308)
t_2
(if (< t 1.0535888557455487e-139) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (pow((c * t), 2.0) - pow((i * y), 2.0))) / ((c * t) + (i * y)));
double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
double tmp;
if (t < -8.120978919195912e-33) {
tmp = t_2;
} else if (t < -4.712553818218485e-169) {
tmp = t_1;
} else if (t < -7.633533346031584e-308) {
tmp = t_2;
} else if (t < 1.0535888557455487e-139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ** 2.0d0) - ((i * y) ** 2.0d0))) / ((c * t) + (i * y)))
t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j))
if (t < (-8.120978919195912d-33)) then
tmp = t_2
else if (t < (-4.712553818218485d-169)) then
tmp = t_1
else if (t < (-7.633533346031584d-308)) then
tmp = t_2
else if (t < 1.0535888557455487d-139) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (Math.pow((c * t), 2.0) - Math.pow((i * y), 2.0))) / ((c * t) + (i * y)));
double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
double tmp;
if (t < -8.120978919195912e-33) {
tmp = t_2;
} else if (t < -4.712553818218485e-169) {
tmp = t_1;
} else if (t < -7.633533346031584e-308) {
tmp = t_2;
} else if (t < 1.0535888557455487e-139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (math.pow((c * t), 2.0) - math.pow((i * y), 2.0))) / ((c * t) + (i * y))) t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j)) tmp = 0 if t < -8.120978919195912e-33: tmp = t_2 elif t < -4.712553818218485e-169: tmp = t_1 elif t < -7.633533346031584e-308: tmp = t_2 elif t < 1.0535888557455487e-139: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(Float64(j * Float64((Float64(c * t) ^ 2.0) - (Float64(i * y) ^ 2.0))) / Float64(Float64(c * t) + Float64(i * y)))) t_2 = Float64(Float64(x * Float64(Float64(z * y) - Float64(a * t))) - Float64(Float64(b * Float64(Float64(z * c) - Float64(a * i))) - Float64(Float64(Float64(c * t) - Float64(y * i)) * j))) tmp = 0.0 if (t < -8.120978919195912e-33) tmp = t_2; elseif (t < -4.712553818218485e-169) tmp = t_1; elseif (t < -7.633533346031584e-308) tmp = t_2; elseif (t < 1.0535888557455487e-139) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ^ 2.0) - ((i * y) ^ 2.0))) / ((c * t) + (i * y))); t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j)); tmp = 0.0; if (t < -8.120978919195912e-33) tmp = t_2; elseif (t < -4.712553818218485e-169) tmp = t_1; elseif (t < -7.633533346031584e-308) tmp = t_2; elseif (t < 1.0535888557455487e-139) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(j * N[(N[Power[N[(c * t), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(i * y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * t), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[(z * c), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * t), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -8.120978919195912e-33], t$95$2, If[Less[t, -4.712553818218485e-169], t$95$1, If[Less[t, -7.633533346031584e-308], t$95$2, If[Less[t, 1.0535888557455487e-139], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\
t_2 := x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\
\mathbf{if}\;t < -8.120978919195912 \cdot 10^{-33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < -4.712553818218485 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < -7.633533346031584 \cdot 10^{-308}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < 1.0535888557455487 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2025089
(FPCore (x y z t a b c i j)
:name "Linear.Matrix:det33 from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (if (< t -1015122364899489/125000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -942510763643697/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (if (< t -238547917063487/3125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t 10535888557455487/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))