
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 INFINITY) t_1 (* -1.0 (* a (fma (- i) b (* t x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = -1.0 * (a * fma(-i, b, (t * x)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(-1.0 * Float64(a * fma(Float64(-i), b, Float64(t * x)))); 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[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(-1.0 * N[(a * N[((-i) * b + N[(t * x), $MachinePrecision]), $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 - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(a \cdot \mathsf{fma}\left(-i, b, t \cdot x\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 72.8%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 72.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6472.3
Applied rewrites72.3%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
lower-fma.f6439.5
Applied rewrites39.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(- (fma -1.0 (* a (* t x)) (* c (* j t))) (* b (- (* c z) (* a i))))))
(if (<= b -6e-35)
t_1
(if (<= b 2.1e+131)
(fma j (- (* c t) (* i y)) (* x (- (* y z) (* a t))))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-1.0, (a * (t * x)), (c * (j * t))) - (b * ((c * z) - (a * i)));
double tmp;
if (b <= -6e-35) {
tmp = t_1;
} else if (b <= 2.1e+131) {
tmp = fma(j, ((c * t) - (i * y)), (x * ((y * z) - (a * t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(-1.0, Float64(a * Float64(t * x)), Float64(c * Float64(j * t))) - Float64(b * Float64(Float64(c * z) - Float64(a * i)))) tmp = 0.0 if (b <= -6e-35) tmp = t_1; elseif (b <= 2.1e+131) tmp = fma(j, Float64(Float64(c * t) - Float64(i * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision] + N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6e-35], t$95$1, If[LessEqual[b, 2.1e+131], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-1, a \cdot \left(t \cdot x\right), c \cdot \left(j \cdot t\right)\right) - b \cdot \left(c \cdot z - a \cdot i\right)\\
\mathbf{if}\;b \leq -6 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+131}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -5.99999999999999978e-35 or 2.09999999999999985e131 < b Initial program 72.8%
Taylor expanded in y around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.9
Applied rewrites57.9%
if -5.99999999999999978e-35 < b < 2.09999999999999985e131Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= b -1.55e-32) (* b (- (* a i) (* c z))) (fma j (- (* c t) (* i y)) (* x (- (* y z) (* a t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -1.55e-32) {
tmp = b * ((a * i) - (c * z));
} else {
tmp = fma(j, ((c * t) - (i * y)), (x * ((y * z) - (a * t))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -1.55e-32) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); else tmp = fma(j, Float64(Float64(c * t) - Float64(i * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -1.55e-32], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.55 \cdot 10^{-32}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\end{array}
\end{array}
if b < -1.55000000000000005e-32Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
if -1.55000000000000005e-32 < b Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma j (* c t) (* x (- (* y z) (* a t))))))
(if (<= x -2.1e-15)
t_1
(if (<= x 1.4e+70)
(+ (* -1.0 (* b (* c z))) (* j (- (* c t) (* 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 = fma(j, (c * t), (x * ((y * z) - (a * t))));
double tmp;
if (x <= -2.1e-15) {
tmp = t_1;
} else if (x <= 1.4e+70) {
tmp = (-1.0 * (b * (c * z))) + (j * ((c * t) - (i * y)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(j, Float64(c * t), Float64(x * Float64(Float64(y * z) - Float64(a * t)))) tmp = 0.0 if (x <= -2.1e-15) tmp = t_1; elseif (x <= 1.4e+70) tmp = Float64(Float64(-1.0 * Float64(b * Float64(c * z))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(c * t), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e-15], t$95$1, If[LessEqual[x, 1.4e+70], N[(N[(-1.0 * N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(j, c \cdot t, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+70}:\\
\;\;\;\;-1 \cdot \left(b \cdot \left(c \cdot z\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.09999999999999981e-15 or 1.39999999999999995e70 < x Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
Taylor expanded in y around 0
lower-*.f6450.0
Applied rewrites50.0%
if -2.09999999999999981e-15 < x < 1.39999999999999995e70Initial program 72.8%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6450.2
Applied rewrites50.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma j (* c t) (* x (- (* y z) (* a t))))))
(if (<= x -2.1e-15)
t_1
(if (<= x 1.4e+70) (fma (- (* c t) (* i y)) j (* (* (- 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 = fma(j, (c * t), (x * ((y * z) - (a * t))));
double tmp;
if (x <= -2.1e-15) {
tmp = t_1;
} else if (x <= 1.4e+70) {
tmp = fma(((c * t) - (i * y)), j, ((-b * c) * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(j, Float64(c * t), Float64(x * Float64(Float64(y * z) - Float64(a * t)))) tmp = 0.0 if (x <= -2.1e-15) tmp = t_1; elseif (x <= 1.4e+70) tmp = fma(Float64(Float64(c * t) - Float64(i * y)), j, Float64(Float64(Float64(-b) * 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[(j * N[(c * t), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e-15], t$95$1, If[LessEqual[x, 1.4e+70], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[((-b) * c), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(j, c \cdot t, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(-b\right) \cdot c\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.09999999999999981e-15 or 1.39999999999999995e70 < x Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
Taylor expanded in y around 0
lower-*.f6450.0
Applied rewrites50.0%
if -2.09999999999999981e-15 < x < 1.39999999999999995e70Initial program 72.8%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6450.2
Applied rewrites50.2%
Applied rewrites50.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* a i) (* c z)))))
(if (<= b -1.55e-32)
t_1
(if (<= b -8.8e-82)
(* j (- (* c t) (* i y)))
(if (<= b 3.4e+131) (fma j (* c t) (* x (- (* y z) (* a t)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((a * i) - (c * z));
double tmp;
if (b <= -1.55e-32) {
tmp = t_1;
} else if (b <= -8.8e-82) {
tmp = j * ((c * t) - (i * y));
} else if (b <= 3.4e+131) {
tmp = fma(j, (c * t), (x * ((y * z) - (a * t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(a * i) - Float64(c * z))) tmp = 0.0 if (b <= -1.55e-32) tmp = t_1; elseif (b <= -8.8e-82) tmp = Float64(j * Float64(Float64(c * t) - Float64(i * y))); elseif (b <= 3.4e+131) tmp = fma(j, Float64(c * t), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.55e-32], t$95$1, If[LessEqual[b, -8.8e-82], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.4e+131], N[(j * N[(c * t), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{if}\;b \leq -1.55 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -8.8 \cdot 10^{-82}:\\
\;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;b \leq 3.4 \cdot 10^{+131}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.55000000000000005e-32 or 3.39999999999999986e131 < b Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
if -1.55000000000000005e-32 < b < -8.79999999999999943e-82Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
if -8.79999999999999943e-82 < b < 3.39999999999999986e131Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
Taylor expanded in y around 0
lower-*.f6450.0
Applied rewrites50.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* i b) (* t x)) a)))
(if (<= a -9.5e+20)
t_1
(if (<= a 2.3e-51) (+ (* x (* y z)) (* j (- (* c t) (* 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 = ((i * b) - (t * x)) * a;
double tmp;
if (a <= -9.5e+20) {
tmp = t_1;
} else if (a <= 2.3e-51) {
tmp = (x * (y * z)) + (j * ((c * t) - (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 = ((i * b) - (t * x)) * a
if (a <= (-9.5d+20)) then
tmp = t_1
else if (a <= 2.3d-51) then
tmp = (x * (y * z)) + (j * ((c * t) - (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 = ((i * b) - (t * x)) * a;
double tmp;
if (a <= -9.5e+20) {
tmp = t_1;
} else if (a <= 2.3e-51) {
tmp = (x * (y * z)) + (j * ((c * t) - (i * y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * b) - (t * x)) * a tmp = 0 if a <= -9.5e+20: tmp = t_1 elif a <= 2.3e-51: tmp = (x * (y * z)) + (j * ((c * t) - (i * y))) 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(t * x)) * a) tmp = 0.0 if (a <= -9.5e+20) tmp = t_1; elseif (a <= 2.3e-51) tmp = Float64(Float64(x * Float64(y * z)) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((i * b) - (t * x)) * a; tmp = 0.0; if (a <= -9.5e+20) tmp = t_1; elseif (a <= 2.3e-51) tmp = (x * (y * z)) + (j * ((c * t) - (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[(N[(N[(i * b), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -9.5e+20], t$95$1, If[LessEqual[a, 2.3e-51], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot b - t \cdot x\right) \cdot a\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-51}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.5e20 or 2.30000000000000002e-51 < a Initial program 72.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6472.3
Applied rewrites72.3%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
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--.f6439.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
if -9.5e20 < a < 2.30000000000000002e-51Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6449.0
Applied rewrites49.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (- (* j t) (* b z)))) (t_2 (* (- (* i b) (* t x)) a)))
(if (<= a -32500000000.0)
t_2
(if (<= a -1.14e-57)
(* (- (* z x) (* j i)) y)
(if (<= a -6.5e-281)
t_1
(if (<= a 2.9e-218)
(fma (* (- y) i) j (* (* z x) y))
(if (<= a 3.5e-115) 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 * ((j * t) - (b * z));
double t_2 = ((i * b) - (t * x)) * a;
double tmp;
if (a <= -32500000000.0) {
tmp = t_2;
} else if (a <= -1.14e-57) {
tmp = ((z * x) - (j * i)) * y;
} else if (a <= -6.5e-281) {
tmp = t_1;
} else if (a <= 2.9e-218) {
tmp = fma((-y * i), j, ((z * x) * y));
} else if (a <= 3.5e-115) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(Float64(j * t) - Float64(b * z))) t_2 = Float64(Float64(Float64(i * b) - Float64(t * x)) * a) tmp = 0.0 if (a <= -32500000000.0) tmp = t_2; elseif (a <= -1.14e-57) tmp = Float64(Float64(Float64(z * x) - Float64(j * i)) * y); elseif (a <= -6.5e-281) tmp = t_1; elseif (a <= 2.9e-218) tmp = fma(Float64(Float64(-y) * i), j, Float64(Float64(z * x) * y)); elseif (a <= 3.5e-115) 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[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(i * b), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -32500000000.0], t$95$2, If[LessEqual[a, -1.14e-57], N[(N[(N[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[a, -6.5e-281], t$95$1, If[LessEqual[a, 2.9e-218], N[(N[((-y) * i), $MachinePrecision] * j + N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e-115], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t - b \cdot z\right)\\
t_2 := \left(i \cdot b - t \cdot x\right) \cdot a\\
\mathbf{if}\;a \leq -32500000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -1.14 \cdot 10^{-57}:\\
\;\;\;\;\left(z \cdot x - j \cdot i\right) \cdot y\\
\mathbf{elif}\;a \leq -6.5 \cdot 10^{-281}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.9 \cdot 10^{-218}:\\
\;\;\;\;\mathsf{fma}\left(\left(-y\right) \cdot i, j, \left(z \cdot x\right) \cdot y\right)\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-115}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -3.25e10 or 3.5000000000000002e-115 < a Initial program 72.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6472.3
Applied rewrites72.3%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
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--.f6439.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
if -3.25e10 < a < -1.14000000000000006e-57Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.8
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6438.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
if -1.14000000000000006e-57 < a < -6.5e-281 or 2.9000000000000002e-218 < a < 3.5000000000000002e-115Initial program 72.8%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
if -6.5e-281 < a < 2.9000000000000002e-218Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
lift-*.f64N/A
lift-fma.f64N/A
distribute-lft-outN/A
mul-1-negN/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6436.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.1
Applied rewrites36.1%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* i b) (* t x)) a))) (if (<= a -9.5e+20) t_1 (if (<= a 4.7e-98) (* j (- (* c t) (* 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 = ((i * b) - (t * x)) * a;
double tmp;
if (a <= -9.5e+20) {
tmp = t_1;
} else if (a <= 4.7e-98) {
tmp = j * ((c * t) - (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 = ((i * b) - (t * x)) * a
if (a <= (-9.5d+20)) then
tmp = t_1
else if (a <= 4.7d-98) then
tmp = j * ((c * t) - (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 = ((i * b) - (t * x)) * a;
double tmp;
if (a <= -9.5e+20) {
tmp = t_1;
} else if (a <= 4.7e-98) {
tmp = j * ((c * t) - (i * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * b) - (t * x)) * a tmp = 0 if a <= -9.5e+20: tmp = t_1 elif a <= 4.7e-98: tmp = j * ((c * t) - (i * y)) 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(t * x)) * a) tmp = 0.0 if (a <= -9.5e+20) tmp = t_1; elseif (a <= 4.7e-98) tmp = Float64(j * Float64(Float64(c * t) - Float64(i * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((i * b) - (t * x)) * a; tmp = 0.0; if (a <= -9.5e+20) tmp = t_1; elseif (a <= 4.7e-98) tmp = j * ((c * t) - (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[(N[(N[(i * b), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -9.5e+20], t$95$1, If[LessEqual[a, 4.7e-98], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot b - t \cdot x\right) \cdot a\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.7 \cdot 10^{-98}:\\
\;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.5e20 or 4.70000000000000005e-98 < a Initial program 72.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6472.3
Applied rewrites72.3%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
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--.f6439.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
if -9.5e20 < a < 4.70000000000000005e-98Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* z (- (* x y) (* b c)))))
(if (<= z -2.4e-16)
t_1
(if (<= z 3.4e-133)
(* j (- (* c t) (* i y)))
(if (<= z 6.5e+42) (* b (- (* a i) (* c z))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = z * ((x * y) - (b * c));
double tmp;
if (z <= -2.4e-16) {
tmp = t_1;
} else if (z <= 3.4e-133) {
tmp = j * ((c * t) - (i * y));
} else if (z <= 6.5e+42) {
tmp = b * ((a * i) - (c * z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = z * ((x * y) - (b * c))
if (z <= (-2.4d-16)) then
tmp = t_1
else if (z <= 3.4d-133) then
tmp = j * ((c * t) - (i * y))
else if (z <= 6.5d+42) then
tmp = b * ((a * i) - (c * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = z * ((x * y) - (b * c));
double tmp;
if (z <= -2.4e-16) {
tmp = t_1;
} else if (z <= 3.4e-133) {
tmp = j * ((c * t) - (i * y));
} else if (z <= 6.5e+42) {
tmp = b * ((a * i) - (c * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = z * ((x * y) - (b * c)) tmp = 0 if z <= -2.4e-16: tmp = t_1 elif z <= 3.4e-133: tmp = j * ((c * t) - (i * y)) elif z <= 6.5e+42: tmp = b * ((a * i) - (c * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(z * Float64(Float64(x * y) - Float64(b * c))) tmp = 0.0 if (z <= -2.4e-16) tmp = t_1; elseif (z <= 3.4e-133) tmp = Float64(j * Float64(Float64(c * t) - Float64(i * y))); elseif (z <= 6.5e+42) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = z * ((x * y) - (b * c)); tmp = 0.0; if (z <= -2.4e-16) tmp = t_1; elseif (z <= 3.4e-133) tmp = j * ((c * t) - (i * y)); elseif (z <= 6.5e+42) tmp = b * ((a * i) - (c * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e-16], t$95$1, If[LessEqual[z, 3.4e-133], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e+42], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-133}:\\
\;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+42}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.40000000000000005e-16 or 6.50000000000000052e42 < z Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.7
Applied rewrites38.7%
if -2.40000000000000005e-16 < z < 3.40000000000000006e-133Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
if 3.40000000000000006e-133 < z < 6.50000000000000052e42Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* a i) (* c z)))))
(if (<= b -1.55e-32)
t_1
(if (<= b 1.9e+16) (* j (- (* c t) (* 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 = b * ((a * i) - (c * z));
double tmp;
if (b <= -1.55e-32) {
tmp = t_1;
} else if (b <= 1.9e+16) {
tmp = j * ((c * t) - (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 = b * ((a * i) - (c * z))
if (b <= (-1.55d-32)) then
tmp = t_1
else if (b <= 1.9d+16) then
tmp = j * ((c * t) - (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 = b * ((a * i) - (c * z));
double tmp;
if (b <= -1.55e-32) {
tmp = t_1;
} else if (b <= 1.9e+16) {
tmp = j * ((c * t) - (i * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * ((a * i) - (c * z)) tmp = 0 if b <= -1.55e-32: tmp = t_1 elif b <= 1.9e+16: tmp = j * ((c * t) - (i * y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(a * i) - Float64(c * z))) tmp = 0.0 if (b <= -1.55e-32) tmp = t_1; elseif (b <= 1.9e+16) tmp = Float64(j * Float64(Float64(c * t) - Float64(i * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = b * ((a * i) - (c * z)); tmp = 0.0; if (b <= -1.55e-32) tmp = t_1; elseif (b <= 1.9e+16) tmp = j * ((c * t) - (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[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.55e-32], t$95$1, If[LessEqual[b, 1.9e+16], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{if}\;b \leq -1.55 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{+16}:\\
\;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.55000000000000005e-32 or 1.9e16 < b Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
if -1.55000000000000005e-32 < b < 1.9e16Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= x -4.3e-13) (* y (* x z)) (if (<= x 3.35e+170) (* j (- (* c t) (* i y))) (* -1.0 (* a (* t x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -4.3e-13) {
tmp = y * (x * z);
} else if (x <= 3.35e+170) {
tmp = j * ((c * t) - (i * y));
} else {
tmp = -1.0 * (a * (t * x));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (x <= (-4.3d-13)) then
tmp = y * (x * z)
else if (x <= 3.35d+170) then
tmp = j * ((c * t) - (i * y))
else
tmp = (-1.0d0) * (a * (t * x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -4.3e-13) {
tmp = y * (x * z);
} else if (x <= 3.35e+170) {
tmp = j * ((c * t) - (i * y));
} else {
tmp = -1.0 * (a * (t * x));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -4.3e-13: tmp = y * (x * z) elif x <= 3.35e+170: tmp = j * ((c * t) - (i * y)) else: tmp = -1.0 * (a * (t * x)) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -4.3e-13) tmp = Float64(y * Float64(x * z)); elseif (x <= 3.35e+170) tmp = Float64(j * Float64(Float64(c * t) - Float64(i * y))); else tmp = Float64(-1.0 * Float64(a * Float64(t * x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (x <= -4.3e-13) tmp = y * (x * z); elseif (x <= 3.35e+170) tmp = j * ((c * t) - (i * y)); else tmp = -1.0 * (a * (t * x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -4.3e-13], N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.35e+170], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.3 \cdot 10^{-13}:\\
\;\;\;\;y \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq 3.35 \cdot 10^{+170}:\\
\;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\
\end{array}
\end{array}
if x < -4.2999999999999999e-13Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
Taylor expanded in x around inf
lower-*.f6422.0
Applied rewrites22.0%
if -4.2999999999999999e-13 < x < 3.34999999999999992e170Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
if 3.34999999999999992e170 < x Initial program 72.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6472.3
Applied rewrites72.3%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.1
Applied rewrites22.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= i -2.05e+68)
(* (* (- y) i) j)
(if (<= i -3.05e-105)
(* c (* j t))
(if (<= i 2.85e-260)
(* z (* -1.0 (* b c)))
(if (<= i 6.4e+35)
(* -1.0 (* a (* t x)))
(if (<= i 9e+243) (* a (* b i)) (* (* (- y) j) 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 <= -2.05e+68) {
tmp = (-y * i) * j;
} else if (i <= -3.05e-105) {
tmp = c * (j * t);
} else if (i <= 2.85e-260) {
tmp = z * (-1.0 * (b * c));
} else if (i <= 6.4e+35) {
tmp = -1.0 * (a * (t * x));
} else if (i <= 9e+243) {
tmp = a * (b * i);
} else {
tmp = (-y * j) * i;
}
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 (i <= (-2.05d+68)) then
tmp = (-y * i) * j
else if (i <= (-3.05d-105)) then
tmp = c * (j * t)
else if (i <= 2.85d-260) then
tmp = z * ((-1.0d0) * (b * c))
else if (i <= 6.4d+35) then
tmp = (-1.0d0) * (a * (t * x))
else if (i <= 9d+243) then
tmp = a * (b * i)
else
tmp = (-y * j) * i
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 (i <= -2.05e+68) {
tmp = (-y * i) * j;
} else if (i <= -3.05e-105) {
tmp = c * (j * t);
} else if (i <= 2.85e-260) {
tmp = z * (-1.0 * (b * c));
} else if (i <= 6.4e+35) {
tmp = -1.0 * (a * (t * x));
} else if (i <= 9e+243) {
tmp = a * (b * i);
} else {
tmp = (-y * j) * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if i <= -2.05e+68: tmp = (-y * i) * j elif i <= -3.05e-105: tmp = c * (j * t) elif i <= 2.85e-260: tmp = z * (-1.0 * (b * c)) elif i <= 6.4e+35: tmp = -1.0 * (a * (t * x)) elif i <= 9e+243: tmp = a * (b * i) else: tmp = (-y * j) * i return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -2.05e+68) tmp = Float64(Float64(Float64(-y) * i) * j); elseif (i <= -3.05e-105) tmp = Float64(c * Float64(j * t)); elseif (i <= 2.85e-260) tmp = Float64(z * Float64(-1.0 * Float64(b * c))); elseif (i <= 6.4e+35) tmp = Float64(-1.0 * Float64(a * Float64(t * x))); elseif (i <= 9e+243) tmp = Float64(a * Float64(b * i)); else tmp = Float64(Float64(Float64(-y) * j) * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (i <= -2.05e+68) tmp = (-y * i) * j; elseif (i <= -3.05e-105) tmp = c * (j * t); elseif (i <= 2.85e-260) tmp = z * (-1.0 * (b * c)); elseif (i <= 6.4e+35) tmp = -1.0 * (a * (t * x)); elseif (i <= 9e+243) tmp = a * (b * i); else tmp = (-y * j) * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -2.05e+68], N[(N[((-y) * i), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[i, -3.05e-105], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.85e-260], N[(z * N[(-1.0 * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 6.4e+35], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 9e+243], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], N[(N[((-y) * j), $MachinePrecision] * i), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.05 \cdot 10^{+68}:\\
\;\;\;\;\left(\left(-y\right) \cdot i\right) \cdot j\\
\mathbf{elif}\;i \leq -3.05 \cdot 10^{-105}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{elif}\;i \leq 2.85 \cdot 10^{-260}:\\
\;\;\;\;z \cdot \left(-1 \cdot \left(b \cdot c\right)\right)\\
\mathbf{elif}\;i \leq 6.4 \cdot 10^{+35}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\
\mathbf{elif}\;i \leq 9 \cdot 10^{+243}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-y\right) \cdot j\right) \cdot i\\
\end{array}
\end{array}
if i < -2.05e68Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
if -2.05e68 < i < -3.04999999999999992e-105Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if -3.04999999999999992e-105 < i < 2.8499999999999999e-260Initial program 72.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6472.3
Applied rewrites72.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.7
Applied rewrites38.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
if 2.8499999999999999e-260 < i < 6.39999999999999965e35Initial program 72.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6472.3
Applied rewrites72.3%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.1
Applied rewrites22.1%
if 6.39999999999999965e35 < i < 8.9999999999999999e243Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
if 8.9999999999999999e243 < i Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= i -2.05e+68)
(* (* (- y) i) j)
(if (<= i -3.05e-105)
(* c (* j t))
(if (<= i 7.2e-143)
(* b (* -1.0 (* c z)))
(if (<= i 9e+243) (* a (* b i)) (* (* (- y) j) 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 <= -2.05e+68) {
tmp = (-y * i) * j;
} else if (i <= -3.05e-105) {
tmp = c * (j * t);
} else if (i <= 7.2e-143) {
tmp = b * (-1.0 * (c * z));
} else if (i <= 9e+243) {
tmp = a * (b * i);
} else {
tmp = (-y * j) * i;
}
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 (i <= (-2.05d+68)) then
tmp = (-y * i) * j
else if (i <= (-3.05d-105)) then
tmp = c * (j * t)
else if (i <= 7.2d-143) then
tmp = b * ((-1.0d0) * (c * z))
else if (i <= 9d+243) then
tmp = a * (b * i)
else
tmp = (-y * j) * i
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 (i <= -2.05e+68) {
tmp = (-y * i) * j;
} else if (i <= -3.05e-105) {
tmp = c * (j * t);
} else if (i <= 7.2e-143) {
tmp = b * (-1.0 * (c * z));
} else if (i <= 9e+243) {
tmp = a * (b * i);
} else {
tmp = (-y * j) * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if i <= -2.05e+68: tmp = (-y * i) * j elif i <= -3.05e-105: tmp = c * (j * t) elif i <= 7.2e-143: tmp = b * (-1.0 * (c * z)) elif i <= 9e+243: tmp = a * (b * i) else: tmp = (-y * j) * i return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -2.05e+68) tmp = Float64(Float64(Float64(-y) * i) * j); elseif (i <= -3.05e-105) tmp = Float64(c * Float64(j * t)); elseif (i <= 7.2e-143) tmp = Float64(b * Float64(-1.0 * Float64(c * z))); elseif (i <= 9e+243) tmp = Float64(a * Float64(b * i)); else tmp = Float64(Float64(Float64(-y) * j) * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (i <= -2.05e+68) tmp = (-y * i) * j; elseif (i <= -3.05e-105) tmp = c * (j * t); elseif (i <= 7.2e-143) tmp = b * (-1.0 * (c * z)); elseif (i <= 9e+243) tmp = a * (b * i); else tmp = (-y * j) * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -2.05e+68], N[(N[((-y) * i), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[i, -3.05e-105], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7.2e-143], N[(b * N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 9e+243], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], N[(N[((-y) * j), $MachinePrecision] * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.05 \cdot 10^{+68}:\\
\;\;\;\;\left(\left(-y\right) \cdot i\right) \cdot j\\
\mathbf{elif}\;i \leq -3.05 \cdot 10^{-105}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{elif}\;i \leq 7.2 \cdot 10^{-143}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\
\mathbf{elif}\;i \leq 9 \cdot 10^{+243}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-y\right) \cdot j\right) \cdot i\\
\end{array}
\end{array}
if i < -2.05e68Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
if -2.05e68 < i < -3.04999999999999992e-105Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if -3.04999999999999992e-105 < i < 7.1999999999999996e-143Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
if 7.1999999999999996e-143 < i < 8.9999999999999999e243Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
if 8.9999999999999999e243 < i Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= a -46000000000000.0)
(* b (* a i))
(if (<= a -7.2e-245)
(* c (* j t))
(if (<= a 1.8e-38) (* (* (- y) i) j) (* (* b a) i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -46000000000000.0) {
tmp = b * (a * i);
} else if (a <= -7.2e-245) {
tmp = c * (j * t);
} else if (a <= 1.8e-38) {
tmp = (-y * i) * j;
} else {
tmp = (b * a) * i;
}
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 <= (-46000000000000.0d0)) then
tmp = b * (a * i)
else if (a <= (-7.2d-245)) then
tmp = c * (j * t)
else if (a <= 1.8d-38) then
tmp = (-y * i) * j
else
tmp = (b * a) * i
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 <= -46000000000000.0) {
tmp = b * (a * i);
} else if (a <= -7.2e-245) {
tmp = c * (j * t);
} else if (a <= 1.8e-38) {
tmp = (-y * i) * j;
} else {
tmp = (b * a) * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if a <= -46000000000000.0: tmp = b * (a * i) elif a <= -7.2e-245: tmp = c * (j * t) elif a <= 1.8e-38: tmp = (-y * i) * j else: tmp = (b * a) * i return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (a <= -46000000000000.0) tmp = Float64(b * Float64(a * i)); elseif (a <= -7.2e-245) tmp = Float64(c * Float64(j * t)); elseif (a <= 1.8e-38) tmp = Float64(Float64(Float64(-y) * i) * j); else tmp = Float64(Float64(b * a) * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (a <= -46000000000000.0) tmp = b * (a * i); elseif (a <= -7.2e-245) tmp = c * (j * t); elseif (a <= 1.8e-38) tmp = (-y * i) * j; else tmp = (b * a) * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -46000000000000.0], N[(b * N[(a * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -7.2e-245], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e-38], N[(N[((-y) * i), $MachinePrecision] * j), $MachinePrecision], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -46000000000000:\\
\;\;\;\;b \cdot \left(a \cdot i\right)\\
\mathbf{elif}\;a \leq -7.2 \cdot 10^{-245}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-38}:\\
\;\;\;\;\left(\left(-y\right) \cdot i\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\end{array}
\end{array}
if a < -4.6e13Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
lower-*.f6422.0
Applied rewrites22.0%
if -4.6e13 < a < -7.19999999999999999e-245Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if -7.19999999999999999e-245 < a < 1.8e-38Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
if 1.8e-38 < a Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.3
Applied rewrites22.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (* j t))))
(if (<= t -6.1e+71)
t_1
(if (<= t -6.4e-261)
(* b (* a i))
(if (<= t 3.8e+88) (* x (* y z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (j * t);
double tmp;
if (t <= -6.1e+71) {
tmp = t_1;
} else if (t <= -6.4e-261) {
tmp = b * (a * i);
} else if (t <= 3.8e+88) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = c * (j * t)
if (t <= (-6.1d+71)) then
tmp = t_1
else if (t <= (-6.4d-261)) then
tmp = b * (a * i)
else if (t <= 3.8d+88) then
tmp = x * (y * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (j * t);
double tmp;
if (t <= -6.1e+71) {
tmp = t_1;
} else if (t <= -6.4e-261) {
tmp = b * (a * i);
} else if (t <= 3.8e+88) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * (j * t) tmp = 0 if t <= -6.1e+71: tmp = t_1 elif t <= -6.4e-261: tmp = b * (a * i) elif t <= 3.8e+88: tmp = x * (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(j * t)) tmp = 0.0 if (t <= -6.1e+71) tmp = t_1; elseif (t <= -6.4e-261) tmp = Float64(b * Float64(a * i)); elseif (t <= 3.8e+88) tmp = Float64(x * Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = c * (j * t); tmp = 0.0; if (t <= -6.1e+71) tmp = t_1; elseif (t <= -6.4e-261) tmp = b * (a * i); elseif (t <= 3.8e+88) tmp = x * (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.1e+71], t$95$1, If[LessEqual[t, -6.4e-261], N[(b * N[(a * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e+88], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t\right)\\
\mathbf{if}\;t \leq -6.1 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -6.4 \cdot 10^{-261}:\\
\;\;\;\;b \cdot \left(a \cdot i\right)\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+88}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.1000000000000003e71 or 3.7999999999999997e88 < t Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if -6.1000000000000003e71 < t < -6.40000000000000008e-261Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
lower-*.f6422.0
Applied rewrites22.0%
if -6.40000000000000008e-261 < t < 3.7999999999999997e88Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6421.7
Applied rewrites21.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (* j t))))
(if (<= t -5.6e+71)
t_1
(if (<= t -6.2e-261)
(* (* b a) i)
(if (<= t 3.8e+88) (* x (* y z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (j * t);
double tmp;
if (t <= -5.6e+71) {
tmp = t_1;
} else if (t <= -6.2e-261) {
tmp = (b * a) * i;
} else if (t <= 3.8e+88) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = c * (j * t)
if (t <= (-5.6d+71)) then
tmp = t_1
else if (t <= (-6.2d-261)) then
tmp = (b * a) * i
else if (t <= 3.8d+88) then
tmp = x * (y * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (j * t);
double tmp;
if (t <= -5.6e+71) {
tmp = t_1;
} else if (t <= -6.2e-261) {
tmp = (b * a) * i;
} else if (t <= 3.8e+88) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * (j * t) tmp = 0 if t <= -5.6e+71: tmp = t_1 elif t <= -6.2e-261: tmp = (b * a) * i elif t <= 3.8e+88: tmp = x * (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(j * t)) tmp = 0.0 if (t <= -5.6e+71) tmp = t_1; elseif (t <= -6.2e-261) tmp = Float64(Float64(b * a) * i); elseif (t <= 3.8e+88) tmp = Float64(x * Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = c * (j * t); tmp = 0.0; if (t <= -5.6e+71) tmp = t_1; elseif (t <= -6.2e-261) tmp = (b * a) * i; elseif (t <= 3.8e+88) tmp = x * (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e+71], t$95$1, If[LessEqual[t, -6.2e-261], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, 3.8e+88], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t\right)\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -6.2 \cdot 10^{-261}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+88}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.60000000000000004e71 or 3.7999999999999997e88 < t Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if -5.60000000000000004e71 < t < -6.1999999999999997e-261Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.3
Applied rewrites22.3%
if -6.1999999999999997e-261 < t < 3.7999999999999997e88Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6421.7
Applied rewrites21.7%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* x (* y z)))) (if (<= z -6e+30) t_1 (if (<= z 2.5e+45) (* a (* b i)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * (y * z);
double tmp;
if (z <= -6e+30) {
tmp = t_1;
} else if (z <= 2.5e+45) {
tmp = a * (b * i);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = x * (y * z)
if (z <= (-6d+30)) then
tmp = t_1
else if (z <= 2.5d+45) then
tmp = a * (b * i)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * (y * z);
double tmp;
if (z <= -6e+30) {
tmp = t_1;
} else if (z <= 2.5e+45) {
tmp = a * (b * i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * (y * z) tmp = 0 if z <= -6e+30: tmp = t_1 elif z <= 2.5e+45: tmp = a * (b * i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(y * z)) tmp = 0.0 if (z <= -6e+30) tmp = t_1; elseif (z <= 2.5e+45) tmp = Float64(a * Float64(b * i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = x * (y * z); tmp = 0.0; if (z <= -6e+30) tmp = t_1; elseif (z <= 2.5e+45) tmp = a * (b * i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+30], t$95$1, If[LessEqual[z, 2.5e+45], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+45}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.99999999999999956e30 or 2.5e45 < z Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6421.7
Applied rewrites21.7%
if -5.99999999999999956e30 < z < 2.5e45Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
(FPCore (x y z t a b c i j) :precision binary64 (* a (* b i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * (b * 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 = a * (b * 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 a * (b * i);
}
def code(x, y, z, t, a, b, c, i, j): return a * (b * i)
function code(x, y, z, t, a, b, c, i, j) return Float64(a * Float64(b * i)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = a * (b * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \left(b \cdot i\right)
\end{array}
Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
herbie shell --seed 2025142
(FPCore (x y z t a b c i j)
:name "Linear.Matrix:det33 from linear-1.19.1.3"
:precision binary64
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))