
(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 17 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))))
(* j (- (* c a) (* y i))))))
(if (<= t_1 INFINITY) t_1 (* c (- (* a j) (* b z))))))
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 = c * ((a * j) - (b * z));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = c * ((a * j) - (b * z));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = c * ((a * j) - (b * z)) 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(c * Float64(Float64(a * j) - Float64(b * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = c * ((a * j) - (b * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $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}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\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 73.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 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(fma
(* i t)
b
(- (fma (* a c) j (* (- (* y x) (* c b)) z)) (* (* t x) a)))))
(if (<= t -1.16e+283)
(* a (- (* c j) (* t x)))
(if (<= t -4.5e-112)
t_1
(if (<= t 2.6e-150)
(- (fma j (- (* a c) (* i y)) (* x (* y z))) (* b (* c z)))
(if (<= t 7e+125) t_1 (* (- (* i b) (* a x)) t)))))))
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 * t), b, (fma((a * c), j, (((y * x) - (c * b)) * z)) - ((t * x) * a)));
double tmp;
if (t <= -1.16e+283) {
tmp = a * ((c * j) - (t * x));
} else if (t <= -4.5e-112) {
tmp = t_1;
} else if (t <= 2.6e-150) {
tmp = fma(j, ((a * c) - (i * y)), (x * (y * z))) - (b * (c * z));
} else if (t <= 7e+125) {
tmp = t_1;
} else {
tmp = ((i * b) - (a * x)) * t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(i * t), b, Float64(fma(Float64(a * c), j, Float64(Float64(Float64(y * x) - Float64(c * b)) * z)) - Float64(Float64(t * x) * a))) tmp = 0.0 if (t <= -1.16e+283) tmp = Float64(a * Float64(Float64(c * j) - Float64(t * x))); elseif (t <= -4.5e-112) tmp = t_1; elseif (t <= 2.6e-150) tmp = Float64(fma(j, Float64(Float64(a * c) - Float64(i * y)), Float64(x * Float64(y * z))) - Float64(b * Float64(c * z))); elseif (t <= 7e+125) tmp = t_1; else tmp = Float64(Float64(Float64(i * b) - Float64(a * x)) * t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * t), $MachinePrecision] * b + N[(N[(N[(a * c), $MachinePrecision] * j + N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t * x), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.16e+283], N[(a * N[(N[(c * j), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.5e-112], t$95$1, If[LessEqual[t, 2.6e-150], N[(N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e+125], t$95$1, N[(N[(N[(i * b), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i \cdot t, b, \mathsf{fma}\left(a \cdot c, j, \left(y \cdot x - c \cdot b\right) \cdot z\right) - \left(t \cdot x\right) \cdot a\right)\\
\mathbf{if}\;t \leq -1.16 \cdot 10^{+283}:\\
\;\;\;\;a \cdot \left(c \cdot j - t \cdot x\right)\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{-112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-150}:\\
\;\;\;\;\mathsf{fma}\left(j, a \cdot c - i \cdot y, x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot b - a \cdot x\right) \cdot t\\
\end{array}
\end{array}
if t < -1.16000000000000006e283Initial program 73.5%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites73.2%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identityN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6474.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites74.7%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
if -1.16000000000000006e283 < t < -4.50000000000000012e-112 or 2.5999999999999998e-150 < t < 7.00000000000000023e125Initial program 73.5%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites73.2%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identityN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6474.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites74.7%
Taylor expanded in y around 0
lower-*.f6467.8
Applied rewrites67.8%
if -4.50000000000000012e-112 < t < 2.5999999999999998e-150Initial program 73.5%
Taylor expanded in t 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-*.f6456.8
Applied rewrites56.8%
if 7.00000000000000023e125 < t Initial program 73.5%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6440.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (fma a (* c j) (* z (- (* x y) (* b c)))) (* a (* t x))))
(t_2 (* (- (* i b) (* a x)) t)))
(if (<= t -1.16e+188)
t_2
(if (<= t -1.02e-112)
t_1
(if (<= t 7.5e-249)
(+ (* x (* y z)) (* j (- (* c a) (* y i))))
(if (<= t 7e+125) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(a, (c * j), (z * ((x * y) - (b * c)))) - (a * (t * x));
double t_2 = ((i * b) - (a * x)) * t;
double tmp;
if (t <= -1.16e+188) {
tmp = t_2;
} else if (t <= -1.02e-112) {
tmp = t_1;
} else if (t <= 7.5e-249) {
tmp = (x * (y * z)) + (j * ((c * a) - (y * i)));
} else if (t <= 7e+125) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(a, Float64(c * j), Float64(z * Float64(Float64(x * y) - Float64(b * c)))) - Float64(a * Float64(t * x))) t_2 = Float64(Float64(Float64(i * b) - Float64(a * x)) * t) tmp = 0.0 if (t <= -1.16e+188) tmp = t_2; elseif (t <= -1.02e-112) tmp = t_1; elseif (t <= 7.5e-249) tmp = Float64(Float64(x * Float64(y * z)) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (t <= 7e+125) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(a * N[(c * j), $MachinePrecision] + N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(i * b), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.16e+188], t$95$2, If[LessEqual[t, -1.02e-112], t$95$1, If[LessEqual[t, 7.5e-249], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e+125], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, c \cdot j, z \cdot \left(x \cdot y - b \cdot c\right)\right) - a \cdot \left(t \cdot x\right)\\
t_2 := \left(i \cdot b - a \cdot x\right) \cdot t\\
\mathbf{if}\;t \leq -1.16 \cdot 10^{+188}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.02 \cdot 10^{-112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-249}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -1.16e188 or 7.00000000000000023e125 < t Initial program 73.5%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6440.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
if -1.16e188 < t < -1.01999999999999996e-112 or 7.50000000000000034e-249 < t < 7.00000000000000023e125Initial program 73.5%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites73.2%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identityN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6474.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites74.7%
Taylor expanded in i 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-*.f6459.4
Applied rewrites59.4%
if -1.01999999999999996e-112 < t < 7.50000000000000034e-249Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6448.2
Applied rewrites48.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* i b) (* a x)) t)))
(if (<= t -1.16e+188)
t_1
(if (<= t -4.8e-112)
(- (fma a (* c j) (* z (- (* x y) (* b c)))) (* a (* t x)))
(if (<= t 1.55e+64)
(- (fma j (- (* a c) (* i y)) (* x (* y z))) (* b (* c z)))
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * b) - (a * x)) * t;
double tmp;
if (t <= -1.16e+188) {
tmp = t_1;
} else if (t <= -4.8e-112) {
tmp = fma(a, (c * j), (z * ((x * y) - (b * c)))) - (a * (t * x));
} else if (t <= 1.55e+64) {
tmp = fma(j, ((a * c) - (i * y)), (x * (y * z))) - (b * (c * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * b) - Float64(a * x)) * t) tmp = 0.0 if (t <= -1.16e+188) tmp = t_1; elseif (t <= -4.8e-112) tmp = Float64(fma(a, Float64(c * j), Float64(z * Float64(Float64(x * y) - Float64(b * c)))) - Float64(a * Float64(t * x))); elseif (t <= 1.55e+64) tmp = Float64(fma(j, Float64(Float64(a * c) - Float64(i * y)), Float64(x * Float64(y * z))) - Float64(b * Float64(c * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * b), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.16e+188], t$95$1, If[LessEqual[t, -4.8e-112], N[(N[(a * N[(c * j), $MachinePrecision] + N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e+64], N[(N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot b - a \cdot x\right) \cdot t\\
\mathbf{if}\;t \leq -1.16 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.8 \cdot 10^{-112}:\\
\;\;\;\;\mathsf{fma}\left(a, c \cdot j, z \cdot \left(x \cdot y - b \cdot c\right)\right) - a \cdot \left(t \cdot x\right)\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(j, a \cdot c - i \cdot y, x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.16e188 or 1.55e64 < t Initial program 73.5%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6440.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
if -1.16e188 < t < -4.8000000000000001e-112Initial program 73.5%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites73.2%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identityN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6474.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites74.7%
Taylor expanded in i 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-*.f6459.4
Applied rewrites59.4%
if -4.8000000000000001e-112 < t < 1.55e64Initial program 73.5%
Taylor expanded in t 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-*.f6456.8
Applied rewrites56.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (+ (* x (* y z)) (* j (- (* c a) (* y i)))))
(t_2 (* (- (* i b) (* a x)) t)))
(if (<= t -2.8e+95)
t_2
(if (<= t 7.8e-233)
t_1
(if (<= t 7.5e-31)
(* c (- (* a j) (* b z)))
(if (<= t 1.55e+64) 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)) + (j * ((c * a) - (y * i)));
double t_2 = ((i * b) - (a * x)) * t;
double tmp;
if (t <= -2.8e+95) {
tmp = t_2;
} else if (t <= 7.8e-233) {
tmp = t_1;
} else if (t <= 7.5e-31) {
tmp = c * ((a * j) - (b * z));
} else if (t <= 1.55e+64) {
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)) + (j * ((c * a) - (y * i)))
t_2 = ((i * b) - (a * x)) * t
if (t <= (-2.8d+95)) then
tmp = t_2
else if (t <= 7.8d-233) then
tmp = t_1
else if (t <= 7.5d-31) then
tmp = c * ((a * j) - (b * z))
else if (t <= 1.55d+64) 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)) + (j * ((c * a) - (y * i)));
double t_2 = ((i * b) - (a * x)) * t;
double tmp;
if (t <= -2.8e+95) {
tmp = t_2;
} else if (t <= 7.8e-233) {
tmp = t_1;
} else if (t <= 7.5e-31) {
tmp = c * ((a * j) - (b * z));
} else if (t <= 1.55e+64) {
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)) + (j * ((c * a) - (y * i))) t_2 = ((i * b) - (a * x)) * t tmp = 0 if t <= -2.8e+95: tmp = t_2 elif t <= 7.8e-233: tmp = t_1 elif t <= 7.5e-31: tmp = c * ((a * j) - (b * z)) elif t <= 1.55e+64: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(x * Float64(y * z)) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) t_2 = Float64(Float64(Float64(i * b) - Float64(a * x)) * t) tmp = 0.0 if (t <= -2.8e+95) tmp = t_2; elseif (t <= 7.8e-233) tmp = t_1; elseif (t <= 7.5e-31) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); elseif (t <= 1.55e+64) 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)) + (j * ((c * a) - (y * i))); t_2 = ((i * b) - (a * x)) * t; tmp = 0.0; if (t <= -2.8e+95) tmp = t_2; elseif (t <= 7.8e-233) tmp = t_1; elseif (t <= 7.5e-31) tmp = c * ((a * j) - (b * z)); elseif (t <= 1.55e+64) 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[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(i * b), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2.8e+95], t$95$2, If[LessEqual[t, 7.8e-233], t$95$1, If[LessEqual[t, 7.5e-31], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e+64], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
t_2 := \left(i \cdot b - a \cdot x\right) \cdot t\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{+95}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-233}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-31}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.7999999999999998e95 or 1.55e64 < t Initial program 73.5%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6440.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
if -2.7999999999999998e95 < t < 7.8000000000000002e-233 or 7.49999999999999975e-31 < t < 1.55e64Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6448.2
Applied rewrites48.2%
if 7.8000000000000002e-233 < t < 7.49999999999999975e-31Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= c -1.05e+41)
(fma (* j a) c (* (* (- z) b) c))
(if (<= c 2.2e-266)
(* (- (* i b) (* a x)) t)
(if (<= c 160000000000.0)
(* (- (* z x) (* j i)) y)
(* c (- (* a j) (* b z)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (c <= -1.05e+41) {
tmp = fma((j * a), c, ((-z * b) * c));
} else if (c <= 2.2e-266) {
tmp = ((i * b) - (a * x)) * t;
} else if (c <= 160000000000.0) {
tmp = ((z * x) - (j * i)) * y;
} else {
tmp = c * ((a * j) - (b * z));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (c <= -1.05e+41) tmp = fma(Float64(j * a), c, Float64(Float64(Float64(-z) * b) * c)); elseif (c <= 2.2e-266) tmp = Float64(Float64(Float64(i * b) - Float64(a * x)) * t); elseif (c <= 160000000000.0) tmp = Float64(Float64(Float64(z * x) - Float64(j * i)) * y); else tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[c, -1.05e+41], N[(N[(j * a), $MachinePrecision] * c + N[(N[((-z) * b), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.2e-266], N[(N[(N[(i * b), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[c, 160000000000.0], N[(N[(N[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.05 \cdot 10^{+41}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot a, c, \left(\left(-z\right) \cdot b\right) \cdot c\right)\\
\mathbf{elif}\;c \leq 2.2 \cdot 10^{-266}:\\
\;\;\;\;\left(i \cdot b - a \cdot x\right) \cdot t\\
\mathbf{elif}\;c \leq 160000000000:\\
\;\;\;\;\left(z \cdot x - j \cdot i\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\end{array}
\end{array}
if c < -1.05e41Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6438.4
Applied rewrites38.4%
if -1.05e41 < c < 2.2e-266Initial program 73.5%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6440.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
if 2.2e-266 < c < 1.6e11Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.1
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6438.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.1
Applied rewrites38.1%
if 1.6e11 < c Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (- (* a j) (* b z)))))
(if (<= c -1.05e+41)
t_1
(if (<= c 2.2e-266)
(* (- (* i b) (* a x)) t)
(if (<= c 160000000000.0) (* (- (* z x) (* j 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 = c * ((a * j) - (b * z));
double tmp;
if (c <= -1.05e+41) {
tmp = t_1;
} else if (c <= 2.2e-266) {
tmp = ((i * b) - (a * x)) * t;
} else if (c <= 160000000000.0) {
tmp = ((z * x) - (j * 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 = c * ((a * j) - (b * z))
if (c <= (-1.05d+41)) then
tmp = t_1
else if (c <= 2.2d-266) then
tmp = ((i * b) - (a * x)) * t
else if (c <= 160000000000.0d0) then
tmp = ((z * x) - (j * 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 = c * ((a * j) - (b * z));
double tmp;
if (c <= -1.05e+41) {
tmp = t_1;
} else if (c <= 2.2e-266) {
tmp = ((i * b) - (a * x)) * t;
} else if (c <= 160000000000.0) {
tmp = ((z * x) - (j * i)) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * ((a * j) - (b * z)) tmp = 0 if c <= -1.05e+41: tmp = t_1 elif c <= 2.2e-266: tmp = ((i * b) - (a * x)) * t elif c <= 160000000000.0: tmp = ((z * x) - (j * i)) * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(Float64(a * j) - Float64(b * z))) tmp = 0.0 if (c <= -1.05e+41) tmp = t_1; elseif (c <= 2.2e-266) tmp = Float64(Float64(Float64(i * b) - Float64(a * x)) * t); elseif (c <= 160000000000.0) tmp = Float64(Float64(Float64(z * x) - Float64(j * 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 = c * ((a * j) - (b * z)); tmp = 0.0; if (c <= -1.05e+41) tmp = t_1; elseif (c <= 2.2e-266) tmp = ((i * b) - (a * x)) * t; elseif (c <= 160000000000.0) tmp = ((z * x) - (j * 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[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.05e+41], t$95$1, If[LessEqual[c, 2.2e-266], N[(N[(N[(i * b), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[c, 160000000000.0], N[(N[(N[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{if}\;c \leq -1.05 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 2.2 \cdot 10^{-266}:\\
\;\;\;\;\left(i \cdot b - a \cdot x\right) \cdot t\\
\mathbf{elif}\;c \leq 160000000000:\\
\;\;\;\;\left(z \cdot x - j \cdot i\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.05e41 or 1.6e11 < c Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
if -1.05e41 < c < 2.2e-266Initial program 73.5%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6440.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
if 2.2e-266 < c < 1.6e11Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.1
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6438.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.1
Applied rewrites38.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* i t) (* c z)))))
(if (<= b -1.75e+22)
t_1
(if (<= b -1.02e-60)
(* z (- (* x y) (* b c)))
(if (<= b 5.6e+65) (* a (- (* c j) (* t x))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((i * t) - (c * z));
double tmp;
if (b <= -1.75e+22) {
tmp = t_1;
} else if (b <= -1.02e-60) {
tmp = z * ((x * y) - (b * c));
} else if (b <= 5.6e+65) {
tmp = a * ((c * j) - (t * x));
} 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 <= (-1.75d+22)) then
tmp = t_1
else if (b <= (-1.02d-60)) then
tmp = z * ((x * y) - (b * c))
else if (b <= 5.6d+65) then
tmp = a * ((c * j) - (t * x))
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 <= -1.75e+22) {
tmp = t_1;
} else if (b <= -1.02e-60) {
tmp = z * ((x * y) - (b * c));
} else if (b <= 5.6e+65) {
tmp = a * ((c * j) - (t * x));
} 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 <= -1.75e+22: tmp = t_1 elif b <= -1.02e-60: tmp = z * ((x * y) - (b * c)) elif b <= 5.6e+65: tmp = a * ((c * j) - (t * x)) 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 <= -1.75e+22) tmp = t_1; elseif (b <= -1.02e-60) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (b <= 5.6e+65) tmp = Float64(a * Float64(Float64(c * j) - Float64(t * x))); 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 <= -1.75e+22) tmp = t_1; elseif (b <= -1.02e-60) tmp = z * ((x * y) - (b * c)); elseif (b <= 5.6e+65) tmp = a * ((c * j) - (t * x)); 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, -1.75e+22], t$95$1, If[LessEqual[b, -1.02e-60], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.6e+65], N[(a * N[(N[(c * j), $MachinePrecision] - N[(t * x), $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 -1.75 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.02 \cdot 10^{-60}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+65}:\\
\;\;\;\;a \cdot \left(c \cdot j - t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.75e22 or 5.5999999999999998e65 < b Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
if -1.75e22 < b < -1.01999999999999994e-60Initial program 73.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
if -1.01999999999999994e-60 < b < 5.5999999999999998e65Initial program 73.5%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites73.2%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identityN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6474.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites74.7%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* c (- (* a j) (* b z))))) (if (<= c -1.05e+41) t_1 (if (<= c 84.0) (* (- (* i b) (* a x)) t) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * ((a * j) - (b * z));
double tmp;
if (c <= -1.05e+41) {
tmp = t_1;
} else if (c <= 84.0) {
tmp = ((i * b) - (a * x)) * t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a * j) - (b * z))
if (c <= (-1.05d+41)) then
tmp = t_1
else if (c <= 84.0d0) then
tmp = ((i * b) - (a * x)) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * ((a * j) - (b * z));
double tmp;
if (c <= -1.05e+41) {
tmp = t_1;
} else if (c <= 84.0) {
tmp = ((i * b) - (a * x)) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * ((a * j) - (b * z)) tmp = 0 if c <= -1.05e+41: tmp = t_1 elif c <= 84.0: tmp = ((i * b) - (a * x)) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(Float64(a * j) - Float64(b * z))) tmp = 0.0 if (c <= -1.05e+41) tmp = t_1; elseif (c <= 84.0) tmp = Float64(Float64(Float64(i * b) - Float64(a * x)) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = c * ((a * j) - (b * z)); tmp = 0.0; if (c <= -1.05e+41) tmp = t_1; elseif (c <= 84.0) tmp = ((i * b) - (a * x)) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.05e+41], t$95$1, If[LessEqual[c, 84.0], N[(N[(N[(i * b), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{if}\;c \leq -1.05 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 84:\\
\;\;\;\;\left(i \cdot b - a \cdot x\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.05e41 or 84 < c Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
if -1.05e41 < c < 84Initial program 73.5%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6440.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* b (- (* i t) (* c z))))) (if (<= b -1.9e-48) t_1 (if (<= b 5.6e+65) (* a (- (* c j) (* t x))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((i * t) - (c * z));
double tmp;
if (b <= -1.9e-48) {
tmp = t_1;
} else if (b <= 5.6e+65) {
tmp = a * ((c * j) - (t * x));
} 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 <= (-1.9d-48)) then
tmp = t_1
else if (b <= 5.6d+65) then
tmp = a * ((c * j) - (t * x))
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 <= -1.9e-48) {
tmp = t_1;
} else if (b <= 5.6e+65) {
tmp = a * ((c * j) - (t * x));
} 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 <= -1.9e-48: tmp = t_1 elif b <= 5.6e+65: tmp = a * ((c * j) - (t * x)) 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 <= -1.9e-48) tmp = t_1; elseif (b <= 5.6e+65) tmp = Float64(a * Float64(Float64(c * j) - Float64(t * x))); 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 <= -1.9e-48) tmp = t_1; elseif (b <= 5.6e+65) tmp = a * ((c * j) - (t * x)); 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, -1.9e-48], t$95$1, If[LessEqual[b, 5.6e+65], N[(a * N[(N[(c * j), $MachinePrecision] - N[(t * x), $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 -1.9 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+65}:\\
\;\;\;\;a \cdot \left(c \cdot j - t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.90000000000000001e-48 or 5.5999999999999998e65 < b Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
if -1.90000000000000001e-48 < b < 5.5999999999999998e65Initial program 73.5%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites73.2%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identityN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6474.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites74.7%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* a (- (* c j) (* t x)))))
(if (<= a -0.00012)
t_1
(if (<= a 1.45e-171)
(* -1.0 (* i (* j y)))
(if (<= a 5.8e-29) (* b (* i 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 = a * ((c * j) - (t * x));
double tmp;
if (a <= -0.00012) {
tmp = t_1;
} else if (a <= 1.45e-171) {
tmp = -1.0 * (i * (j * y));
} else if (a <= 5.8e-29) {
tmp = b * (i * t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = a * ((c * j) - (t * x))
if (a <= (-0.00012d0)) then
tmp = t_1
else if (a <= 1.45d-171) then
tmp = (-1.0d0) * (i * (j * y))
else if (a <= 5.8d-29) then
tmp = b * (i * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = a * ((c * j) - (t * x));
double tmp;
if (a <= -0.00012) {
tmp = t_1;
} else if (a <= 1.45e-171) {
tmp = -1.0 * (i * (j * y));
} else if (a <= 5.8e-29) {
tmp = b * (i * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = a * ((c * j) - (t * x)) tmp = 0 if a <= -0.00012: tmp = t_1 elif a <= 1.45e-171: tmp = -1.0 * (i * (j * y)) elif a <= 5.8e-29: tmp = b * (i * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(a * Float64(Float64(c * j) - Float64(t * x))) tmp = 0.0 if (a <= -0.00012) tmp = t_1; elseif (a <= 1.45e-171) tmp = Float64(-1.0 * Float64(i * Float64(j * y))); elseif (a <= 5.8e-29) tmp = Float64(b * Float64(i * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = a * ((c * j) - (t * x)); tmp = 0.0; if (a <= -0.00012) tmp = t_1; elseif (a <= 1.45e-171) tmp = -1.0 * (i * (j * y)); elseif (a <= 5.8e-29) tmp = b * (i * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(a * N[(N[(c * j), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.00012], t$95$1, If[LessEqual[a, 1.45e-171], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.8e-29], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(c \cdot j - t \cdot x\right)\\
\mathbf{if}\;a \leq -0.00012:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{-171}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{-29}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.20000000000000003e-4 or 5.80000000000000048e-29 < a Initial program 73.5%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites73.2%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identityN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6474.7
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites74.7%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
if -1.20000000000000003e-4 < a < 1.4499999999999999e-171Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6421.2
Applied rewrites21.2%
if 1.4499999999999999e-171 < a < 5.80000000000000048e-29Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in z around 0
lower-*.f6422.7
Applied rewrites22.7%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= c -1e-26)
(* c (* a j))
(if (<= c 2.55e-266)
(* -1.0 (* a (* t x)))
(if (<= c 1.2e+15) (* (* (- j) i) y) (* (* (- z) c) b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (c <= -1e-26) {
tmp = c * (a * j);
} else if (c <= 2.55e-266) {
tmp = -1.0 * (a * (t * x));
} else if (c <= 1.2e+15) {
tmp = (-j * i) * y;
} else {
tmp = (-z * c) * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (c <= (-1d-26)) then
tmp = c * (a * j)
else if (c <= 2.55d-266) then
tmp = (-1.0d0) * (a * (t * x))
else if (c <= 1.2d+15) then
tmp = (-j * i) * y
else
tmp = (-z * c) * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (c <= -1e-26) {
tmp = c * (a * j);
} else if (c <= 2.55e-266) {
tmp = -1.0 * (a * (t * x));
} else if (c <= 1.2e+15) {
tmp = (-j * i) * y;
} else {
tmp = (-z * c) * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if c <= -1e-26: tmp = c * (a * j) elif c <= 2.55e-266: tmp = -1.0 * (a * (t * x)) elif c <= 1.2e+15: tmp = (-j * i) * y else: tmp = (-z * c) * b return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (c <= -1e-26) tmp = Float64(c * Float64(a * j)); elseif (c <= 2.55e-266) tmp = Float64(-1.0 * Float64(a * Float64(t * x))); elseif (c <= 1.2e+15) tmp = Float64(Float64(Float64(-j) * i) * y); else tmp = Float64(Float64(Float64(-z) * c) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (c <= -1e-26) tmp = c * (a * j); elseif (c <= 2.55e-266) tmp = -1.0 * (a * (t * x)); elseif (c <= 1.2e+15) tmp = (-j * i) * y; else tmp = (-z * c) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[c, -1e-26], N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.55e-266], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.2e+15], N[(N[((-j) * i), $MachinePrecision] * y), $MachinePrecision], N[(N[((-z) * c), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1 \cdot 10^{-26}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\
\mathbf{elif}\;c \leq 2.55 \cdot 10^{-266}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\
\mathbf{elif}\;c \leq 1.2 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(-j\right) \cdot i\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-z\right) \cdot c\right) \cdot b\\
\end{array}
\end{array}
if c < -1e-26Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in z around 0
lower-*.f6422.0
Applied rewrites22.0%
if -1e-26 < c < 2.55000000000000013e-266Initial program 73.5%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if 2.55000000000000013e-266 < c < 1.2e15Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.1
Applied rewrites21.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6421.1
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f6421.1
Applied rewrites21.1%
if 1.2e15 < c Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.8
Applied rewrites22.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.8
lift-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6422.8
Applied rewrites22.8%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= c -7.8e+24)
(* c (* a j))
(if (<= c 1.6e-261)
(* b (* i t))
(if (<= c 1.2e+15) (* (* (- j) i) y) (* (* (- z) c) b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (c <= -7.8e+24) {
tmp = c * (a * j);
} else if (c <= 1.6e-261) {
tmp = b * (i * t);
} else if (c <= 1.2e+15) {
tmp = (-j * i) * y;
} else {
tmp = (-z * c) * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (c <= (-7.8d+24)) then
tmp = c * (a * j)
else if (c <= 1.6d-261) then
tmp = b * (i * t)
else if (c <= 1.2d+15) then
tmp = (-j * i) * y
else
tmp = (-z * c) * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (c <= -7.8e+24) {
tmp = c * (a * j);
} else if (c <= 1.6e-261) {
tmp = b * (i * t);
} else if (c <= 1.2e+15) {
tmp = (-j * i) * y;
} else {
tmp = (-z * c) * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if c <= -7.8e+24: tmp = c * (a * j) elif c <= 1.6e-261: tmp = b * (i * t) elif c <= 1.2e+15: tmp = (-j * i) * y else: tmp = (-z * c) * b return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (c <= -7.8e+24) tmp = Float64(c * Float64(a * j)); elseif (c <= 1.6e-261) tmp = Float64(b * Float64(i * t)); elseif (c <= 1.2e+15) tmp = Float64(Float64(Float64(-j) * i) * y); else tmp = Float64(Float64(Float64(-z) * c) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (c <= -7.8e+24) tmp = c * (a * j); elseif (c <= 1.6e-261) tmp = b * (i * t); elseif (c <= 1.2e+15) tmp = (-j * i) * y; else tmp = (-z * c) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[c, -7.8e+24], N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.6e-261], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.2e+15], N[(N[((-j) * i), $MachinePrecision] * y), $MachinePrecision], N[(N[((-z) * c), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -7.8 \cdot 10^{+24}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\
\mathbf{elif}\;c \leq 1.6 \cdot 10^{-261}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;c \leq 1.2 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(-j\right) \cdot i\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-z\right) \cdot c\right) \cdot b\\
\end{array}
\end{array}
if c < -7.7999999999999995e24Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in z around 0
lower-*.f6422.0
Applied rewrites22.0%
if -7.7999999999999995e24 < c < 1.60000000000000002e-261Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in z around 0
lower-*.f6422.7
Applied rewrites22.7%
if 1.60000000000000002e-261 < c < 1.2e15Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.1
Applied rewrites21.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6421.1
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f6421.1
Applied rewrites21.1%
if 1.2e15 < c Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.8
Applied rewrites22.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.8
lift-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6422.8
Applied rewrites22.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (* a j))))
(if (<= a -1.36e+66)
t_1
(if (<= a 1.36e-170)
(* (* (- j) i) y)
(if (<= a 1.52e+62) (* b (* i t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (a * j);
double tmp;
if (a <= -1.36e+66) {
tmp = t_1;
} else if (a <= 1.36e-170) {
tmp = (-j * i) * y;
} else if (a <= 1.52e+62) {
tmp = b * (i * t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = c * (a * j)
if (a <= (-1.36d+66)) then
tmp = t_1
else if (a <= 1.36d-170) then
tmp = (-j * i) * y
else if (a <= 1.52d+62) then
tmp = b * (i * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (a * j);
double tmp;
if (a <= -1.36e+66) {
tmp = t_1;
} else if (a <= 1.36e-170) {
tmp = (-j * i) * y;
} else if (a <= 1.52e+62) {
tmp = b * (i * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * (a * j) tmp = 0 if a <= -1.36e+66: tmp = t_1 elif a <= 1.36e-170: tmp = (-j * i) * y elif a <= 1.52e+62: tmp = b * (i * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(a * j)) tmp = 0.0 if (a <= -1.36e+66) tmp = t_1; elseif (a <= 1.36e-170) tmp = Float64(Float64(Float64(-j) * i) * y); elseif (a <= 1.52e+62) tmp = Float64(b * Float64(i * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = c * (a * j); tmp = 0.0; if (a <= -1.36e+66) tmp = t_1; elseif (a <= 1.36e-170) tmp = (-j * i) * y; elseif (a <= 1.52e+62) tmp = b * (i * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.36e+66], t$95$1, If[LessEqual[a, 1.36e-170], N[(N[((-j) * i), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[a, 1.52e+62], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(a \cdot j\right)\\
\mathbf{if}\;a \leq -1.36 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.36 \cdot 10^{-170}:\\
\;\;\;\;\left(\left(-j\right) \cdot i\right) \cdot y\\
\mathbf{elif}\;a \leq 1.52 \cdot 10^{+62}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.36e66 or 1.51999999999999998e62 < a Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in z around 0
lower-*.f6422.0
Applied rewrites22.0%
if -1.36e66 < a < 1.35999999999999994e-170Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.1
Applied rewrites21.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6421.1
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f6421.1
Applied rewrites21.1%
if 1.35999999999999994e-170 < a < 1.51999999999999998e62Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in z around 0
lower-*.f6422.7
Applied rewrites22.7%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* c (* a j)))) (if (<= a -7.5e+82) t_1 (if (<= a 1.52e+62) (* b (* i t)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (a * j);
double tmp;
if (a <= -7.5e+82) {
tmp = t_1;
} else if (a <= 1.52e+62) {
tmp = b * (i * t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = c * (a * j)
if (a <= (-7.5d+82)) then
tmp = t_1
else if (a <= 1.52d+62) then
tmp = b * (i * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (a * j);
double tmp;
if (a <= -7.5e+82) {
tmp = t_1;
} else if (a <= 1.52e+62) {
tmp = b * (i * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * (a * j) tmp = 0 if a <= -7.5e+82: tmp = t_1 elif a <= 1.52e+62: tmp = b * (i * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(a * j)) tmp = 0.0 if (a <= -7.5e+82) tmp = t_1; elseif (a <= 1.52e+62) tmp = Float64(b * Float64(i * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = c * (a * j); tmp = 0.0; if (a <= -7.5e+82) tmp = t_1; elseif (a <= 1.52e+62) tmp = b * (i * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.5e+82], t$95$1, If[LessEqual[a, 1.52e+62], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(a \cdot j\right)\\
\mathbf{if}\;a \leq -7.5 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.52 \cdot 10^{+62}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.4999999999999999e82 or 1.51999999999999998e62 < a Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in z around 0
lower-*.f6422.0
Applied rewrites22.0%
if -7.4999999999999999e82 < a < 1.51999999999999998e62Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in z around 0
lower-*.f6422.7
Applied rewrites22.7%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* a (* c j)))) (if (<= a -7.5e+82) t_1 (if (<= a 1.52e+62) (* b (* i 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 = a * (c * j);
double tmp;
if (a <= -7.5e+82) {
tmp = t_1;
} else if (a <= 1.52e+62) {
tmp = b * (i * t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = a * (c * j)
if (a <= (-7.5d+82)) then
tmp = t_1
else if (a <= 1.52d+62) then
tmp = b * (i * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = a * (c * j);
double tmp;
if (a <= -7.5e+82) {
tmp = t_1;
} else if (a <= 1.52e+62) {
tmp = b * (i * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = a * (c * j) tmp = 0 if a <= -7.5e+82: tmp = t_1 elif a <= 1.52e+62: tmp = b * (i * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(a * Float64(c * j)) tmp = 0.0 if (a <= -7.5e+82) tmp = t_1; elseif (a <= 1.52e+62) tmp = Float64(b * Float64(i * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = a * (c * j); tmp = 0.0; if (a <= -7.5e+82) tmp = t_1; elseif (a <= 1.52e+62) tmp = b * (i * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.5e+82], t$95$1, If[LessEqual[a, 1.52e+62], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(c \cdot j\right)\\
\mathbf{if}\;a \leq -7.5 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.52 \cdot 10^{+62}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.4999999999999999e82 or 1.51999999999999998e62 < a Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6422.1
Applied rewrites22.1%
if -7.4999999999999999e82 < a < 1.51999999999999998e62Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in z around 0
lower-*.f6422.7
Applied rewrites22.7%
(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 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6422.1
Applied rewrites22.1%
herbie shell --seed 2025156
(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)))))