
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c t) (* i y))))
(if (<=
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j t_1))
INFINITY)
(fma (- (* i a) (* c z)) b (fma (- (* z y) (* a t)) x (* t_1 j)))
(*
(- y)
(fma (- x) z (fma j i (- (/ (fma (- a) (* t x) (* (* j t) c)) y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * t) - (i * y);
double tmp;
if ((((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * t_1)) <= ((double) INFINITY)) {
tmp = fma(((i * a) - (c * z)), b, fma(((z * y) - (a * t)), x, (t_1 * j)));
} else {
tmp = -y * fma(-x, z, fma(j, i, -(fma(-a, (t * x), ((j * t) * c)) / y)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * t) - Float64(i * y)) tmp = 0.0 if (Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * t_1)) <= Inf) tmp = fma(Float64(Float64(i * a) - Float64(c * z)), b, fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(t_1 * j))); else tmp = Float64(Float64(-y) * fma(Float64(-x), z, fma(j, i, Float64(-Float64(fma(Float64(-a), Float64(t * x), Float64(Float64(j * t) * c)) / y))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * t$95$1), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(t$95$1 * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-y) * N[((-x) * z + N[(j * i + (-N[(N[((-a) * N[(t * x), $MachinePrecision] + N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot t - i \cdot y\\
\mathbf{if}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(z \cdot y - a \cdot t, x, t\_1 \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) \cdot \mathsf{fma}\left(-x, z, \mathsf{fma}\left(j, i, -\frac{\mathsf{fma}\left(-a, t \cdot x, \left(j \cdot t\right) \cdot c\right)}{y}\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 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
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 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in y around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
+-commutativeN/A
*-commutativeN/A
Applied rewrites58.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* i a) (* c z))) (t_2 (fma (- i) j (* z x))))
(if (<= t -56000.0)
(- (fma (- (* z y) (* a t)) x (* (* j t) c)) (* (* c b) z))
(if (<= t 3.7e+134)
(fma t_1 b (fma t_2 y (* (* (- a) t) x)))
(if (<= t 1.8e+255)
(* (fma (- a) x (* j c)) t)
(fma t_1 b (* (fma y (/ t_2 t) (* (- a) x)) t)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * a) - (c * z);
double t_2 = fma(-i, j, (z * x));
double tmp;
if (t <= -56000.0) {
tmp = fma(((z * y) - (a * t)), x, ((j * t) * c)) - ((c * b) * z);
} else if (t <= 3.7e+134) {
tmp = fma(t_1, b, fma(t_2, y, ((-a * t) * x)));
} else if (t <= 1.8e+255) {
tmp = fma(-a, x, (j * c)) * t;
} else {
tmp = fma(t_1, b, (fma(y, (t_2 / t), (-a * x)) * t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * a) - Float64(c * z)) t_2 = fma(Float64(-i), j, Float64(z * x)) tmp = 0.0 if (t <= -56000.0) tmp = Float64(fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(j * t) * c)) - Float64(Float64(c * b) * z)); elseif (t <= 3.7e+134) tmp = fma(t_1, b, fma(t_2, y, Float64(Float64(Float64(-a) * t) * x))); elseif (t <= 1.8e+255) tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); else tmp = fma(t_1, b, Float64(fma(y, Float64(t_2 / t), Float64(Float64(-a) * x)) * t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -56000.0], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e+134], N[(t$95$1 * b + N[(t$95$2 * y + N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e+255], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], N[(t$95$1 * b + N[(N[(y * N[(t$95$2 / t), $MachinePrecision] + N[((-a) * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot a - c \cdot z\\
t_2 := \mathsf{fma}\left(-i, j, z \cdot x\right)\\
\mathbf{if}\;t \leq -56000:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(j \cdot t\right) \cdot c\right) - \left(c \cdot b\right) \cdot z\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+134}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, \mathsf{fma}\left(t\_2, y, \left(\left(-a\right) \cdot t\right) \cdot x\right)\right)\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{+255}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, \mathsf{fma}\left(y, \frac{t\_2}{t}, \left(-a\right) \cdot x\right) \cdot t\right)\\
\end{array}
\end{array}
if t < -56000Initial program 74.6%
Taylor expanded in i around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6459.3
Applied rewrites59.3%
if -56000 < t < 3.70000000000000013e134Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites75.8%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lower-fma.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
associate-*r*N/A
lift-neg.f64N/A
mul-1-negN/A
associate-*r*N/A
Applied rewrites69.1%
if 3.70000000000000013e134 < t < 1.7999999999999999e255Initial program 74.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
if 1.7999999999999999e255 < t Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites75.8%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lower-fma.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
associate-*r*N/A
lift-neg.f64N/A
mul-1-negN/A
associate-*r*N/A
Applied rewrites69.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites61.4%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -56000.0)
(- (fma (- (* z y) (* a t)) x (* (* j t) c)) (* (* c b) z))
(if (<= t 3.7e+134)
(fma
(- (* i a) (* c z))
b
(fma (fma (- i) j (* z x)) y (* (* (- a) t) x)))
(* (fma (- a) x (* j c)) 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 <= -56000.0) {
tmp = fma(((z * y) - (a * t)), x, ((j * t) * c)) - ((c * b) * z);
} else if (t <= 3.7e+134) {
tmp = fma(((i * a) - (c * z)), b, fma(fma(-i, j, (z * x)), y, ((-a * t) * x)));
} else {
tmp = fma(-a, x, (j * c)) * t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -56000.0) tmp = Float64(fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(j * t) * c)) - Float64(Float64(c * b) * z)); elseif (t <= 3.7e+134) tmp = fma(Float64(Float64(i * a) - Float64(c * z)), b, fma(fma(Float64(-i), j, Float64(z * x)), y, Float64(Float64(Float64(-a) * t) * x))); else tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -56000.0], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e+134], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b + N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y + N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -56000:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(j \cdot t\right) \cdot c\right) - \left(c \cdot b\right) \cdot z\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+134}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(\mathsf{fma}\left(-i, j, z \cdot x\right), y, \left(\left(-a\right) \cdot t\right) \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\end{array}
\end{array}
if t < -56000Initial program 74.6%
Taylor expanded in i around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6459.3
Applied rewrites59.3%
if -56000 < t < 3.70000000000000013e134Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites75.8%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lower-fma.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
associate-*r*N/A
lift-neg.f64N/A
mul-1-negN/A
associate-*r*N/A
Applied rewrites69.1%
if 3.70000000000000013e134 < t Initial program 74.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) x (* j c)) t)))
(if (<= t -1.35e+135)
t_1
(if (<= t -3.1e-28)
(fma (- (* z y) (* a t)) x (* (- (* c t) (* i y)) j))
(if (<= t 1.75e+98)
(- (* (fma (- i) j (* z x)) y) (* (- (* c z) (* i a)) b))
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-a, x, (j * c)) * t;
double tmp;
if (t <= -1.35e+135) {
tmp = t_1;
} else if (t <= -3.1e-28) {
tmp = fma(((z * y) - (a * t)), x, (((c * t) - (i * y)) * j));
} else if (t <= 1.75e+98) {
tmp = (fma(-i, j, (z * x)) * y) - (((c * z) - (i * a)) * b);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), x, Float64(j * c)) * t) tmp = 0.0 if (t <= -1.35e+135) tmp = t_1; elseif (t <= -3.1e-28) tmp = fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(Float64(c * t) - Float64(i * y)) * j)); elseif (t <= 1.75e+98) tmp = Float64(Float64(fma(Float64(-i), j, Float64(z * x)) * y) - Float64(Float64(Float64(c * z) - Float64(i * a)) * b)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.35e+135], t$95$1, If[LessEqual[t, -3.1e-28], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e+98], N[(N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-28}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y - \left(c \cdot z - i \cdot a\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.34999999999999992e135 or 1.75e98 < t Initial program 74.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
if -1.34999999999999992e135 < t < -3.09999999999999992e-28Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
if -3.09999999999999992e-28 < t < 1.75e98Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites75.8%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lower-fma.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
associate-*r*N/A
lift-neg.f64N/A
mul-1-negN/A
associate-*r*N/A
Applied rewrites69.1%
Taylor expanded in t around 0
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
associate-*l*N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
mul-1-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-inN/A
lower--.f64N/A
Applied rewrites59.6%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -1.75)
(- (fma (- (* z y) (* a t)) x (* (* j t) c)) (* (* c b) z))
(if (<= t 1.75e+98)
(- (* (fma (- i) j (* z x)) y) (* (- (* c z) (* i a)) b))
(* (fma (- a) x (* j c)) 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 <= -1.75) {
tmp = fma(((z * y) - (a * t)), x, ((j * t) * c)) - ((c * b) * z);
} else if (t <= 1.75e+98) {
tmp = (fma(-i, j, (z * x)) * y) - (((c * z) - (i * a)) * b);
} else {
tmp = fma(-a, x, (j * c)) * t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -1.75) tmp = Float64(fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(j * t) * c)) - Float64(Float64(c * b) * z)); elseif (t <= 1.75e+98) tmp = Float64(Float64(fma(Float64(-i), j, Float64(z * x)) * y) - Float64(Float64(Float64(c * z) - Float64(i * a)) * b)); else tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.75], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e+98], N[(N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(j \cdot t\right) \cdot c\right) - \left(c \cdot b\right) \cdot z\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y - \left(c \cdot z - i \cdot a\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\end{array}
\end{array}
if t < -1.75Initial program 74.6%
Taylor expanded in i around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6459.3
Applied rewrites59.3%
if -1.75 < t < 1.75e98Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites75.8%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lower-fma.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
associate-*r*N/A
lift-neg.f64N/A
mul-1-negN/A
associate-*r*N/A
Applied rewrites69.1%
Taylor expanded in t around 0
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
associate-*l*N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
mul-1-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-inN/A
lower--.f64N/A
Applied rewrites59.6%
if 1.75e98 < t Initial program 74.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -4.5e+192)
(* (* (+ (/ (* (- c) z) i) a) i) b)
(if (<= b 1.75e+87)
(fma (- (* z y) (* a t)) x (* (- (* c t) (* i y)) j))
(fma (- (* i a) (* c z)) b (* (* (- 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 (b <= -4.5e+192) {
tmp = ((((-c * z) / i) + a) * i) * b;
} else if (b <= 1.75e+87) {
tmp = fma(((z * y) - (a * t)), x, (((c * t) - (i * y)) * j));
} else {
tmp = fma(((i * a) - (c * z)), b, ((-a * t) * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -4.5e+192) tmp = Float64(Float64(Float64(Float64(Float64(Float64(-c) * z) / i) + a) * i) * b); elseif (b <= 1.75e+87) tmp = fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(Float64(c * t) - Float64(i * y)) * j)); else tmp = fma(Float64(Float64(i * a) - Float64(c * z)), b, Float64(Float64(Float64(-a) * t) * x)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -4.5e+192], N[(N[(N[(N[(N[((-c) * z), $MachinePrecision] / i), $MachinePrecision] + a), $MachinePrecision] * i), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 1.75e+87], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b + N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+192}:\\
\;\;\;\;\left(\left(\frac{\left(-c\right) \cdot z}{i} + a\right) \cdot i\right) \cdot b\\
\mathbf{elif}\;b \leq 1.75 \cdot 10^{+87}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, \left(\left(-a\right) \cdot t\right) \cdot x\right)\\
\end{array}
\end{array}
if b < -4.5e192Initial program 74.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.2
Applied rewrites39.2%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6439.7
Applied rewrites39.7%
if -4.5e192 < b < 1.74999999999999993e87Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
if 1.74999999999999993e87 < b Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites75.8%
Taylor expanded in a around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
associate-*r*N/A
lift-neg.f64N/A
mul-1-negN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6450.2
Applied rewrites50.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) x (* j c)) t)))
(if (<= t -4.8e-14)
t_1
(if (<= t -1.7e-82)
(* (* (fma a (/ b j) (- y)) j) i)
(if (<= t -2.3e-259)
(* (- (* y x) (* c b)) z)
(if (<= t 5e-274)
(* (fma (- j) y (* b a)) i)
(if (<= t 8.4e+99) (* (fma (- i) j (* z x)) 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(-a, x, (j * c)) * t;
double tmp;
if (t <= -4.8e-14) {
tmp = t_1;
} else if (t <= -1.7e-82) {
tmp = (fma(a, (b / j), -y) * j) * i;
} else if (t <= -2.3e-259) {
tmp = ((y * x) - (c * b)) * z;
} else if (t <= 5e-274) {
tmp = fma(-j, y, (b * a)) * i;
} else if (t <= 8.4e+99) {
tmp = fma(-i, j, (z * x)) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), x, Float64(j * c)) * t) tmp = 0.0 if (t <= -4.8e-14) tmp = t_1; elseif (t <= -1.7e-82) tmp = Float64(Float64(fma(a, Float64(b / j), Float64(-y)) * j) * i); elseif (t <= -2.3e-259) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); elseif (t <= 5e-274) tmp = Float64(fma(Float64(-j), y, Float64(b * a)) * i); elseif (t <= 8.4e+99) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -4.8e-14], t$95$1, If[LessEqual[t, -1.7e-82], N[(N[(N[(a * N[(b / j), $MachinePrecision] + (-y)), $MachinePrecision] * j), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, -2.3e-259], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 5e-274], N[(N[((-j) * y + N[(b * a), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, 8.4e+99], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{-82}:\\
\;\;\;\;\left(\mathsf{fma}\left(a, \frac{b}{j}, -y\right) \cdot j\right) \cdot i\\
\mathbf{elif}\;t \leq -2.3 \cdot 10^{-259}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-274}:\\
\;\;\;\;\mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{+99}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.8e-14 or 8.40000000000000041e99 < t Initial program 74.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
if -4.8e-14 < t < -1.69999999999999988e-82Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.2
Applied rewrites40.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-neg.f6440.2
Applied rewrites40.2%
if -1.69999999999999988e-82 < t < -2.2999999999999999e-259Initial program 74.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.0
Applied rewrites39.0%
if -2.2999999999999999e-259 < t < 5e-274Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.2
Applied rewrites40.2%
if 5e-274 < t < 8.40000000000000041e99Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- j) y (* b a)) i)) (t_2 (* (fma (- a) x (* j c)) t)))
(if (<= t -3.3e-25)
t_2
(if (<= t -2e-74)
t_1
(if (<= t -2.3e-259)
(* (- (* y x) (* c b)) z)
(if (<= t 5e-274)
t_1
(if (<= t 8.4e+99) (* (fma (- i) j (* z x)) y) t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-j, y, (b * a)) * i;
double t_2 = fma(-a, x, (j * c)) * t;
double tmp;
if (t <= -3.3e-25) {
tmp = t_2;
} else if (t <= -2e-74) {
tmp = t_1;
} else if (t <= -2.3e-259) {
tmp = ((y * x) - (c * b)) * z;
} else if (t <= 5e-274) {
tmp = t_1;
} else if (t <= 8.4e+99) {
tmp = fma(-i, j, (z * x)) * y;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-j), y, Float64(b * a)) * i) t_2 = Float64(fma(Float64(-a), x, Float64(j * c)) * t) tmp = 0.0 if (t <= -3.3e-25) tmp = t_2; elseif (t <= -2e-74) tmp = t_1; elseif (t <= -2.3e-259) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); elseif (t <= 5e-274) tmp = t_1; elseif (t <= 8.4e+99) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-j) * y + N[(b * a), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3.3e-25], t$95$2, If[LessEqual[t, -2e-74], t$95$1, If[LessEqual[t, -2.3e-259], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 5e-274], t$95$1, If[LessEqual[t, 8.4e+99], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i\\
t_2 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{if}\;t \leq -3.3 \cdot 10^{-25}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.3 \cdot 10^{-259}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-274}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{+99}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -3.2999999999999998e-25 or 8.40000000000000041e99 < t Initial program 74.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
if -3.2999999999999998e-25 < t < -1.99999999999999992e-74 or -2.2999999999999999e-259 < t < 5e-274Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.2
Applied rewrites40.2%
if -1.99999999999999992e-74 < t < -2.2999999999999999e-259Initial program 74.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.0
Applied rewrites39.0%
if 5e-274 < t < 8.40000000000000041e99Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- t) x (* i b)) a)))
(if (<= a -1.65e+81)
t_1
(if (<= a 9.2e+64) (+ (* (* z y) x) (* 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(-t, x, (i * b)) * a;
double tmp;
if (a <= -1.65e+81) {
tmp = t_1;
} else if (a <= 9.2e+64) {
tmp = ((z * y) * x) + (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(fma(Float64(-t), x, Float64(i * b)) * a) tmp = 0.0 if (a <= -1.65e+81) tmp = t_1; elseif (a <= 9.2e+64) tmp = Float64(Float64(Float64(z * y) * x) + 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[(N[((-t) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -1.65e+81], t$95$1, If[LessEqual[a, 9.2e+64], N[(N[(N[(z * y), $MachinePrecision] * x), $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(-t, x, i \cdot b\right) \cdot a\\
\mathbf{if}\;a \leq -1.65 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9.2 \cdot 10^{+64}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.65e81 or 9.2e64 < a Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.9
Applied rewrites38.9%
if -1.65e81 < a < 9.2e64Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6450.4
Applied rewrites50.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) x (* j c)) t)))
(if (<= t -1.25e-5)
t_1
(if (<= t -8e-178)
(* (- (* y x) (* c b)) z)
(if (<= t 1.1e-278)
(* (- (* i a) (* c z)) b)
(if (<= t 8.4e+99) (* (fma (- i) j (* z x)) 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(-a, x, (j * c)) * t;
double tmp;
if (t <= -1.25e-5) {
tmp = t_1;
} else if (t <= -8e-178) {
tmp = ((y * x) - (c * b)) * z;
} else if (t <= 1.1e-278) {
tmp = ((i * a) - (c * z)) * b;
} else if (t <= 8.4e+99) {
tmp = fma(-i, j, (z * x)) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), x, Float64(j * c)) * t) tmp = 0.0 if (t <= -1.25e-5) tmp = t_1; elseif (t <= -8e-178) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); elseif (t <= 1.1e-278) tmp = Float64(Float64(Float64(i * a) - Float64(c * z)) * b); elseif (t <= 8.4e+99) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.25e-5], t$95$1, If[LessEqual[t, -8e-178], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 1.1e-278], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 8.4e+99], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{if}\;t \leq -1.25 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-178}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-278}:\\
\;\;\;\;\left(i \cdot a - c \cdot z\right) \cdot b\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{+99}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.25000000000000006e-5 or 8.40000000000000041e99 < t Initial program 74.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
if -1.25000000000000006e-5 < t < -7.9999999999999996e-178Initial program 74.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.0
Applied rewrites39.0%
if -7.9999999999999996e-178 < t < 1.1e-278Initial program 74.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.2
Applied rewrites39.2%
if 1.1e-278 < t < 8.40000000000000041e99Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) x (* j c)) t)))
(if (<= t -1.25e-5)
t_1
(if (<= t 3.1e-70)
(* (- (* y x) (* c b)) z)
(if (<= t 1.82e+101) (* (- (* c t) (* 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(-a, x, (j * c)) * t;
double tmp;
if (t <= -1.25e-5) {
tmp = t_1;
} else if (t <= 3.1e-70) {
tmp = ((y * x) - (c * b)) * z;
} else if (t <= 1.82e+101) {
tmp = ((c * t) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), x, Float64(j * c)) * t) tmp = 0.0 if (t <= -1.25e-5) tmp = t_1; elseif (t <= 3.1e-70) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); elseif (t <= 1.82e+101) tmp = Float64(Float64(Float64(c * t) - 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[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.25e-5], t$95$1, If[LessEqual[t, 3.1e-70], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 1.82e+101], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{if}\;t \leq -1.25 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-70}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{elif}\;t \leq 1.82 \cdot 10^{+101}:\\
\;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.25000000000000006e-5 or 1.82000000000000003e101 < t Initial program 74.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
if -1.25000000000000006e-5 < t < 3.1e-70Initial program 74.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.0
Applied rewrites39.0%
if 3.1e-70 < t < 1.82000000000000003e101Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* i a) (* c z)) b)) (t_2 (* (- (* z y) (* a t)) x)))
(if (<= x -9.6e+25)
t_2
(if (<= x -3.15e-232)
(* (- (* j t) (* b z)) c)
(if (<= x 2.15e-278)
t_1
(if (<= x 2.05e-190)
(* (- (* c t) (* i y)) j)
(if (<= x 2.5e+30) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * a) - (c * z)) * b;
double t_2 = ((z * y) - (a * t)) * x;
double tmp;
if (x <= -9.6e+25) {
tmp = t_2;
} else if (x <= -3.15e-232) {
tmp = ((j * t) - (b * z)) * c;
} else if (x <= 2.15e-278) {
tmp = t_1;
} else if (x <= 2.05e-190) {
tmp = ((c * t) - (i * y)) * j;
} else if (x <= 2.5e+30) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((i * a) - (c * z)) * b
t_2 = ((z * y) - (a * t)) * x
if (x <= (-9.6d+25)) then
tmp = t_2
else if (x <= (-3.15d-232)) then
tmp = ((j * t) - (b * z)) * c
else if (x <= 2.15d-278) then
tmp = t_1
else if (x <= 2.05d-190) then
tmp = ((c * t) - (i * y)) * j
else if (x <= 2.5d+30) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * a) - (c * z)) * b;
double t_2 = ((z * y) - (a * t)) * x;
double tmp;
if (x <= -9.6e+25) {
tmp = t_2;
} else if (x <= -3.15e-232) {
tmp = ((j * t) - (b * z)) * c;
} else if (x <= 2.15e-278) {
tmp = t_1;
} else if (x <= 2.05e-190) {
tmp = ((c * t) - (i * y)) * j;
} else if (x <= 2.5e+30) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * a) - (c * z)) * b t_2 = ((z * y) - (a * t)) * x tmp = 0 if x <= -9.6e+25: tmp = t_2 elif x <= -3.15e-232: tmp = ((j * t) - (b * z)) * c elif x <= 2.15e-278: tmp = t_1 elif x <= 2.05e-190: tmp = ((c * t) - (i * y)) * j elif x <= 2.5e+30: 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(i * a) - Float64(c * z)) * b) t_2 = Float64(Float64(Float64(z * y) - Float64(a * t)) * x) tmp = 0.0 if (x <= -9.6e+25) tmp = t_2; elseif (x <= -3.15e-232) tmp = Float64(Float64(Float64(j * t) - Float64(b * z)) * c); elseif (x <= 2.15e-278) tmp = t_1; elseif (x <= 2.05e-190) tmp = Float64(Float64(Float64(c * t) - Float64(i * y)) * j); elseif (x <= 2.5e+30) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((i * a) - (c * z)) * b; t_2 = ((z * y) - (a * t)) * x; tmp = 0.0; if (x <= -9.6e+25) tmp = t_2; elseif (x <= -3.15e-232) tmp = ((j * t) - (b * z)) * c; elseif (x <= 2.15e-278) tmp = t_1; elseif (x <= 2.05e-190) tmp = ((c * t) - (i * y)) * j; elseif (x <= 2.5e+30) 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[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -9.6e+25], t$95$2, If[LessEqual[x, -3.15e-232], N[(N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 2.15e-278], t$95$1, If[LessEqual[x, 2.05e-190], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[x, 2.5e+30], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot a - c \cdot z\right) \cdot b\\
t_2 := \left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{if}\;x \leq -9.6 \cdot 10^{+25}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -3.15 \cdot 10^{-232}:\\
\;\;\;\;\left(j \cdot t - b \cdot z\right) \cdot c\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-278}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-190}:\\
\;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -9.59999999999999984e25 or 2.4999999999999999e30 < x Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites75.8%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6438.6
Applied rewrites38.6%
if -9.59999999999999984e25 < x < -3.15000000000000005e-232Initial program 74.6%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.4
Applied rewrites40.4%
if -3.15000000000000005e-232 < x < 2.15e-278 or 2.0500000000000001e-190 < x < 2.4999999999999999e30Initial program 74.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.2
Applied rewrites39.2%
if 2.15e-278 < x < 2.0500000000000001e-190Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- t) x (* i b)) a)))
(if (<= a -1.2e+123)
t_1
(if (<= a -1.3e+40)
(* (- (* y x) (* c b)) z)
(if (<= a 9.2e+64) (* (- (* c t) (* 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(-t, x, (i * b)) * a;
double tmp;
if (a <= -1.2e+123) {
tmp = t_1;
} else if (a <= -1.3e+40) {
tmp = ((y * x) - (c * b)) * z;
} else if (a <= 9.2e+64) {
tmp = ((c * t) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-t), x, Float64(i * b)) * a) tmp = 0.0 if (a <= -1.2e+123) tmp = t_1; elseif (a <= -1.3e+40) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); elseif (a <= 9.2e+64) tmp = Float64(Float64(Float64(c * t) - 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[((-t) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -1.2e+123], t$95$1, If[LessEqual[a, -1.3e+40], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 9.2e+64], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-t, x, i \cdot b\right) \cdot a\\
\mathbf{if}\;a \leq -1.2 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.3 \cdot 10^{+40}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{elif}\;a \leq 9.2 \cdot 10^{+64}:\\
\;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.19999999999999994e123 or 9.2e64 < a Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.9
Applied rewrites38.9%
if -1.19999999999999994e123 < a < -1.3e40Initial program 74.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.0
Applied rewrites39.0%
if -1.3e40 < a < 9.2e64Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* y x) (* c b)) z))) (if (<= z -1.95e-66) t_1 (if (<= z 1150.0) (* (- (* c t) (* 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 = ((y * x) - (c * b)) * z;
double tmp;
if (z <= -1.95e-66) {
tmp = t_1;
} else if (z <= 1150.0) {
tmp = ((c * t) - (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 = ((y * x) - (c * b)) * z
if (z <= (-1.95d-66)) then
tmp = t_1
else if (z <= 1150.0d0) then
tmp = ((c * t) - (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 = ((y * x) - (c * b)) * z;
double tmp;
if (z <= -1.95e-66) {
tmp = t_1;
} else if (z <= 1150.0) {
tmp = ((c * t) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((y * x) - (c * b)) * z tmp = 0 if z <= -1.95e-66: tmp = t_1 elif z <= 1150.0: tmp = ((c * t) - (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(y * x) - Float64(c * b)) * z) tmp = 0.0 if (z <= -1.95e-66) tmp = t_1; elseif (z <= 1150.0) tmp = Float64(Float64(Float64(c * t) - 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 = ((y * x) - (c * b)) * z; tmp = 0.0; if (z <= -1.95e-66) tmp = t_1; elseif (z <= 1150.0) tmp = ((c * t) - (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[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.95e-66], t$95$1, If[LessEqual[z, 1150.0], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{if}\;z \leq -1.95 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1150:\\
\;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.94999999999999991e-66 or 1150 < z Initial program 74.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.0
Applied rewrites39.0%
if -1.94999999999999991e-66 < z < 1150Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* i a) (* c z)) b)))
(if (<= b -6.2e-65)
t_1
(if (<= b 15200000000000.0) (* (- (* c t) (* 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 * a) - (c * z)) * b;
double tmp;
if (b <= -6.2e-65) {
tmp = t_1;
} else if (b <= 15200000000000.0) {
tmp = ((c * t) - (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 * a) - (c * z)) * b
if (b <= (-6.2d-65)) then
tmp = t_1
else if (b <= 15200000000000.0d0) then
tmp = ((c * t) - (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 * a) - (c * z)) * b;
double tmp;
if (b <= -6.2e-65) {
tmp = t_1;
} else if (b <= 15200000000000.0) {
tmp = ((c * t) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * a) - (c * z)) * b tmp = 0 if b <= -6.2e-65: tmp = t_1 elif b <= 15200000000000.0: tmp = ((c * t) - (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 * a) - Float64(c * z)) * b) tmp = 0.0 if (b <= -6.2e-65) tmp = t_1; elseif (b <= 15200000000000.0) tmp = Float64(Float64(Float64(c * t) - 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 * a) - (c * z)) * b; tmp = 0.0; if (b <= -6.2e-65) tmp = t_1; elseif (b <= 15200000000000.0) tmp = ((c * t) - (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 * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -6.2e-65], t$95$1, If[LessEqual[b, 15200000000000.0], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot a - c \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -6.2 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 15200000000000:\\
\;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.20000000000000032e-65 or 1.52e13 < b Initial program 74.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.2
Applied rewrites39.2%
if -6.20000000000000032e-65 < b < 1.52e13Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* (* c b) z))))
(if (<= b -3.4e+246)
(* (* i b) a)
(if (<= b -4.2e+161)
t_1
(if (<= b 3.45e+19) (* (- (* c t) (* 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 = -((c * b) * z);
double tmp;
if (b <= -3.4e+246) {
tmp = (i * b) * a;
} else if (b <= -4.2e+161) {
tmp = t_1;
} else if (b <= 3.45e+19) {
tmp = ((c * t) - (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 = -((c * b) * z)
if (b <= (-3.4d+246)) then
tmp = (i * b) * a
else if (b <= (-4.2d+161)) then
tmp = t_1
else if (b <= 3.45d+19) then
tmp = ((c * t) - (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 = -((c * b) * z);
double tmp;
if (b <= -3.4e+246) {
tmp = (i * b) * a;
} else if (b <= -4.2e+161) {
tmp = t_1;
} else if (b <= 3.45e+19) {
tmp = ((c * t) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = -((c * b) * z) tmp = 0 if b <= -3.4e+246: tmp = (i * b) * a elif b <= -4.2e+161: tmp = t_1 elif b <= 3.45e+19: tmp = ((c * t) - (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(c * b) * z)) tmp = 0.0 if (b <= -3.4e+246) tmp = Float64(Float64(i * b) * a); elseif (b <= -4.2e+161) tmp = t_1; elseif (b <= 3.45e+19) tmp = Float64(Float64(Float64(c * t) - 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 = -((c * b) * z); tmp = 0.0; if (b <= -3.4e+246) tmp = (i * b) * a; elseif (b <= -4.2e+161) tmp = t_1; elseif (b <= 3.45e+19) tmp = ((c * t) - (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[(c * b), $MachinePrecision] * z), $MachinePrecision])}, If[LessEqual[b, -3.4e+246], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[b, -4.2e+161], t$95$1, If[LessEqual[b, 3.45e+19], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\left(c \cdot b\right) \cdot z\\
\mathbf{if}\;b \leq -3.4 \cdot 10^{+246}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{elif}\;b \leq -4.2 \cdot 10^{+161}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.45 \cdot 10^{+19}:\\
\;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.39999999999999988e246Initial program 74.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.2
Applied rewrites39.2%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.3
Applied rewrites22.3%
if -3.39999999999999988e246 < b < -4.2e161 or 3.45e19 < b Initial program 74.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.2
Applied rewrites39.2%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.4
Applied rewrites22.4%
if -4.2e161 < b < 3.45e19Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -1.8e-39)
(* (* c t) j)
(if (<= t -8.4e-178)
(* (* z x) y)
(if (<= t 1.12e-277)
(* (* b a) i)
(if (<= t 8.3e+102) (* (* (- i) y) j) (* (* j t) c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.8e-39) {
tmp = (c * t) * j;
} else if (t <= -8.4e-178) {
tmp = (z * x) * y;
} else if (t <= 1.12e-277) {
tmp = (b * a) * i;
} else if (t <= 8.3e+102) {
tmp = (-i * y) * j;
} else {
tmp = (j * t) * c;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (t <= (-1.8d-39)) then
tmp = (c * t) * j
else if (t <= (-8.4d-178)) then
tmp = (z * x) * y
else if (t <= 1.12d-277) then
tmp = (b * a) * i
else if (t <= 8.3d+102) then
tmp = (-i * y) * j
else
tmp = (j * t) * c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.8e-39) {
tmp = (c * t) * j;
} else if (t <= -8.4e-178) {
tmp = (z * x) * y;
} else if (t <= 1.12e-277) {
tmp = (b * a) * i;
} else if (t <= 8.3e+102) {
tmp = (-i * y) * j;
} else {
tmp = (j * t) * c;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -1.8e-39: tmp = (c * t) * j elif t <= -8.4e-178: tmp = (z * x) * y elif t <= 1.12e-277: tmp = (b * a) * i elif t <= 8.3e+102: tmp = (-i * y) * j else: tmp = (j * t) * c return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -1.8e-39) tmp = Float64(Float64(c * t) * j); elseif (t <= -8.4e-178) tmp = Float64(Float64(z * x) * y); elseif (t <= 1.12e-277) tmp = Float64(Float64(b * a) * i); elseif (t <= 8.3e+102) tmp = Float64(Float64(Float64(-i) * y) * j); else tmp = Float64(Float64(j * t) * c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -1.8e-39) tmp = (c * t) * j; elseif (t <= -8.4e-178) tmp = (z * x) * y; elseif (t <= 1.12e-277) tmp = (b * a) * i; elseif (t <= 8.3e+102) tmp = (-i * y) * j; else tmp = (j * t) * c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.8e-39], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[t, -8.4e-178], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.12e-277], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, 8.3e+102], N[(N[((-i) * y), $MachinePrecision] * j), $MachinePrecision], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\mathbf{elif}\;t \leq -8.4 \cdot 10^{-178}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-277}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;t \leq 8.3 \cdot 10^{+102}:\\
\;\;\;\;\left(\left(-i\right) \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\end{array}
\end{array}
if t < -1.8e-39Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
Taylor expanded in y around 0
lift-*.f6423.8
Applied rewrites23.8%
if -1.8e-39 < t < -8.4e-178Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6421.8
Applied rewrites21.8%
if -8.4e-178 < t < 1.12000000000000003e-277Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.2
Applied rewrites40.2%
Taylor expanded in y around 0
*-commutativeN/A
lift-*.f6422.7
Applied rewrites22.7%
if 1.12000000000000003e-277 < t < 8.3000000000000005e102Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
Taylor expanded in y around inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6422.4
Applied rewrites22.4%
if 8.3000000000000005e102 < t Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6423.7
Applied rewrites23.7%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -1.8e-39)
(* (* c t) j)
(if (<= t -8.4e-178)
(* (* z x) y)
(if (<= t 1.05e-278)
(* (* b a) i)
(if (<= t 8.3e+102) (* (- i) (* j y)) (* (* j t) c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.8e-39) {
tmp = (c * t) * j;
} else if (t <= -8.4e-178) {
tmp = (z * x) * y;
} else if (t <= 1.05e-278) {
tmp = (b * a) * i;
} else if (t <= 8.3e+102) {
tmp = -i * (j * y);
} else {
tmp = (j * t) * c;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (t <= (-1.8d-39)) then
tmp = (c * t) * j
else if (t <= (-8.4d-178)) then
tmp = (z * x) * y
else if (t <= 1.05d-278) then
tmp = (b * a) * i
else if (t <= 8.3d+102) then
tmp = -i * (j * y)
else
tmp = (j * t) * c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.8e-39) {
tmp = (c * t) * j;
} else if (t <= -8.4e-178) {
tmp = (z * x) * y;
} else if (t <= 1.05e-278) {
tmp = (b * a) * i;
} else if (t <= 8.3e+102) {
tmp = -i * (j * y);
} else {
tmp = (j * t) * c;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -1.8e-39: tmp = (c * t) * j elif t <= -8.4e-178: tmp = (z * x) * y elif t <= 1.05e-278: tmp = (b * a) * i elif t <= 8.3e+102: tmp = -i * (j * y) else: tmp = (j * t) * c return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -1.8e-39) tmp = Float64(Float64(c * t) * j); elseif (t <= -8.4e-178) tmp = Float64(Float64(z * x) * y); elseif (t <= 1.05e-278) tmp = Float64(Float64(b * a) * i); elseif (t <= 8.3e+102) tmp = Float64(Float64(-i) * Float64(j * y)); else tmp = Float64(Float64(j * t) * c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -1.8e-39) tmp = (c * t) * j; elseif (t <= -8.4e-178) tmp = (z * x) * y; elseif (t <= 1.05e-278) tmp = (b * a) * i; elseif (t <= 8.3e+102) tmp = -i * (j * y); else tmp = (j * t) * c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.8e-39], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[t, -8.4e-178], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.05e-278], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, 8.3e+102], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\mathbf{elif}\;t \leq -8.4 \cdot 10^{-178}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-278}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;t \leq 8.3 \cdot 10^{+102}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\end{array}
\end{array}
if t < -1.8e-39Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
Taylor expanded in y around 0
lift-*.f6423.8
Applied rewrites23.8%
if -1.8e-39 < t < -8.4e-178Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6421.8
Applied rewrites21.8%
if -8.4e-178 < t < 1.05000000000000007e-278Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.2
Applied rewrites40.2%
Taylor expanded in y around 0
*-commutativeN/A
lift-*.f6422.7
Applied rewrites22.7%
if 1.05000000000000007e-278 < t < 8.3000000000000005e102Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around 0
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if 8.3000000000000005e102 < t Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6423.7
Applied rewrites23.7%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -1.8e-39)
(* (* c t) j)
(if (<= t -8.4e-178)
(* (* z x) y)
(if (<= t 1.65e-276)
(* (* b a) i)
(if (<= t 0.021) (* (* y x) z) (* (* j t) c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.8e-39) {
tmp = (c * t) * j;
} else if (t <= -8.4e-178) {
tmp = (z * x) * y;
} else if (t <= 1.65e-276) {
tmp = (b * a) * i;
} else if (t <= 0.021) {
tmp = (y * x) * z;
} else {
tmp = (j * t) * c;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (t <= (-1.8d-39)) then
tmp = (c * t) * j
else if (t <= (-8.4d-178)) then
tmp = (z * x) * y
else if (t <= 1.65d-276) then
tmp = (b * a) * i
else if (t <= 0.021d0) then
tmp = (y * x) * z
else
tmp = (j * t) * c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.8e-39) {
tmp = (c * t) * j;
} else if (t <= -8.4e-178) {
tmp = (z * x) * y;
} else if (t <= 1.65e-276) {
tmp = (b * a) * i;
} else if (t <= 0.021) {
tmp = (y * x) * z;
} else {
tmp = (j * t) * c;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -1.8e-39: tmp = (c * t) * j elif t <= -8.4e-178: tmp = (z * x) * y elif t <= 1.65e-276: tmp = (b * a) * i elif t <= 0.021: tmp = (y * x) * z else: tmp = (j * t) * c return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -1.8e-39) tmp = Float64(Float64(c * t) * j); elseif (t <= -8.4e-178) tmp = Float64(Float64(z * x) * y); elseif (t <= 1.65e-276) tmp = Float64(Float64(b * a) * i); elseif (t <= 0.021) tmp = Float64(Float64(y * x) * z); else tmp = Float64(Float64(j * t) * c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -1.8e-39) tmp = (c * t) * j; elseif (t <= -8.4e-178) tmp = (z * x) * y; elseif (t <= 1.65e-276) tmp = (b * a) * i; elseif (t <= 0.021) tmp = (y * x) * z; else tmp = (j * t) * c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.8e-39], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[t, -8.4e-178], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.65e-276], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, 0.021], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\mathbf{elif}\;t \leq -8.4 \cdot 10^{-178}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-276}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;t \leq 0.021:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\end{array}
\end{array}
if t < -1.8e-39Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
Taylor expanded in y around 0
lift-*.f6423.8
Applied rewrites23.8%
if -1.8e-39 < t < -8.4e-178Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6421.8
Applied rewrites21.8%
if -8.4e-178 < t < 1.64999999999999996e-276Initial program 74.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.2
Applied rewrites40.2%
Taylor expanded in y around 0
*-commutativeN/A
lift-*.f6422.7
Applied rewrites22.7%
if 1.64999999999999996e-276 < t < 0.0210000000000000013Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
if 0.0210000000000000013 < t Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6423.7
Applied rewrites23.7%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -1.8e-39)
(* (* c t) j)
(if (<= t -8e-178)
(* (* z x) y)
(if (<= t 2.4e-274)
(* (* i b) a)
(if (<= t 0.021) (* (* y x) z) (* (* j t) c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.8e-39) {
tmp = (c * t) * j;
} else if (t <= -8e-178) {
tmp = (z * x) * y;
} else if (t <= 2.4e-274) {
tmp = (i * b) * a;
} else if (t <= 0.021) {
tmp = (y * x) * z;
} else {
tmp = (j * t) * c;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (t <= (-1.8d-39)) then
tmp = (c * t) * j
else if (t <= (-8d-178)) then
tmp = (z * x) * y
else if (t <= 2.4d-274) then
tmp = (i * b) * a
else if (t <= 0.021d0) then
tmp = (y * x) * z
else
tmp = (j * t) * c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.8e-39) {
tmp = (c * t) * j;
} else if (t <= -8e-178) {
tmp = (z * x) * y;
} else if (t <= 2.4e-274) {
tmp = (i * b) * a;
} else if (t <= 0.021) {
tmp = (y * x) * z;
} else {
tmp = (j * t) * c;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -1.8e-39: tmp = (c * t) * j elif t <= -8e-178: tmp = (z * x) * y elif t <= 2.4e-274: tmp = (i * b) * a elif t <= 0.021: tmp = (y * x) * z else: tmp = (j * t) * c return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -1.8e-39) tmp = Float64(Float64(c * t) * j); elseif (t <= -8e-178) tmp = Float64(Float64(z * x) * y); elseif (t <= 2.4e-274) tmp = Float64(Float64(i * b) * a); elseif (t <= 0.021) tmp = Float64(Float64(y * x) * z); else tmp = Float64(Float64(j * t) * c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -1.8e-39) tmp = (c * t) * j; elseif (t <= -8e-178) tmp = (z * x) * y; elseif (t <= 2.4e-274) tmp = (i * b) * a; elseif (t <= 0.021) tmp = (y * x) * z; else tmp = (j * t) * c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.8e-39], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[t, -8e-178], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 2.4e-274], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 0.021], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-178}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-274}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{elif}\;t \leq 0.021:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\end{array}
\end{array}
if t < -1.8e-39Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
Taylor expanded in y around 0
lift-*.f6423.8
Applied rewrites23.8%
if -1.8e-39 < t < -7.9999999999999996e-178Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6421.8
Applied rewrites21.8%
if -7.9999999999999996e-178 < t < 2.4e-274Initial program 74.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.2
Applied rewrites39.2%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.3
Applied rewrites22.3%
if 2.4e-274 < t < 0.0210000000000000013Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
if 0.0210000000000000013 < t Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6423.7
Applied rewrites23.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* j t) c)))
(if (<= t -1.8e-39)
t_1
(if (<= t -8e-178)
(* (* z x) y)
(if (<= t 2.4e-274)
(* (* i b) a)
(if (<= t 0.021) (* (* y x) 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 = (j * t) * c;
double tmp;
if (t <= -1.8e-39) {
tmp = t_1;
} else if (t <= -8e-178) {
tmp = (z * x) * y;
} else if (t <= 2.4e-274) {
tmp = (i * b) * a;
} else if (t <= 0.021) {
tmp = (y * x) * 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 = (j * t) * c
if (t <= (-1.8d-39)) then
tmp = t_1
else if (t <= (-8d-178)) then
tmp = (z * x) * y
else if (t <= 2.4d-274) then
tmp = (i * b) * a
else if (t <= 0.021d0) then
tmp = (y * x) * 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 = (j * t) * c;
double tmp;
if (t <= -1.8e-39) {
tmp = t_1;
} else if (t <= -8e-178) {
tmp = (z * x) * y;
} else if (t <= 2.4e-274) {
tmp = (i * b) * a;
} else if (t <= 0.021) {
tmp = (y * x) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * t) * c tmp = 0 if t <= -1.8e-39: tmp = t_1 elif t <= -8e-178: tmp = (z * x) * y elif t <= 2.4e-274: tmp = (i * b) * a elif t <= 0.021: tmp = (y * x) * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * t) * c) tmp = 0.0 if (t <= -1.8e-39) tmp = t_1; elseif (t <= -8e-178) tmp = Float64(Float64(z * x) * y); elseif (t <= 2.4e-274) tmp = Float64(Float64(i * b) * a); elseif (t <= 0.021) tmp = Float64(Float64(y * x) * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (j * t) * c; tmp = 0.0; if (t <= -1.8e-39) tmp = t_1; elseif (t <= -8e-178) tmp = (z * x) * y; elseif (t <= 2.4e-274) tmp = (i * b) * a; elseif (t <= 0.021) tmp = (y * x) * 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[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t, -1.8e-39], t$95$1, If[LessEqual[t, -8e-178], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 2.4e-274], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 0.021], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot t\right) \cdot c\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-178}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-274}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{elif}\;t \leq 0.021:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.8e-39 or 0.0210000000000000013 < t Initial program 74.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6440.5
Applied rewrites40.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6423.7
Applied rewrites23.7%
if -1.8e-39 < t < -7.9999999999999996e-178Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6421.8
Applied rewrites21.8%
if -7.9999999999999996e-178 < t < 2.4e-274Initial program 74.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.2
Applied rewrites39.2%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.3
Applied rewrites22.3%
if 2.4e-274 < t < 0.0210000000000000013Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= z -4e+20) (* (* z x) y) (if (<= z 1.02e+156) (* (* i b) a) (* (* y x) 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 <= -4e+20) {
tmp = (z * x) * y;
} else if (z <= 1.02e+156) {
tmp = (i * b) * a;
} else {
tmp = (y * x) * z;
}
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 (z <= (-4d+20)) then
tmp = (z * x) * y
else if (z <= 1.02d+156) then
tmp = (i * b) * a
else
tmp = (y * x) * z
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 (z <= -4e+20) {
tmp = (z * x) * y;
} else if (z <= 1.02e+156) {
tmp = (i * b) * a;
} else {
tmp = (y * x) * z;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -4e+20: tmp = (z * x) * y elif z <= 1.02e+156: tmp = (i * b) * a else: tmp = (y * x) * z return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -4e+20) tmp = Float64(Float64(z * x) * y); elseif (z <= 1.02e+156) tmp = Float64(Float64(i * b) * a); else tmp = Float64(Float64(y * x) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -4e+20) tmp = (z * x) * y; elseif (z <= 1.02e+156) tmp = (i * b) * a; else tmp = (y * x) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -4e+20], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 1.02e+156], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+20}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+156}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\end{array}
\end{array}
if z < -4e20Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6421.8
Applied rewrites21.8%
if -4e20 < z < 1.02e156Initial program 74.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.2
Applied rewrites39.2%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.3
Applied rewrites22.3%
if 1.02e156 < z Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
(FPCore (x y z t a b c i j) :precision binary64 (* (* y x) z))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (y * x) * z;
}
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 = (y * x) * z
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 (y * x) * z;
}
def code(x, y, z, t, a, b, c, i, j): return (y * x) * z
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(y * x) * z) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (y * x) * z; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]
\begin{array}{l}
\\
\left(y \cdot x\right) \cdot z
\end{array}
Initial program 74.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
herbie shell --seed 2025131
(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)))))