
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))))
(if (<= (+ t_1 (* j (- (* c a) (* y i)))) INFINITY)
(+ t_1 (* j (fma (- y) i (* c a))))
(* t (fma (- x) a (* i b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)));
double tmp;
if ((t_1 + (j * ((c * a) - (y * i)))) <= ((double) INFINITY)) {
tmp = t_1 + (j * fma(-y, i, (c * a)));
} else {
tmp = t * fma(-x, a, (i * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) tmp = 0.0 if (Float64(t_1 + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) <= Inf) tmp = Float64(t_1 + Float64(j * fma(Float64(-y), i, Float64(c * a)))); else tmp = Float64(t * fma(Float64(-x), a, Float64(i * b))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 + N[(j * N[((-y) * i + N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[((-x) * a + N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\\
\mathbf{if}\;t\_1 + j \cdot \left(c \cdot a - y \cdot i\right) \leq \infty:\\
\;\;\;\;t\_1 + j \cdot \mathsf{fma}\left(-y, i, c \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-x, a, i \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 72.5%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lower-neg.f6472.7
Applied rewrites72.7%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 72.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f6458.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6458.7
Applied rewrites58.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6439.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
(* j (- (* c a) (* y i))))))
(if (<= t_1 INFINITY) t_1 (* t (fma (- x) a (* i b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = t * fma(-x, a, (i * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(t * fma(Float64(-x), a, Float64(i * b))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(t * N[((-x) * a + N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-x, a, i \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 72.5%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 72.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f6458.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6458.7
Applied rewrites58.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6439.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* i t) (* c z))))
(if (<= b -9.5e+165)
(* b t_1)
(if (<= b 9.5e+110)
(fma j (- (* a c) (* i y)) (* x (- (* y z) (* a t))))
(fma t_1 b (- (* (* j c) a) (* (* t x) a)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * t) - (c * z);
double tmp;
if (b <= -9.5e+165) {
tmp = b * t_1;
} else if (b <= 9.5e+110) {
tmp = fma(j, ((a * c) - (i * y)), (x * ((y * z) - (a * t))));
} else {
tmp = fma(t_1, b, (((j * c) * a) - ((t * x) * a)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * t) - Float64(c * z)) tmp = 0.0 if (b <= -9.5e+165) tmp = Float64(b * t_1); elseif (b <= 9.5e+110) tmp = fma(j, Float64(Float64(a * c) - Float64(i * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = fma(t_1, b, Float64(Float64(Float64(j * c) * a) - Float64(Float64(t * x) * a))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -9.5e+165], N[(b * t$95$1), $MachinePrecision], If[LessEqual[b, 9.5e+110], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * b + N[(N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision] - N[(N[(t * x), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot t - c \cdot z\\
\mathbf{if}\;b \leq -9.5 \cdot 10^{+165}:\\
\;\;\;\;b \cdot t\_1\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{+110}:\\
\;\;\;\;\mathsf{fma}\left(j, a \cdot c - i \cdot y, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, \left(j \cdot c\right) \cdot a - \left(t \cdot x\right) \cdot a\right)\\
\end{array}
\end{array}
if b < -9.50000000000000017e165Initial program 72.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
if -9.50000000000000017e165 < b < 9.49999999999999939e110Initial program 72.5%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
if 9.49999999999999939e110 < b Initial program 72.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f6458.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6458.7
Applied rewrites58.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* i t) (* c z)))))
(if (<= b -9.5e+165)
t_1
(if (<= b 2.25e+113)
(fma j (- (* a c) (* i y)) (* x (- (* y z) (* a t))))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((i * t) - (c * z));
double tmp;
if (b <= -9.5e+165) {
tmp = t_1;
} else if (b <= 2.25e+113) {
tmp = fma(j, ((a * c) - (i * y)), (x * ((y * z) - (a * t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(i * t) - Float64(c * z))) tmp = 0.0 if (b <= -9.5e+165) tmp = t_1; elseif (b <= 2.25e+113) tmp = fma(j, Float64(Float64(a * c) - Float64(i * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -9.5e+165], t$95$1, If[LessEqual[b, 2.25e+113], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{if}\;b \leq -9.5 \cdot 10^{+165}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.25 \cdot 10^{+113}:\\
\;\;\;\;\mathsf{fma}\left(j, a \cdot c - i \cdot y, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.50000000000000017e165 or 2.25e113 < b Initial program 72.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
if -9.50000000000000017e165 < b < 2.25e113Initial program 72.5%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma j (* a c) (* x (- (* y z) (* a t))))))
(if (<= x -2.55e-15)
t_1
(if (<= x 5.5e+71)
(+ (* -1.0 (* b (* c z))) (* j (- (* c a) (* y 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(j, (a * c), (x * ((y * z) - (a * t))));
double tmp;
if (x <= -2.55e-15) {
tmp = t_1;
} else if (x <= 5.5e+71) {
tmp = (-1.0 * (b * (c * z))) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(j, Float64(a * c), Float64(x * Float64(Float64(y * z) - Float64(a * t)))) tmp = 0.0 if (x <= -2.55e-15) tmp = t_1; elseif (x <= 5.5e+71) tmp = Float64(Float64(-1.0 * Float64(b * Float64(c * z))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(a * c), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.55e-15], t$95$1, If[LessEqual[x, 5.5e+71], N[(N[(-1.0 * N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(j, a \cdot c, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{if}\;x \leq -2.55 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+71}:\\
\;\;\;\;-1 \cdot \left(b \cdot \left(c \cdot z\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.55e-15 or 5.5e71 < x Initial program 72.5%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
Taylor expanded in y around 0
lower-*.f6449.9
Applied rewrites49.9%
if -2.55e-15 < x < 5.5e71Initial program 72.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6449.7
Applied rewrites49.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* i t) (* c z)))))
(if (<= b -9.5e+165)
t_1
(if (<= b 3.6e+106) (fma j (* a c) (* x (- (* y z) (* a t)))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((i * t) - (c * z));
double tmp;
if (b <= -9.5e+165) {
tmp = t_1;
} else if (b <= 3.6e+106) {
tmp = fma(j, (a * c), (x * ((y * z) - (a * t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(i * t) - Float64(c * z))) tmp = 0.0 if (b <= -9.5e+165) tmp = t_1; elseif (b <= 3.6e+106) tmp = fma(j, Float64(a * c), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -9.5e+165], t$95$1, If[LessEqual[b, 3.6e+106], N[(j * N[(a * c), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{if}\;b \leq -9.5 \cdot 10^{+165}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{+106}:\\
\;\;\;\;\mathsf{fma}\left(j, a \cdot c, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.50000000000000017e165 or 3.6000000000000001e106 < b Initial program 72.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
if -9.50000000000000017e165 < b < 3.6000000000000001e106Initial program 72.5%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
Taylor expanded in y around 0
lower-*.f6449.9
Applied rewrites49.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* y (fma -1.0 (* i j) (* x z)))))
(if (<= y -6.1e+60)
t_1
(if (<= y -7.7e-174)
(* t (- (* b i) (* a x)))
(if (<= y 3.5e+30)
(* a (fma -1.0 (* t x) (* c j)))
(if (<= y 9.4e+123) (* z (- (* x y) (* b c))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = y * fma(-1.0, (i * j), (x * z));
double tmp;
if (y <= -6.1e+60) {
tmp = t_1;
} else if (y <= -7.7e-174) {
tmp = t * ((b * i) - (a * x));
} else if (y <= 3.5e+30) {
tmp = a * fma(-1.0, (t * x), (c * j));
} else if (y <= 9.4e+123) {
tmp = z * ((x * y) - (b * c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(y * fma(-1.0, Float64(i * j), Float64(x * z))) tmp = 0.0 if (y <= -6.1e+60) tmp = t_1; elseif (y <= -7.7e-174) tmp = Float64(t * Float64(Float64(b * i) - Float64(a * x))); elseif (y <= 3.5e+30) tmp = Float64(a * fma(-1.0, Float64(t * x), Float64(c * j))); elseif (y <= 9.4e+123) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(y * N[(-1.0 * N[(i * j), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.1e+60], t$95$1, If[LessEqual[y, -7.7e-174], N[(t * N[(N[(b * i), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+30], N[(a * N[(-1.0 * N[(t * x), $MachinePrecision] + N[(c * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.4e+123], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \mathsf{fma}\left(-1, i \cdot j, x \cdot z\right)\\
\mathbf{if}\;y \leq -6.1 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -7.7 \cdot 10^{-174}:\\
\;\;\;\;t \cdot \left(b \cdot i - a \cdot x\right)\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+30}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(-1, t \cdot x, c \cdot j\right)\\
\mathbf{elif}\;y \leq 9.4 \cdot 10^{+123}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.0999999999999999e60 or 9.39999999999999958e123 < y Initial program 72.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -6.0999999999999999e60 < y < -7.69999999999999963e-174Initial program 72.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f6458.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6458.7
Applied rewrites58.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -7.69999999999999963e-174 < y < 3.50000000000000021e30Initial program 72.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
if 3.50000000000000021e30 < y < 9.39999999999999958e123Initial program 72.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* y (fma -1.0 (* i j) (* x z)))))
(if (<= y -6.1e+60)
t_1
(if (<= y -7.7e-174)
(* t (- (* b i) (* a x)))
(if (<= y 3.5e+30)
(* a (fma -1.0 (* t x) (* c j)))
(if (<= y 9.4e+123) (* z (* y (+ x (* -1.0 (/ (* b c) y))))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = y * fma(-1.0, (i * j), (x * z));
double tmp;
if (y <= -6.1e+60) {
tmp = t_1;
} else if (y <= -7.7e-174) {
tmp = t * ((b * i) - (a * x));
} else if (y <= 3.5e+30) {
tmp = a * fma(-1.0, (t * x), (c * j));
} else if (y <= 9.4e+123) {
tmp = z * (y * (x + (-1.0 * ((b * c) / y))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(y * fma(-1.0, Float64(i * j), Float64(x * z))) tmp = 0.0 if (y <= -6.1e+60) tmp = t_1; elseif (y <= -7.7e-174) tmp = Float64(t * Float64(Float64(b * i) - Float64(a * x))); elseif (y <= 3.5e+30) tmp = Float64(a * fma(-1.0, Float64(t * x), Float64(c * j))); elseif (y <= 9.4e+123) tmp = Float64(z * Float64(y * Float64(x + Float64(-1.0 * Float64(Float64(b * c) / y))))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(y * N[(-1.0 * N[(i * j), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.1e+60], t$95$1, If[LessEqual[y, -7.7e-174], N[(t * N[(N[(b * i), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+30], N[(a * N[(-1.0 * N[(t * x), $MachinePrecision] + N[(c * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.4e+123], N[(z * N[(y * N[(x + N[(-1.0 * N[(N[(b * c), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \mathsf{fma}\left(-1, i \cdot j, x \cdot z\right)\\
\mathbf{if}\;y \leq -6.1 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -7.7 \cdot 10^{-174}:\\
\;\;\;\;t \cdot \left(b \cdot i - a \cdot x\right)\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+30}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(-1, t \cdot x, c \cdot j\right)\\
\mathbf{elif}\;y \leq 9.4 \cdot 10^{+123}:\\
\;\;\;\;z \cdot \left(y \cdot \left(x + -1 \cdot \frac{b \cdot c}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.0999999999999999e60 or 9.39999999999999958e123 < y Initial program 72.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -6.0999999999999999e60 < y < -7.69999999999999963e-174Initial program 72.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f6458.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6458.7
Applied rewrites58.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -7.69999999999999963e-174 < y < 3.50000000000000021e30Initial program 72.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
if 3.50000000000000021e30 < y < 9.39999999999999958e123Initial program 72.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6439.8
Applied rewrites39.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* t (fma (- x) a (* i b)))))
(if (<= t -4.6e-75)
t_1
(if (<= t 9e-89)
(* z (- (* x y) (* b c)))
(if (<= t 3.7e-5) (* j (- (* a c) (* i y))) 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 = t * fma(-x, a, (i * b));
double tmp;
if (t <= -4.6e-75) {
tmp = t_1;
} else if (t <= 9e-89) {
tmp = z * ((x * y) - (b * c));
} else if (t <= 3.7e-5) {
tmp = j * ((a * c) - (i * y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(t * fma(Float64(-x), a, Float64(i * b))) tmp = 0.0 if (t <= -4.6e-75) tmp = t_1; elseif (t <= 9e-89) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (t <= 3.7e-5) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(t * N[((-x) * a + N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.6e-75], t$95$1, If[LessEqual[t, 9e-89], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e-5], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(-x, a, i \cdot b\right)\\
\mathbf{if}\;t \leq -4.6 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-89}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-5}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.6e-75 or 3.69999999999999981e-5 < t Initial program 72.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f6458.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6458.7
Applied rewrites58.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6439.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
if -4.6e-75 < t < 8.9999999999999998e-89Initial program 72.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
if 8.9999999999999998e-89 < t < 3.69999999999999981e-5Initial program 72.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* t (- (* b i) (* a x)))))
(if (<= t -4.6e-75)
t_1
(if (<= t 9e-89)
(* z (- (* x y) (* b c)))
(if (<= t 3.7e-5) (* j (- (* a c) (* i y))) 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 = t * ((b * i) - (a * x));
double tmp;
if (t <= -4.6e-75) {
tmp = t_1;
} else if (t <= 9e-89) {
tmp = z * ((x * y) - (b * c));
} else if (t <= 3.7e-5) {
tmp = j * ((a * c) - (i * y));
} 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 = t * ((b * i) - (a * x))
if (t <= (-4.6d-75)) then
tmp = t_1
else if (t <= 9d-89) then
tmp = z * ((x * y) - (b * c))
else if (t <= 3.7d-5) then
tmp = j * ((a * c) - (i * y))
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 = t * ((b * i) - (a * x));
double tmp;
if (t <= -4.6e-75) {
tmp = t_1;
} else if (t <= 9e-89) {
tmp = z * ((x * y) - (b * c));
} else if (t <= 3.7e-5) {
tmp = j * ((a * c) - (i * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = t * ((b * i) - (a * x)) tmp = 0 if t <= -4.6e-75: tmp = t_1 elif t <= 9e-89: tmp = z * ((x * y) - (b * c)) elif t <= 3.7e-5: tmp = j * ((a * c) - (i * y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(t * Float64(Float64(b * i) - Float64(a * x))) tmp = 0.0 if (t <= -4.6e-75) tmp = t_1; elseif (t <= 9e-89) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (t <= 3.7e-5) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = t * ((b * i) - (a * x)); tmp = 0.0; if (t <= -4.6e-75) tmp = t_1; elseif (t <= 9e-89) tmp = z * ((x * y) - (b * c)); elseif (t <= 3.7e-5) tmp = j * ((a * c) - (i * y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(t * N[(N[(b * i), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.6e-75], t$95$1, If[LessEqual[t, 9e-89], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e-5], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b \cdot i - a \cdot x\right)\\
\mathbf{if}\;t \leq -4.6 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-89}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-5}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.6e-75 or 3.69999999999999981e-5 < t Initial program 72.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f6458.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6458.7
Applied rewrites58.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -4.6e-75 < t < 8.9999999999999998e-89Initial program 72.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
if 8.9999999999999998e-89 < t < 3.69999999999999981e-5Initial program 72.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* t (- (* b i) (* a x)))))
(if (<= t -4.5e-32)
t_1
(if (<= t 5e-177)
(* c (- (* a j) (* b z)))
(if (<= t 3.7e-5) (* j (- (* a c) (* i y))) 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 = t * ((b * i) - (a * x));
double tmp;
if (t <= -4.5e-32) {
tmp = t_1;
} else if (t <= 5e-177) {
tmp = c * ((a * j) - (b * z));
} else if (t <= 3.7e-5) {
tmp = j * ((a * c) - (i * y));
} 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 = t * ((b * i) - (a * x))
if (t <= (-4.5d-32)) then
tmp = t_1
else if (t <= 5d-177) then
tmp = c * ((a * j) - (b * z))
else if (t <= 3.7d-5) then
tmp = j * ((a * c) - (i * y))
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 = t * ((b * i) - (a * x));
double tmp;
if (t <= -4.5e-32) {
tmp = t_1;
} else if (t <= 5e-177) {
tmp = c * ((a * j) - (b * z));
} else if (t <= 3.7e-5) {
tmp = j * ((a * c) - (i * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = t * ((b * i) - (a * x)) tmp = 0 if t <= -4.5e-32: tmp = t_1 elif t <= 5e-177: tmp = c * ((a * j) - (b * z)) elif t <= 3.7e-5: tmp = j * ((a * c) - (i * y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(t * Float64(Float64(b * i) - Float64(a * x))) tmp = 0.0 if (t <= -4.5e-32) tmp = t_1; elseif (t <= 5e-177) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); elseif (t <= 3.7e-5) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = t * ((b * i) - (a * x)); tmp = 0.0; if (t <= -4.5e-32) tmp = t_1; elseif (t <= 5e-177) tmp = c * ((a * j) - (b * z)); elseif (t <= 3.7e-5) tmp = j * ((a * c) - (i * y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(t * N[(N[(b * i), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e-32], t$95$1, If[LessEqual[t, 5e-177], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e-5], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b \cdot i - a \cdot x\right)\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-177}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-5}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.50000000000000005e-32 or 3.69999999999999981e-5 < t Initial program 72.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f6458.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6458.7
Applied rewrites58.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -4.50000000000000005e-32 < t < 5e-177Initial program 72.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
if 5e-177 < t < 3.69999999999999981e-5Initial program 72.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* t (- (* b i) (* a x))))) (if (<= t -4.5e-32) t_1 (if (<= t 5.5e-8) (* c (- (* a j) (* b 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 = t * ((b * i) - (a * x));
double tmp;
if (t <= -4.5e-32) {
tmp = t_1;
} else if (t <= 5.5e-8) {
tmp = c * ((a * j) - (b * z));
} 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 = t * ((b * i) - (a * x))
if (t <= (-4.5d-32)) then
tmp = t_1
else if (t <= 5.5d-8) then
tmp = c * ((a * j) - (b * z))
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 = t * ((b * i) - (a * x));
double tmp;
if (t <= -4.5e-32) {
tmp = t_1;
} else if (t <= 5.5e-8) {
tmp = c * ((a * j) - (b * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = t * ((b * i) - (a * x)) tmp = 0 if t <= -4.5e-32: tmp = t_1 elif t <= 5.5e-8: tmp = c * ((a * j) - (b * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(t * Float64(Float64(b * i) - Float64(a * x))) tmp = 0.0 if (t <= -4.5e-32) tmp = t_1; elseif (t <= 5.5e-8) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = t * ((b * i) - (a * x)); tmp = 0.0; if (t <= -4.5e-32) tmp = t_1; elseif (t <= 5.5e-8) tmp = c * ((a * j) - (b * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(t * N[(N[(b * i), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e-32], t$95$1, If[LessEqual[t, 5.5e-8], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b \cdot i - a \cdot x\right)\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-8}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.50000000000000005e-32 or 5.5000000000000003e-8 < t Initial program 72.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f6458.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6458.7
Applied rewrites58.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -4.50000000000000005e-32 < t < 5.5000000000000003e-8Initial program 72.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* i t) (* c z)))))
(if (<= b -2.3e+39)
t_1
(if (<= b 8.4e-162)
(* t (- (* b i) (* a x)))
(if (<= b 1.2e+17) (* x (* y 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 = b * ((i * t) - (c * z));
double tmp;
if (b <= -2.3e+39) {
tmp = t_1;
} else if (b <= 8.4e-162) {
tmp = t * ((b * i) - (a * x));
} else if (b <= 1.2e+17) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = b * ((i * t) - (c * z))
if (b <= (-2.3d+39)) then
tmp = t_1
else if (b <= 8.4d-162) then
tmp = t * ((b * i) - (a * x))
else if (b <= 1.2d+17) then
tmp = x * (y * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((i * t) - (c * z));
double tmp;
if (b <= -2.3e+39) {
tmp = t_1;
} else if (b <= 8.4e-162) {
tmp = t * ((b * i) - (a * x));
} else if (b <= 1.2e+17) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * ((i * t) - (c * z)) tmp = 0 if b <= -2.3e+39: tmp = t_1 elif b <= 8.4e-162: tmp = t * ((b * i) - (a * x)) elif b <= 1.2e+17: tmp = x * (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(i * t) - Float64(c * z))) tmp = 0.0 if (b <= -2.3e+39) tmp = t_1; elseif (b <= 8.4e-162) tmp = Float64(t * Float64(Float64(b * i) - Float64(a * x))); elseif (b <= 1.2e+17) tmp = Float64(x * Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = b * ((i * t) - (c * z)); tmp = 0.0; if (b <= -2.3e+39) tmp = t_1; elseif (b <= 8.4e-162) tmp = t * ((b * i) - (a * x)); elseif (b <= 1.2e+17) tmp = x * (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.3e+39], t$95$1, If[LessEqual[b, 8.4e-162], N[(t * N[(N[(b * i), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.2e+17], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{if}\;b \leq -2.3 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 8.4 \cdot 10^{-162}:\\
\;\;\;\;t \cdot \left(b \cdot i - a \cdot x\right)\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{+17}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.30000000000000012e39 or 1.2e17 < b Initial program 72.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
if -2.30000000000000012e39 < b < 8.4e-162Initial program 72.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f6458.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6458.7
Applied rewrites58.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if 8.4e-162 < b < 1.2e17Initial program 72.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6421.8
Applied rewrites21.8%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* t (- (* b i) (* a x))))) (if (<= t -2.9e-92) t_1 (if (<= t 1.1e-87) (* x (* y 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 = t * ((b * i) - (a * x));
double tmp;
if (t <= -2.9e-92) {
tmp = t_1;
} else if (t <= 1.1e-87) {
tmp = x * (y * z);
} 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 = t * ((b * i) - (a * x))
if (t <= (-2.9d-92)) then
tmp = t_1
else if (t <= 1.1d-87) then
tmp = x * (y * z)
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 = t * ((b * i) - (a * x));
double tmp;
if (t <= -2.9e-92) {
tmp = t_1;
} else if (t <= 1.1e-87) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = t * ((b * i) - (a * x)) tmp = 0 if t <= -2.9e-92: tmp = t_1 elif t <= 1.1e-87: tmp = x * (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(t * Float64(Float64(b * i) - Float64(a * x))) tmp = 0.0 if (t <= -2.9e-92) tmp = t_1; elseif (t <= 1.1e-87) tmp = Float64(x * Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = t * ((b * i) - (a * x)); tmp = 0.0; if (t <= -2.9e-92) tmp = t_1; elseif (t <= 1.1e-87) tmp = x * (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(t * N[(N[(b * i), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.9e-92], t$95$1, If[LessEqual[t, 1.1e-87], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b \cdot i - a \cdot x\right)\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-87}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.89999999999999985e-92 or 1.09999999999999994e-87 < t Initial program 72.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f6458.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6458.7
Applied rewrites58.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -2.89999999999999985e-92 < t < 1.09999999999999994e-87Initial program 72.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6421.8
Applied rewrites21.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (* y z))))
(if (<= b -2.4e+39)
(* z (* -1.0 (* b c)))
(if (<= b -7e-104)
t_1
(if (<= b 3.6e-162)
(* -1.0 (* a (* t x)))
(if (<= b 1.25e+17) t_1 (* b (* i t))))))))
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);
double tmp;
if (b <= -2.4e+39) {
tmp = z * (-1.0 * (b * c));
} else if (b <= -7e-104) {
tmp = t_1;
} else if (b <= 3.6e-162) {
tmp = -1.0 * (a * (t * x));
} else if (b <= 1.25e+17) {
tmp = t_1;
} else {
tmp = b * (i * t);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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 = x * (y * z)
if (b <= (-2.4d+39)) then
tmp = z * ((-1.0d0) * (b * c))
else if (b <= (-7d-104)) then
tmp = t_1
else if (b <= 3.6d-162) then
tmp = (-1.0d0) * (a * (t * x))
else if (b <= 1.25d+17) then
tmp = t_1
else
tmp = b * (i * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * (y * z);
double tmp;
if (b <= -2.4e+39) {
tmp = z * (-1.0 * (b * c));
} else if (b <= -7e-104) {
tmp = t_1;
} else if (b <= 3.6e-162) {
tmp = -1.0 * (a * (t * x));
} else if (b <= 1.25e+17) {
tmp = t_1;
} else {
tmp = b * (i * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * (y * z) tmp = 0 if b <= -2.4e+39: tmp = z * (-1.0 * (b * c)) elif b <= -7e-104: tmp = t_1 elif b <= 3.6e-162: tmp = -1.0 * (a * (t * x)) elif b <= 1.25e+17: tmp = t_1 else: tmp = b * (i * t) return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(y * z)) tmp = 0.0 if (b <= -2.4e+39) tmp = Float64(z * Float64(-1.0 * Float64(b * c))); elseif (b <= -7e-104) tmp = t_1; elseif (b <= 3.6e-162) tmp = Float64(-1.0 * Float64(a * Float64(t * x))); elseif (b <= 1.25e+17) tmp = t_1; else tmp = Float64(b * Float64(i * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = x * (y * z); tmp = 0.0; if (b <= -2.4e+39) tmp = z * (-1.0 * (b * c)); elseif (b <= -7e-104) tmp = t_1; elseif (b <= 3.6e-162) tmp = -1.0 * (a * (t * x)); elseif (b <= 1.25e+17) tmp = t_1; else tmp = b * (i * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.4e+39], N[(z * N[(-1.0 * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -7e-104], t$95$1, If[LessEqual[b, 3.6e-162], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.25e+17], t$95$1, N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;b \leq -2.4 \cdot 10^{+39}:\\
\;\;\;\;z \cdot \left(-1 \cdot \left(b \cdot c\right)\right)\\
\mathbf{elif}\;b \leq -7 \cdot 10^{-104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{-162}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\
\mathbf{elif}\;b \leq 1.25 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\end{array}
\end{array}
if b < -2.4000000000000001e39Initial program 72.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if -2.4000000000000001e39 < b < -7.00000000000000057e-104 or 3.5999999999999998e-162 < b < 1.25e17Initial program 72.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6421.8
Applied rewrites21.8%
if -7.00000000000000057e-104 < b < 3.5999999999999998e-162Initial program 72.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
if 1.25e17 < b Initial program 72.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
Taylor expanded in z around 0
lower-*.f6422.3
Applied rewrites22.3%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= x -2.6e-15)
(* x (* y z))
(if (<= x 8e-268)
(* b (* -1.0 (* c z)))
(if (<= x 8.6e+71) (* -1.0 (* i (* j y))) (* -1.0 (* a (* t x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -2.6e-15) {
tmp = x * (y * z);
} else if (x <= 8e-268) {
tmp = b * (-1.0 * (c * z));
} else if (x <= 8.6e+71) {
tmp = -1.0 * (i * (j * y));
} else {
tmp = -1.0 * (a * (t * x));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (x <= (-2.6d-15)) then
tmp = x * (y * z)
else if (x <= 8d-268) then
tmp = b * ((-1.0d0) * (c * z))
else if (x <= 8.6d+71) then
tmp = (-1.0d0) * (i * (j * y))
else
tmp = (-1.0d0) * (a * (t * x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -2.6e-15) {
tmp = x * (y * z);
} else if (x <= 8e-268) {
tmp = b * (-1.0 * (c * z));
} else if (x <= 8.6e+71) {
tmp = -1.0 * (i * (j * y));
} else {
tmp = -1.0 * (a * (t * x));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -2.6e-15: tmp = x * (y * z) elif x <= 8e-268: tmp = b * (-1.0 * (c * z)) elif x <= 8.6e+71: tmp = -1.0 * (i * (j * y)) else: tmp = -1.0 * (a * (t * x)) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -2.6e-15) tmp = Float64(x * Float64(y * z)); elseif (x <= 8e-268) tmp = Float64(b * Float64(-1.0 * Float64(c * z))); elseif (x <= 8.6e+71) tmp = Float64(-1.0 * Float64(i * Float64(j * y))); else tmp = Float64(-1.0 * Float64(a * Float64(t * x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (x <= -2.6e-15) tmp = x * (y * z); elseif (x <= 8e-268) tmp = b * (-1.0 * (c * z)); elseif (x <= 8.6e+71) tmp = -1.0 * (i * (j * y)); else tmp = -1.0 * (a * (t * x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -2.6e-15], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-268], N[(b * N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.6e+71], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-268}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{+71}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\
\end{array}
\end{array}
if x < -2.60000000000000004e-15Initial program 72.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6421.8
Applied rewrites21.8%
if -2.60000000000000004e-15 < x < 7.99999999999999966e-268Initial program 72.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if 7.99999999999999966e-268 < x < 8.59999999999999967e71Initial program 72.5%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
if 8.59999999999999967e71 < x Initial program 72.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (* y z))))
(if (<= y -2.9e+125)
t_1
(if (<= y -6.8e-121)
(* t (* b i))
(if (<= y 1.08e-20) (* a (* c 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 = x * (y * z);
double tmp;
if (y <= -2.9e+125) {
tmp = t_1;
} else if (y <= -6.8e-121) {
tmp = t * (b * i);
} else if (y <= 1.08e-20) {
tmp = a * (c * 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 = x * (y * z)
if (y <= (-2.9d+125)) then
tmp = t_1
else if (y <= (-6.8d-121)) then
tmp = t * (b * i)
else if (y <= 1.08d-20) then
tmp = a * (c * 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 = x * (y * z);
double tmp;
if (y <= -2.9e+125) {
tmp = t_1;
} else if (y <= -6.8e-121) {
tmp = t * (b * i);
} else if (y <= 1.08e-20) {
tmp = a * (c * j);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * (y * z) tmp = 0 if y <= -2.9e+125: tmp = t_1 elif y <= -6.8e-121: tmp = t * (b * i) elif y <= 1.08e-20: tmp = a * (c * j) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(y * z)) tmp = 0.0 if (y <= -2.9e+125) tmp = t_1; elseif (y <= -6.8e-121) tmp = Float64(t * Float64(b * i)); elseif (y <= 1.08e-20) tmp = Float64(a * Float64(c * j)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = x * (y * z); tmp = 0.0; if (y <= -2.9e+125) tmp = t_1; elseif (y <= -6.8e-121) tmp = t * (b * i); elseif (y <= 1.08e-20) tmp = a * (c * 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[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.9e+125], t$95$1, If[LessEqual[y, -6.8e-121], N[(t * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.08e-20], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6.8 \cdot 10^{-121}:\\
\;\;\;\;t \cdot \left(b \cdot i\right)\\
\mathbf{elif}\;y \leq 1.08 \cdot 10^{-20}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.89999999999999993e125 or 1.08e-20 < y Initial program 72.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6421.8
Applied rewrites21.8%
if -2.89999999999999993e125 < y < -6.80000000000000003e-121Initial program 72.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
Taylor expanded in z around 0
lower-*.f6422.2
Applied rewrites22.2%
if -6.80000000000000003e-121 < y < 1.08e-20Initial program 72.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-to-multN/A
associate-*l*N/A
lower-fma.f64N/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6458.9
lift--.f64N/A
Applied rewrites60.0%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.7
Applied rewrites36.7%
Taylor expanded in y around 0
Applied rewrites21.9%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* t (* b i)))) (if (<= t -3.4e+23) t_1 (if (<= t 1.25e-66) (* a (* c 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 = t * (b * i);
double tmp;
if (t <= -3.4e+23) {
tmp = t_1;
} else if (t <= 1.25e-66) {
tmp = a * (c * 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 = t * (b * i)
if (t <= (-3.4d+23)) then
tmp = t_1
else if (t <= 1.25d-66) then
tmp = a * (c * 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 = t * (b * i);
double tmp;
if (t <= -3.4e+23) {
tmp = t_1;
} else if (t <= 1.25e-66) {
tmp = a * (c * j);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = t * (b * i) tmp = 0 if t <= -3.4e+23: tmp = t_1 elif t <= 1.25e-66: tmp = a * (c * j) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(t * Float64(b * i)) tmp = 0.0 if (t <= -3.4e+23) tmp = t_1; elseif (t <= 1.25e-66) tmp = Float64(a * Float64(c * j)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = t * (b * i); tmp = 0.0; if (t <= -3.4e+23) tmp = t_1; elseif (t <= 1.25e-66) tmp = a * (c * 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[(t * N[(b * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e+23], t$95$1, If[LessEqual[t, 1.25e-66], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b \cdot i\right)\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-66}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.39999999999999992e23 or 1.2499999999999999e-66 < t Initial program 72.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
Taylor expanded in z around 0
lower-*.f6422.2
Applied rewrites22.2%
if -3.39999999999999992e23 < t < 1.2499999999999999e-66Initial program 72.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-to-multN/A
associate-*l*N/A
lower-fma.f64N/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6458.9
lift--.f64N/A
Applied rewrites60.0%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.7
Applied rewrites36.7%
Taylor expanded in y around 0
Applied rewrites21.9%
(FPCore (x y z t a b c i j) :precision binary64 (* a (* c j)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * (c * j);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = a * (c * j)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * (c * j);
}
def code(x, y, z, t, a, b, c, i, j): return a * (c * j)
function code(x, y, z, t, a, b, c, i, j) return Float64(a * Float64(c * j)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = a * (c * j); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \left(c \cdot j\right)
\end{array}
Initial program 72.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-to-multN/A
associate-*l*N/A
lower-fma.f64N/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6458.9
lift--.f64N/A
Applied rewrites60.0%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.7
Applied rewrites36.7%
Taylor expanded in y around 0
Applied rewrites21.9%
herbie shell --seed 2025142
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))