
(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 18 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
(*
(-
(fma y x (/ (fma (- (* c a) (* i y)) j (* (fma (- x) a (* i b)) t)) z))
(* c 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 = (fma(y, x, (fma(((c * a) - (i * y)), j, (fma(-x, a, (i * b)) * t)) / z)) - (c * 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(Float64(fma(y, x, Float64(fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(fma(Float64(-x), a, Float64(i * b)) * t)) / z)) - Float64(c * b)) * z); 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[(N[(N[(y * x + N[(N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[((-x) * a + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(y, x, \frac{\mathsf{fma}\left(c \cdot a - i \cdot y, j, \mathsf{fma}\left(-x, a, i \cdot b\right) \cdot t\right)}{z}\right) - c \cdot b\right) \cdot z\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 91.2%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 0.0%
Taylor expanded in z around inf
Applied rewrites45.7%
(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
(* (fma t (/ (- (* b i) (* a x)) j) (- (* a c) (* y i))) j))))
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 = fma(t, (((b * i) - (a * x)) / j), ((a * c) - (y * i))) * j;
}
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(fma(t, Float64(Float64(Float64(b * i) - Float64(a * x)) / j), Float64(Float64(a * c) - Float64(y * i))) * j); 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[(N[(t * N[(N[(N[(b * i), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] / j), $MachinePrecision] + N[(N[(a * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * j), $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}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{b \cdot i - a \cdot x}{j}, a \cdot c - y \cdot i\right) \cdot j\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 91.2%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 0.0%
Taylor expanded in z around 0
Applied rewrites43.5%
Taylor expanded in y around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f6424.9
Applied rewrites24.9%
Taylor expanded in j around inf
*-commutativeN/A
+-commutativeN/A
*-lft-identityN/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate--l+N/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lft-identityN/A
lower-*.f64N/A
Applied rewrites47.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= z 1.18e+85) (fma (- (* c a) (* i y)) j (* (fma (- x) a (* i b)) t)) (* (- (fma y x (/ (* (* j c) a) z)) (* c 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 (z <= 1.18e+85) {
tmp = fma(((c * a) - (i * y)), j, (fma(-x, a, (i * b)) * t));
} else {
tmp = (fma(y, x, (((j * c) * a) / z)) - (c * b)) * z;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= 1.18e+85) tmp = fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(fma(Float64(-x), a, Float64(i * b)) * t)); else tmp = Float64(Float64(fma(y, x, Float64(Float64(Float64(j * c) * a) / z)) - Float64(c * b)) * z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, 1.18e+85], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[((-x) * a + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x + N[(N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.18 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot a - i \cdot y, j, \mathsf{fma}\left(-x, a, i \cdot b\right) \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(y, x, \frac{\left(j \cdot c\right) \cdot a}{z}\right) - c \cdot b\right) \cdot z\\
\end{array}
\end{array}
if z < 1.17999999999999997e85Initial program 75.5%
Taylor expanded in z around 0
Applied rewrites65.4%
if 1.17999999999999997e85 < z Initial program 62.5%
Taylor expanded in z around inf
Applied rewrites79.4%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6470.1
Applied rewrites70.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= i -4.5e+234)
(* (fma (- j) y (* b t)) i)
(if (<= i -3.9e-262)
(fma (- (* j c) (* t x)) a (* (- (* i t) (* c z)) b))
(if (<= i 7.2e+15)
(fma (- (* z y) (* a t)) x (* (- (* j a) (* b z)) c))
(+ (* (* y x) z) (* 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) {
double tmp;
if (i <= -4.5e+234) {
tmp = fma(-j, y, (b * t)) * i;
} else if (i <= -3.9e-262) {
tmp = fma(((j * c) - (t * x)), a, (((i * t) - (c * z)) * b));
} else if (i <= 7.2e+15) {
tmp = fma(((z * y) - (a * t)), x, (((j * a) - (b * z)) * c));
} else {
tmp = ((y * x) * z) + (j * ((c * a) - (y * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -4.5e+234) tmp = Float64(fma(Float64(-j), y, Float64(b * t)) * i); elseif (i <= -3.9e-262) tmp = fma(Float64(Float64(j * c) - Float64(t * x)), a, Float64(Float64(Float64(i * t) - Float64(c * z)) * b)); elseif (i <= 7.2e+15) tmp = fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(Float64(j * a) - Float64(b * z)) * c)); else tmp = Float64(Float64(Float64(y * x) * z) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -4.5e+234], N[(N[((-j) * y + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[i, -3.9e-262], N[(N[(N[(j * c), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision] * a + N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7.2e+15], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -4.5 \cdot 10^{+234}:\\
\;\;\;\;\mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i\\
\mathbf{elif}\;i \leq -3.9 \cdot 10^{-262}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c - t \cdot x, a, \left(i \cdot t - c \cdot z\right) \cdot b\right)\\
\mathbf{elif}\;i \leq 7.2 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(j \cdot a - b \cdot z\right) \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z + j \cdot \left(c \cdot a - y \cdot i\right)\\
\end{array}
\end{array}
if i < -4.49999999999999982e234Initial program 59.3%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6476.3
Applied rewrites76.3%
if -4.49999999999999982e234 < i < -3.89999999999999984e-262Initial program 75.2%
Taylor expanded in y around 0
Applied rewrites59.8%
if -3.89999999999999984e-262 < i < 7.2e15Initial program 79.8%
Taylor expanded in i around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-fma.f64N/A
Applied rewrites73.2%
if 7.2e15 < i Initial program 64.9%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6447.6
Applied rewrites47.6%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= y -1.12e+37)
(+ (* (* y x) z) (* j (- (* c a) (* y i))))
(if (<= y 1.3e+150)
(fma (- (* j c) (* t x)) a (* (- (* i t) (* c z)) b))
(* (- (* z y) (* 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 (y <= -1.12e+37) {
tmp = ((y * x) * z) + (j * ((c * a) - (y * i)));
} else if (y <= 1.3e+150) {
tmp = fma(((j * c) - (t * x)), a, (((i * t) - (c * z)) * b));
} else {
tmp = ((z * y) - (a * t)) * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (y <= -1.12e+37) tmp = Float64(Float64(Float64(y * x) * z) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (y <= 1.3e+150) tmp = fma(Float64(Float64(j * c) - Float64(t * x)), a, Float64(Float64(Float64(i * t) - Float64(c * z)) * b)); else tmp = Float64(Float64(Float64(z * y) - Float64(a * t)) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[y, -1.12e+37], N[(N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e+150], N[(N[(N[(j * c), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision] * a + N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+37}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c - t \cdot x, a, \left(i \cdot t - c \cdot z\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x\\
\end{array}
\end{array}
if y < -1.12e37Initial program 64.2%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6459.0
Applied rewrites59.0%
if -1.12e37 < y < 1.30000000000000003e150Initial program 78.7%
Taylor expanded in y around 0
Applied rewrites67.6%
if 1.30000000000000003e150 < y Initial program 59.8%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6448.2
Applied rewrites48.2%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -4.5e+39)
(fma (- (* b i) (* a x)) t (* (* c j) a))
(if (<= t 1.35e-73)
(+ (* (* y x) z) (* j (- (* c a) (* y i))))
(fma (* j c) a (* (- (* 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 tmp;
if (t <= -4.5e+39) {
tmp = fma(((b * i) - (a * x)), t, ((c * j) * a));
} else if (t <= 1.35e-73) {
tmp = ((y * x) * z) + (j * ((c * a) - (y * i)));
} else {
tmp = fma((j * c), a, (((i * b) - (a * x)) * t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -4.5e+39) tmp = fma(Float64(Float64(b * i) - Float64(a * x)), t, Float64(Float64(c * j) * a)); elseif (t <= 1.35e-73) tmp = Float64(Float64(Float64(y * x) * z) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = fma(Float64(j * c), a, Float64(Float64(Float64(i * b) - Float64(a * x)) * t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -4.5e+39], N[(N[(N[(b * i), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t + N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e-73], N[(N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * c), $MachinePrecision] * a + N[(N[(N[(i * b), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot i - a \cdot x, t, \left(c \cdot j\right) \cdot a\right)\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{-73}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, \left(i \cdot b - a \cdot x\right) \cdot t\right)\\
\end{array}
\end{array}
if t < -4.49999999999999996e39Initial program 65.1%
Taylor expanded in z around 0
Applied rewrites72.7%
Taylor expanded in y around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f6416.7
Applied rewrites16.7%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-signN/A
*-lft-identityN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower--.f64N/A
lower-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lft-identityN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6469.3
Applied rewrites69.3%
if -4.49999999999999996e39 < t < 1.34999999999999997e-73Initial program 79.9%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6458.7
Applied rewrites58.7%
if 1.34999999999999997e-73 < t Initial program 68.2%
Taylor expanded in z around 0
Applied rewrites69.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f6464.8
Applied rewrites64.3%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -2.9e-17)
(fma (- (* b i) (* a x)) t (* (* c j) a))
(if (<= t 1.12e-33)
(* (- (* c a) (* i y)) j)
(fma (* j c) a (* (- (* 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 tmp;
if (t <= -2.9e-17) {
tmp = fma(((b * i) - (a * x)), t, ((c * j) * a));
} else if (t <= 1.12e-33) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = fma((j * c), a, (((i * b) - (a * x)) * t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -2.9e-17) tmp = fma(Float64(Float64(b * i) - Float64(a * x)), t, Float64(Float64(c * j) * a)); elseif (t <= 1.12e-33) tmp = Float64(Float64(Float64(c * a) - Float64(i * y)) * j); else tmp = fma(Float64(j * c), a, Float64(Float64(Float64(i * b) - Float64(a * x)) * t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -2.9e-17], N[(N[(N[(b * i), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t + N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e-33], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], N[(N[(j * c), $MachinePrecision] * a + N[(N[(N[(i * b), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot i - a \cdot x, t, \left(c \cdot j\right) \cdot a\right)\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-33}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, \left(i \cdot b - a \cdot x\right) \cdot t\right)\\
\end{array}
\end{array}
if t < -2.9000000000000003e-17Initial program 66.8%
Taylor expanded in z around 0
Applied rewrites70.4%
Taylor expanded in y around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f6417.1
Applied rewrites17.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-signN/A
*-lft-identityN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower--.f64N/A
lower-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lft-identityN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6465.9
Applied rewrites65.9%
if -2.9000000000000003e-17 < t < 1.11999999999999999e-33Initial program 80.3%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6446.6
Applied rewrites46.6%
if 1.11999999999999999e-33 < t Initial program 66.8%
Taylor expanded in z around 0
Applied rewrites71.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f6467.4
Applied rewrites67.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (* j c) a (* (- (* i b) (* a x)) t))))
(if (<= t -2.9e-17)
t_1
(if (<= t 1.12e-33) (* (- (* c a) (* i y)) j) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma((j * c), a, (((i * b) - (a * x)) * t));
double tmp;
if (t <= -2.9e-17) {
tmp = t_1;
} else if (t <= 1.12e-33) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(j * c), a, Float64(Float64(Float64(i * b) - Float64(a * x)) * t)) tmp = 0.0 if (t <= -2.9e-17) tmp = t_1; elseif (t <= 1.12e-33) tmp = Float64(Float64(Float64(c * a) - Float64(i * y)) * j); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * c), $MachinePrecision] * a + N[(N[(N[(i * b), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.9e-17], t$95$1, If[LessEqual[t, 1.12e-33], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(j \cdot c, a, \left(i \cdot b - a \cdot x\right) \cdot t\right)\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-33}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.9000000000000003e-17 or 1.11999999999999999e-33 < t Initial program 66.8%
Taylor expanded in z around 0
Applied rewrites70.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f6466.9
Applied rewrites66.5%
if -2.9000000000000003e-17 < t < 1.11999999999999999e-33Initial program 80.3%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6446.6
Applied rewrites46.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* j c) (* t x)) a)))
(if (<= a -3.8e+129)
t_1
(if (<= a 3.7e-258)
(* (- (* b t) (* y j)) i)
(if (<= a 1.25e-48)
(* (- (* i t) (* c z)) b)
(if (<= a 62.0) (* (- (* c a) (* i y)) j) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((j * c) - (t * x)) * a;
double tmp;
if (a <= -3.8e+129) {
tmp = t_1;
} else if (a <= 3.7e-258) {
tmp = ((b * t) - (y * j)) * i;
} else if (a <= 1.25e-48) {
tmp = ((i * t) - (c * z)) * b;
} else if (a <= 62.0) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((j * c) - (t * x)) * a
if (a <= (-3.8d+129)) then
tmp = t_1
else if (a <= 3.7d-258) then
tmp = ((b * t) - (y * j)) * i
else if (a <= 1.25d-48) then
tmp = ((i * t) - (c * z)) * b
else if (a <= 62.0d0) then
tmp = ((c * a) - (i * y)) * j
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((j * c) - (t * x)) * a;
double tmp;
if (a <= -3.8e+129) {
tmp = t_1;
} else if (a <= 3.7e-258) {
tmp = ((b * t) - (y * j)) * i;
} else if (a <= 1.25e-48) {
tmp = ((i * t) - (c * z)) * b;
} else if (a <= 62.0) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((j * c) - (t * x)) * a tmp = 0 if a <= -3.8e+129: tmp = t_1 elif a <= 3.7e-258: tmp = ((b * t) - (y * j)) * i elif a <= 1.25e-48: tmp = ((i * t) - (c * z)) * b elif a <= 62.0: tmp = ((c * a) - (i * y)) * j else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(j * c) - Float64(t * x)) * a) tmp = 0.0 if (a <= -3.8e+129) tmp = t_1; elseif (a <= 3.7e-258) tmp = Float64(Float64(Float64(b * t) - Float64(y * j)) * i); elseif (a <= 1.25e-48) tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b); elseif (a <= 62.0) tmp = Float64(Float64(Float64(c * a) - Float64(i * y)) * j); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((j * c) - (t * x)) * a; tmp = 0.0; if (a <= -3.8e+129) tmp = t_1; elseif (a <= 3.7e-258) tmp = ((b * t) - (y * j)) * i; elseif (a <= 1.25e-48) tmp = ((i * t) - (c * z)) * b; elseif (a <= 62.0) tmp = ((c * a) - (i * y)) * j; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(j * c), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -3.8e+129], t$95$1, If[LessEqual[a, 3.7e-258], N[(N[(N[(b * t), $MachinePrecision] - N[(y * j), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[a, 1.25e-48], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[a, 62.0], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot c - t \cdot x\right) \cdot a\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.7 \cdot 10^{-258}:\\
\;\;\;\;\left(b \cdot t - y \cdot j\right) \cdot i\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-48}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{elif}\;a \leq 62:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.80000000000000005e129 or 62 < a Initial program 64.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6462.5
Applied rewrites62.5%
if -3.80000000000000005e129 < a < 3.7e-258Initial program 77.6%
Applied rewrites74.4%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.2
Applied rewrites43.2%
if 3.7e-258 < a < 1.25e-48Initial program 81.8%
Taylor expanded in b around inf
Applied rewrites46.0%
if 1.25e-48 < a < 62Initial program 79.8%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6431.3
Applied rewrites31.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* c a) (* i y)) j)) (t_2 (* (- (* j c) (* t x)) a)))
(if (<= a -6.2e+139)
t_2
(if (<= a -2.2e-142)
t_1
(if (<= a 1.25e-48)
(* (- (* i t) (* c z)) b)
(if (<= a 62.0) 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 = ((c * a) - (i * y)) * j;
double t_2 = ((j * c) - (t * x)) * a;
double tmp;
if (a <= -6.2e+139) {
tmp = t_2;
} else if (a <= -2.2e-142) {
tmp = t_1;
} else if (a <= 1.25e-48) {
tmp = ((i * t) - (c * z)) * b;
} else if (a <= 62.0) {
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 = ((c * a) - (i * y)) * j
t_2 = ((j * c) - (t * x)) * a
if (a <= (-6.2d+139)) then
tmp = t_2
else if (a <= (-2.2d-142)) then
tmp = t_1
else if (a <= 1.25d-48) then
tmp = ((i * t) - (c * z)) * b
else if (a <= 62.0d0) 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 = ((c * a) - (i * y)) * j;
double t_2 = ((j * c) - (t * x)) * a;
double tmp;
if (a <= -6.2e+139) {
tmp = t_2;
} else if (a <= -2.2e-142) {
tmp = t_1;
} else if (a <= 1.25e-48) {
tmp = ((i * t) - (c * z)) * b;
} else if (a <= 62.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((c * a) - (i * y)) * j t_2 = ((j * c) - (t * x)) * a tmp = 0 if a <= -6.2e+139: tmp = t_2 elif a <= -2.2e-142: tmp = t_1 elif a <= 1.25e-48: tmp = ((i * t) - (c * z)) * b elif a <= 62.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(c * a) - Float64(i * y)) * j) t_2 = Float64(Float64(Float64(j * c) - Float64(t * x)) * a) tmp = 0.0 if (a <= -6.2e+139) tmp = t_2; elseif (a <= -2.2e-142) tmp = t_1; elseif (a <= 1.25e-48) tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b); elseif (a <= 62.0) 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 = ((c * a) - (i * y)) * j; t_2 = ((j * c) - (t * x)) * a; tmp = 0.0; if (a <= -6.2e+139) tmp = t_2; elseif (a <= -2.2e-142) tmp = t_1; elseif (a <= 1.25e-48) tmp = ((i * t) - (c * z)) * b; elseif (a <= 62.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(j * c), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -6.2e+139], t$95$2, If[LessEqual[a, -2.2e-142], t$95$1, If[LessEqual[a, 1.25e-48], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[a, 62.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot a - i \cdot y\right) \cdot j\\
t_2 := \left(j \cdot c - t \cdot x\right) \cdot a\\
\mathbf{if}\;a \leq -6.2 \cdot 10^{+139}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -2.2 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-48}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{elif}\;a \leq 62:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -6.2e139 or 62 < a Initial program 63.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6462.5
Applied rewrites62.5%
if -6.2e139 < a < -2.20000000000000016e-142 or 1.25e-48 < a < 62Initial program 76.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.0
Applied rewrites38.0%
if -2.20000000000000016e-142 < a < 1.25e-48Initial program 80.9%
Taylor expanded in b around inf
Applied rewrites46.5%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* i b) (* a x)) t))) (if (<= t -8.2e+41) t_1 (if (<= t 8.2e-33) (* (- (* c a) (* i y)) j) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * b) - (a * x)) * t;
double tmp;
if (t <= -8.2e+41) {
tmp = t_1;
} else if (t <= 8.2e-33) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((i * b) - (a * x)) * t
if (t <= (-8.2d+41)) then
tmp = t_1
else if (t <= 8.2d-33) then
tmp = ((c * a) - (i * y)) * j
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * b) - (a * x)) * t;
double tmp;
if (t <= -8.2e+41) {
tmp = t_1;
} else if (t <= 8.2e-33) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * b) - (a * x)) * t tmp = 0 if t <= -8.2e+41: tmp = t_1 elif t <= 8.2e-33: tmp = ((c * a) - (i * y)) * j else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * b) - Float64(a * x)) * t) tmp = 0.0 if (t <= -8.2e+41) tmp = t_1; elseif (t <= 8.2e-33) tmp = Float64(Float64(Float64(c * a) - Float64(i * y)) * j); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((i * b) - (a * x)) * t; tmp = 0.0; if (t <= -8.2e+41) tmp = t_1; elseif (t <= 8.2e-33) tmp = ((c * a) - (i * y)) * j; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * b), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -8.2e+41], t$95$1, If[LessEqual[t, 8.2e-33], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot b - a \cdot x\right) \cdot t\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{-33}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.2000000000000007e41 or 8.2e-33 < t Initial program 66.1%
Taylor expanded in t around inf
*-commutativeN/A
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
lower-*.f64N/A
Applied rewrites60.8%
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lift-neg.f64N/A
fp-cancel-sub-signN/A
*-commutativeN/A
remove-double-negN/A
mul-1-negN/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
remove-double-negN/A
lower-*.f6460.5
Applied rewrites60.5%
if -8.2000000000000007e41 < t < 8.2e-33Initial program 79.8%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6445.5
Applied rewrites45.5%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= b -4.6e+148) (* (* (- c) b) z) (if (<= b 5.8e+127) (* (- (* c a) (* i y)) j) (* (* i t) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -4.6e+148) {
tmp = (-c * b) * z;
} else if (b <= 5.8e+127) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = (i * t) * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (b <= (-4.6d+148)) then
tmp = (-c * b) * z
else if (b <= 5.8d+127) then
tmp = ((c * a) - (i * y)) * j
else
tmp = (i * t) * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -4.6e+148) {
tmp = (-c * b) * z;
} else if (b <= 5.8e+127) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = (i * t) * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -4.6e+148: tmp = (-c * b) * z elif b <= 5.8e+127: tmp = ((c * a) - (i * y)) * j else: tmp = (i * t) * b return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -4.6e+148) tmp = Float64(Float64(Float64(-c) * b) * z); elseif (b <= 5.8e+127) tmp = Float64(Float64(Float64(c * a) - Float64(i * y)) * j); else tmp = Float64(Float64(i * t) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -4.6e+148) tmp = (-c * b) * z; elseif (b <= 5.8e+127) tmp = ((c * a) - (i * y)) * j; else tmp = (i * t) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -4.6e+148], N[(N[((-c) * b), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[b, 5.8e+127], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.6 \cdot 10^{+148}:\\
\;\;\;\;\left(\left(-c\right) \cdot b\right) \cdot z\\
\mathbf{elif}\;b \leq 5.8 \cdot 10^{+127}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\end{array}
\end{array}
if b < -4.6000000000000001e148Initial program 69.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6448.1
Applied rewrites48.1%
Taylor expanded in x around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6440.2
Applied rewrites40.2%
if -4.6000000000000001e148 < b < 5.8000000000000004e127Initial program 74.3%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.5
Applied rewrites42.5%
if 5.8000000000000004e127 < b Initial program 70.3%
Applied rewrites71.9%
Taylor expanded in b around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
remove-double-negN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-neg-inN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
lower-*.f64N/A
Applied rewrites70.0%
Taylor expanded in z around 0
lower-*.f6438.8
Applied rewrites38.8%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* a j) c))) (if (<= a -7.5e+76) t_1 (if (<= a 9e-51) (* (* i t) b) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (a * j) * c;
double tmp;
if (a <= -7.5e+76) {
tmp = t_1;
} else if (a <= 9e-51) {
tmp = (i * t) * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (a * j) * c
if (a <= (-7.5d+76)) then
tmp = t_1
else if (a <= 9d-51) then
tmp = (i * t) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (a * j) * c;
double tmp;
if (a <= -7.5e+76) {
tmp = t_1;
} else if (a <= 9e-51) {
tmp = (i * t) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (a * j) * c tmp = 0 if a <= -7.5e+76: tmp = t_1 elif a <= 9e-51: tmp = (i * t) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(a * j) * c) tmp = 0.0 if (a <= -7.5e+76) tmp = t_1; elseif (a <= 9e-51) tmp = Float64(Float64(i * t) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (a * j) * c; tmp = 0.0; if (a <= -7.5e+76) tmp = t_1; elseif (a <= 9e-51) tmp = (i * t) * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(a * j), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[a, -7.5e+76], t$95$1, If[LessEqual[a, 9e-51], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot j\right) \cdot c\\
\mathbf{if}\;a \leq -7.5 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-51}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.4999999999999995e76 or 8.99999999999999948e-51 < a Initial program 65.9%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6445.6
Applied rewrites45.6%
Taylor expanded in z around 0
lower-*.f6434.4
Applied rewrites34.4%
if -7.4999999999999995e76 < a < 8.99999999999999948e-51Initial program 79.7%
Applied rewrites76.1%
Taylor expanded in b around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
remove-double-negN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-neg-inN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
lower-*.f64N/A
Applied rewrites44.3%
Taylor expanded in z around 0
lower-*.f6424.7
Applied rewrites24.7%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* a j) c))) (if (<= a -3.8e+47) t_1 (if (<= a 9e-51) (* (* i b) t) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (a * j) * c;
double tmp;
if (a <= -3.8e+47) {
tmp = t_1;
} else if (a <= 9e-51) {
tmp = (i * b) * t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (a * j) * c
if (a <= (-3.8d+47)) then
tmp = t_1
else if (a <= 9d-51) then
tmp = (i * b) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (a * j) * c;
double tmp;
if (a <= -3.8e+47) {
tmp = t_1;
} else if (a <= 9e-51) {
tmp = (i * b) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (a * j) * c tmp = 0 if a <= -3.8e+47: tmp = t_1 elif a <= 9e-51: tmp = (i * b) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(a * j) * c) tmp = 0.0 if (a <= -3.8e+47) tmp = t_1; elseif (a <= 9e-51) tmp = Float64(Float64(i * b) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (a * j) * c; tmp = 0.0; if (a <= -3.8e+47) tmp = t_1; elseif (a <= 9e-51) tmp = (i * b) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(a * j), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[a, -3.8e+47], t$95$1, If[LessEqual[a, 9e-51], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot j\right) \cdot c\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-51}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.8000000000000003e47 or 8.99999999999999948e-51 < a Initial program 66.1%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6445.4
Applied rewrites45.4%
Taylor expanded in z around 0
lower-*.f6434.1
Applied rewrites34.1%
if -3.8000000000000003e47 < a < 8.99999999999999948e-51Initial program 80.2%
Taylor expanded in t around inf
*-commutativeN/A
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
lower-*.f64N/A
Applied rewrites32.8%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6425.6
Applied rewrites25.6%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= a -1.95e+117) (* (* c a) j) (if (<= a 9e-51) (* (* i b) t) (* (* j c) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -1.95e+117) {
tmp = (c * a) * j;
} else if (a <= 9e-51) {
tmp = (i * b) * t;
} else {
tmp = (j * c) * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (a <= (-1.95d+117)) then
tmp = (c * a) * j
else if (a <= 9d-51) then
tmp = (i * b) * t
else
tmp = (j * c) * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -1.95e+117) {
tmp = (c * a) * j;
} else if (a <= 9e-51) {
tmp = (i * b) * t;
} else {
tmp = (j * c) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if a <= -1.95e+117: tmp = (c * a) * j elif a <= 9e-51: tmp = (i * b) * t else: tmp = (j * c) * a return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (a <= -1.95e+117) tmp = Float64(Float64(c * a) * j); elseif (a <= 9e-51) tmp = Float64(Float64(i * b) * t); else tmp = Float64(Float64(j * c) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (a <= -1.95e+117) tmp = (c * a) * j; elseif (a <= 9e-51) tmp = (i * b) * t; else tmp = (j * c) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -1.95e+117], N[(N[(c * a), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[a, 9e-51], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{+117}:\\
\;\;\;\;\left(c \cdot a\right) \cdot j\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-51}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\end{array}
\end{array}
if a < -1.94999999999999995e117Initial program 60.5%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6448.3
Applied rewrites48.3%
Taylor expanded in y around 0
*-commutativeN/A
lift-*.f6441.8
Applied rewrites41.8%
if -1.94999999999999995e117 < a < 8.99999999999999948e-51Initial program 79.1%
Taylor expanded in t around inf
*-commutativeN/A
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
lower-*.f64N/A
Applied rewrites34.0%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6425.1
Applied rewrites25.1%
if 8.99999999999999948e-51 < a Initial program 68.2%
Taylor expanded in z around 0
Applied rewrites66.4%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6429.7
Applied rewrites29.7%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* j c) a))) (if (<= a -7.2e+116) t_1 (if (<= a 9e-51) (* (* i b) t) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * c) * a;
double tmp;
if (a <= -7.2e+116) {
tmp = t_1;
} else if (a <= 9e-51) {
tmp = (i * b) * t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (j * c) * a
if (a <= (-7.2d+116)) then
tmp = t_1
else if (a <= 9d-51) then
tmp = (i * b) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * c) * a;
double tmp;
if (a <= -7.2e+116) {
tmp = t_1;
} else if (a <= 9e-51) {
tmp = (i * b) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * c) * a tmp = 0 if a <= -7.2e+116: tmp = t_1 elif a <= 9e-51: tmp = (i * b) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * c) * a) tmp = 0.0 if (a <= -7.2e+116) tmp = t_1; elseif (a <= 9e-51) tmp = Float64(Float64(i * b) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (j * c) * a; tmp = 0.0; if (a <= -7.2e+116) tmp = t_1; elseif (a <= 9e-51) tmp = (i * b) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -7.2e+116], t$95$1, If[LessEqual[a, 9e-51], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot c\right) \cdot a\\
\mathbf{if}\;a \leq -7.2 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-51}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.19999999999999941e116 or 8.99999999999999948e-51 < a Initial program 65.6%
Taylor expanded in z around 0
Applied rewrites66.1%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6433.5
Applied rewrites33.5%
if -7.19999999999999941e116 < a < 8.99999999999999948e-51Initial program 79.1%
Taylor expanded in t around inf
*-commutativeN/A
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
lower-*.f64N/A
Applied rewrites34.0%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6425.1
Applied rewrites25.1%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* j c) a))) (if (<= a -5.8e+50) t_1 (if (<= a 8.6e-50) (* (* z y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * c) * a;
double tmp;
if (a <= -5.8e+50) {
tmp = t_1;
} else if (a <= 8.6e-50) {
tmp = (z * y) * 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 = (j * c) * a
if (a <= (-5.8d+50)) then
tmp = t_1
else if (a <= 8.6d-50) then
tmp = (z * y) * 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 = (j * c) * a;
double tmp;
if (a <= -5.8e+50) {
tmp = t_1;
} else if (a <= 8.6e-50) {
tmp = (z * y) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * c) * a tmp = 0 if a <= -5.8e+50: tmp = t_1 elif a <= 8.6e-50: tmp = (z * y) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * c) * a) tmp = 0.0 if (a <= -5.8e+50) tmp = t_1; elseif (a <= 8.6e-50) tmp = Float64(Float64(z * y) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (j * c) * a; tmp = 0.0; if (a <= -5.8e+50) tmp = t_1; elseif (a <= 8.6e-50) tmp = (z * y) * 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[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -5.8e+50], t$95$1, If[LessEqual[a, 8.6e-50], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot c\right) \cdot a\\
\mathbf{if}\;a \leq -5.8 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8.6 \cdot 10^{-50}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.8e50 or 8.59999999999999995e-50 < a Initial program 66.0%
Taylor expanded in z around 0
Applied rewrites66.5%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6432.7
Applied rewrites32.7%
if -5.8e50 < a < 8.59999999999999995e-50Initial program 80.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.2
Applied rewrites45.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.4
Applied rewrites25.4%
(FPCore (x y z t a b c i j) :precision binary64 (* (* z y) x))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (z * y) * x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = (z * y) * x
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (z * y) * x;
}
def code(x, y, z, t, a, b, c, i, j): return (z * y) * x
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(z * y) * x) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (z * y) * x; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot y\right) \cdot x
\end{array}
Initial program 73.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.1
Applied rewrites22.1%
herbie shell --seed 2025130
(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)))))