
(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}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 INFINITY) t_1 (* (* a z) (/ (fma (- t) x (* i b)) z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (a * z) * (fma(-t, x, (i * b)) / z);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(a * z) * Float64(fma(Float64(-t), x, Float64(i * b)) / z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(a * z), $MachinePrecision] * N[(N[((-t) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot z\right) \cdot \frac{\mathsf{fma}\left(-t, x, i \cdot b\right)}{z}\\
\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 93.0%
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 0.0%
Taylor expanded in z around inf
Applied rewrites57.4%
Taylor expanded in a around inf
Applied rewrites68.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c t) (* i y)))) (t_2 (fma (- t) x (* i b))))
(if (<= a -9.5e+78)
(* t_2 a)
(if (<= a -8.7e-100)
(+ (* (- t) (* a x)) t_1)
(if (<= a 37000000.0) (+ (* (* z x) y) t_1) (* (* a z) (/ t_2 z)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * t) - (i * y));
double t_2 = fma(-t, x, (i * b));
double tmp;
if (a <= -9.5e+78) {
tmp = t_2 * a;
} else if (a <= -8.7e-100) {
tmp = (-t * (a * x)) + t_1;
} else if (a <= 37000000.0) {
tmp = ((z * x) * y) + t_1;
} else {
tmp = (a * z) * (t_2 / z);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(c * t) - Float64(i * y))) t_2 = fma(Float64(-t), x, Float64(i * b)) tmp = 0.0 if (a <= -9.5e+78) tmp = Float64(t_2 * a); elseif (a <= -8.7e-100) tmp = Float64(Float64(Float64(-t) * Float64(a * x)) + t_1); elseif (a <= 37000000.0) tmp = Float64(Float64(Float64(z * x) * y) + t_1); else tmp = Float64(Float64(a * z) * Float64(t_2 / z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-t) * x + N[(i * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9.5e+78], N[(t$95$2 * a), $MachinePrecision], If[LessEqual[a, -8.7e-100], N[(N[((-t) * N[(a * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[a, 37000000.0], N[(N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(a * z), $MachinePrecision] * N[(t$95$2 / z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t - i \cdot y\right)\\
t_2 := \mathsf{fma}\left(-t, x, i \cdot b\right)\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{+78}:\\
\;\;\;\;t\_2 \cdot a\\
\mathbf{elif}\;a \leq -8.7 \cdot 10^{-100}:\\
\;\;\;\;\left(-t\right) \cdot \left(a \cdot x\right) + t\_1\\
\mathbf{elif}\;a \leq 37000000:\\
\;\;\;\;\left(z \cdot x\right) \cdot y + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot z\right) \cdot \frac{t\_2}{z}\\
\end{array}
\end{array}
if a < -9.5000000000000006e78Initial program 71.9%
Taylor expanded in a around inf
Applied rewrites72.3%
if -9.5000000000000006e78 < a < -8.69999999999999977e-100Initial program 83.0%
Taylor expanded in t around inf
Applied rewrites74.1%
if -8.69999999999999977e-100 < a < 3.7e7Initial program 83.5%
Taylor expanded in y around inf
Applied rewrites66.6%
if 3.7e7 < a Initial program 62.9%
Taylor expanded in z around inf
Applied rewrites71.3%
Taylor expanded in a around inf
Applied rewrites67.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c t) (* i y)))) (t_2 (* (fma (- t) x (* i b)) a)))
(if (<= a -9.5e+78)
t_2
(if (<= a -8.7e-100)
(+ (* (- t) (* a x)) t_1)
(if (<= a 35000000.0) (+ (* (* z x) y) 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 = j * ((c * t) - (i * y));
double t_2 = fma(-t, x, (i * b)) * a;
double tmp;
if (a <= -9.5e+78) {
tmp = t_2;
} else if (a <= -8.7e-100) {
tmp = (-t * (a * x)) + t_1;
} else if (a <= 35000000.0) {
tmp = ((z * x) * y) + t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(c * t) - Float64(i * y))) t_2 = Float64(fma(Float64(-t), x, Float64(i * b)) * a) tmp = 0.0 if (a <= -9.5e+78) tmp = t_2; elseif (a <= -8.7e-100) tmp = Float64(Float64(Float64(-t) * Float64(a * x)) + t_1); elseif (a <= 35000000.0) tmp = Float64(Float64(Float64(z * x) * y) + t_1); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-t) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -9.5e+78], t$95$2, If[LessEqual[a, -8.7e-100], N[(N[((-t) * N[(a * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[a, 35000000.0], N[(N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t - i \cdot y\right)\\
t_2 := \mathsf{fma}\left(-t, x, i \cdot b\right) \cdot a\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{+78}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -8.7 \cdot 10^{-100}:\\
\;\;\;\;\left(-t\right) \cdot \left(a \cdot x\right) + t\_1\\
\mathbf{elif}\;a \leq 35000000:\\
\;\;\;\;\left(z \cdot x\right) \cdot y + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -9.5000000000000006e78 or 3.5e7 < a Initial program 65.6%
Taylor expanded in a around inf
Applied rewrites67.1%
if -9.5000000000000006e78 < a < -8.69999999999999977e-100Initial program 83.0%
Taylor expanded in t around inf
Applied rewrites74.1%
if -8.69999999999999977e-100 < a < 3.5e7Initial program 83.5%
Taylor expanded in y around inf
Applied rewrites66.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) y (* c t)) j)))
(if (<= j -1.12e-31)
t_1
(if (<= j 2.25e-202)
(* (fma y x (* (- b) c)) z)
(if (<= j 1.35e-89)
(* (* b a) i)
(if (<= j 9.5e-48)
(* (fma (- i) j (* z x)) y)
(if (<= j 1.05e+209) (* (fma (- a) x (* j c)) t) t_1)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, y, (c * t)) * j;
double tmp;
if (j <= -1.12e-31) {
tmp = t_1;
} else if (j <= 2.25e-202) {
tmp = fma(y, x, (-b * c)) * z;
} else if (j <= 1.35e-89) {
tmp = (b * a) * i;
} else if (j <= 9.5e-48) {
tmp = fma(-i, j, (z * x)) * y;
} else if (j <= 1.05e+209) {
tmp = fma(-a, x, (j * c)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), y, Float64(c * t)) * j) tmp = 0.0 if (j <= -1.12e-31) tmp = t_1; elseif (j <= 2.25e-202) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); elseif (j <= 1.35e-89) tmp = Float64(Float64(b * a) * i); elseif (j <= 9.5e-48) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (j <= 1.05e+209) tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -1.12e-31], t$95$1, If[LessEqual[j, 2.25e-202], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[j, 1.35e-89], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[j, 9.5e-48], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[j, 1.05e+209], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\
\mathbf{if}\;j \leq -1.12 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 2.25 \cdot 10^{-202}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{elif}\;j \leq 1.35 \cdot 10^{-89}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;j \leq 9.5 \cdot 10^{-48}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;j \leq 1.05 \cdot 10^{+209}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -1.12e-31 or 1.05e209 < j Initial program 75.6%
Taylor expanded in j around inf
Applied rewrites61.1%
if -1.12e-31 < j < 2.2500000000000002e-202Initial program 75.4%
Taylor expanded in c around inf
Applied rewrites73.3%
Taylor expanded in z around inf
Applied rewrites62.2%
if 2.2500000000000002e-202 < j < 1.34999999999999994e-89Initial program 73.1%
Taylor expanded in i around inf
Applied rewrites55.2%
Taylor expanded in y around 0
Applied rewrites51.4%
if 1.34999999999999994e-89 < j < 9.50000000000000036e-48Initial program 75.0%
Taylor expanded in y around inf
Applied rewrites81.1%
if 9.50000000000000036e-48 < j < 1.05e209Initial program 78.4%
Taylor expanded in t around inf
Applied rewrites57.7%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -2.05e+38)
(* (fma (- z) c (* i a)) b)
(if (<= b 4.3e-44)
(+ (* (* z x) y) (* j (- (* c t) (* i y))))
(* (* (- i) (fma c (/ z i) (- a))) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -2.05e+38) {
tmp = fma(-z, c, (i * a)) * b;
} else if (b <= 4.3e-44) {
tmp = ((z * x) * y) + (j * ((c * t) - (i * y)));
} else {
tmp = (-i * fma(c, (z / i), -a)) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -2.05e+38) tmp = Float64(fma(Float64(-z), c, Float64(i * a)) * b); elseif (b <= 4.3e-44) tmp = Float64(Float64(Float64(z * x) * y) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); else tmp = Float64(Float64(Float64(-i) * fma(c, Float64(z / i), Float64(-a))) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -2.05e+38], N[(N[((-z) * c + N[(i * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 4.3e-44], N[(N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-i) * N[(c * N[(z / i), $MachinePrecision] + (-a)), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.05 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(-z, c, i \cdot a\right) \cdot b\\
\mathbf{elif}\;b \leq 4.3 \cdot 10^{-44}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-i\right) \cdot \mathsf{fma}\left(c, \frac{z}{i}, -a\right)\right) \cdot b\\
\end{array}
\end{array}
if b < -2.0500000000000002e38Initial program 74.8%
Taylor expanded in b around inf
Applied rewrites73.7%
if -2.0500000000000002e38 < b < 4.30000000000000013e-44Initial program 78.6%
Taylor expanded in y around inf
Applied rewrites63.2%
if 4.30000000000000013e-44 < b Initial program 71.3%
Taylor expanded in b around inf
Applied rewrites64.8%
Taylor expanded in i around -inf
Applied rewrites66.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -2.5e+109)
(* (* (- i) j) y)
(if (<= j -3.8e-198)
(* (* (- z) c) b)
(if (<= j 2.3e-73)
(* (* b a) i)
(if (<= j 1.3e-33)
(* (* z y) x)
(if (<= j 1.56e+60) (* (- a) (* t 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 (j <= -2.5e+109) {
tmp = (-i * j) * y;
} else if (j <= -3.8e-198) {
tmp = (-z * c) * b;
} else if (j <= 2.3e-73) {
tmp = (b * a) * i;
} else if (j <= 1.3e-33) {
tmp = (z * y) * x;
} else if (j <= 1.56e+60) {
tmp = -a * (t * x);
} else {
tmp = (j * c) * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (j <= (-2.5d+109)) then
tmp = (-i * j) * y
else if (j <= (-3.8d-198)) then
tmp = (-z * c) * b
else if (j <= 2.3d-73) then
tmp = (b * a) * i
else if (j <= 1.3d-33) then
tmp = (z * y) * x
else if (j <= 1.56d+60) then
tmp = -a * (t * x)
else
tmp = (j * c) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -2.5e+109) {
tmp = (-i * j) * y;
} else if (j <= -3.8e-198) {
tmp = (-z * c) * b;
} else if (j <= 2.3e-73) {
tmp = (b * a) * i;
} else if (j <= 1.3e-33) {
tmp = (z * y) * x;
} else if (j <= 1.56e+60) {
tmp = -a * (t * x);
} else {
tmp = (j * c) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -2.5e+109: tmp = (-i * j) * y elif j <= -3.8e-198: tmp = (-z * c) * b elif j <= 2.3e-73: tmp = (b * a) * i elif j <= 1.3e-33: tmp = (z * y) * x elif j <= 1.56e+60: tmp = -a * (t * x) else: tmp = (j * c) * t return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -2.5e+109) tmp = Float64(Float64(Float64(-i) * j) * y); elseif (j <= -3.8e-198) tmp = Float64(Float64(Float64(-z) * c) * b); elseif (j <= 2.3e-73) tmp = Float64(Float64(b * a) * i); elseif (j <= 1.3e-33) tmp = Float64(Float64(z * y) * x); elseif (j <= 1.56e+60) tmp = Float64(Float64(-a) * Float64(t * x)); else tmp = Float64(Float64(j * c) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -2.5e+109) tmp = (-i * j) * y; elseif (j <= -3.8e-198) tmp = (-z * c) * b; elseif (j <= 2.3e-73) tmp = (b * a) * i; elseif (j <= 1.3e-33) tmp = (z * y) * x; elseif (j <= 1.56e+60) tmp = -a * (t * x); else tmp = (j * c) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -2.5e+109], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[j, -3.8e-198], N[(N[((-z) * c), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[j, 2.3e-73], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[j, 1.3e-33], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[j, 1.56e+60], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], N[(N[(j * c), $MachinePrecision] * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -2.5 \cdot 10^{+109}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{elif}\;j \leq -3.8 \cdot 10^{-198}:\\
\;\;\;\;\left(\left(-z\right) \cdot c\right) \cdot b\\
\mathbf{elif}\;j \leq 2.3 \cdot 10^{-73}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;j \leq 1.3 \cdot 10^{-33}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;j \leq 1.56 \cdot 10^{+60}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot c\right) \cdot t\\
\end{array}
\end{array}
if j < -2.5000000000000001e109Initial program 69.7%
Taylor expanded in i around inf
Applied rewrites49.8%
Taylor expanded in y around inf
Applied rewrites44.3%
if -2.5000000000000001e109 < j < -3.8000000000000002e-198Initial program 77.6%
Taylor expanded in b around inf
Applied rewrites40.9%
Taylor expanded in z around inf
Applied rewrites36.3%
if -3.8000000000000002e-198 < j < 2.29999999999999988e-73Initial program 76.5%
Taylor expanded in i around inf
Applied rewrites47.4%
Taylor expanded in y around 0
Applied rewrites44.6%
if 2.29999999999999988e-73 < j < 1.29999999999999997e-33Initial program 74.9%
Taylor expanded in x around inf
Applied rewrites55.8%
Taylor expanded in y around inf
Applied rewrites56.1%
if 1.29999999999999997e-33 < j < 1.56000000000000009e60Initial program 78.4%
Taylor expanded in x around inf
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites48.6%
if 1.56000000000000009e60 < j Initial program 76.0%
Taylor expanded in t around inf
Applied rewrites55.4%
Taylor expanded in x around 0
Applied rewrites43.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) y (* c t)) j)))
(if (<= j -1.12e-31)
t_1
(if (<= j 2.9e-223)
(* (fma y x (* (- b) c)) z)
(if (<= j 2.3e-73)
(* (fma (- t) x (* i b)) a)
(if (<= j 1.58e+91) (* (fma (- t) a (* z y)) x) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, y, (c * t)) * j;
double tmp;
if (j <= -1.12e-31) {
tmp = t_1;
} else if (j <= 2.9e-223) {
tmp = fma(y, x, (-b * c)) * z;
} else if (j <= 2.3e-73) {
tmp = fma(-t, x, (i * b)) * a;
} else if (j <= 1.58e+91) {
tmp = fma(-t, a, (z * y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), y, Float64(c * t)) * j) tmp = 0.0 if (j <= -1.12e-31) tmp = t_1; elseif (j <= 2.9e-223) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); elseif (j <= 2.3e-73) tmp = Float64(fma(Float64(-t), x, Float64(i * b)) * a); elseif (j <= 1.58e+91) tmp = Float64(fma(Float64(-t), a, Float64(z * y)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -1.12e-31], t$95$1, If[LessEqual[j, 2.9e-223], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[j, 2.3e-73], N[(N[((-t) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[j, 1.58e+91], N[(N[((-t) * a + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\
\mathbf{if}\;j \leq -1.12 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 2.9 \cdot 10^{-223}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{elif}\;j \leq 2.3 \cdot 10^{-73}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, i \cdot b\right) \cdot a\\
\mathbf{elif}\;j \leq 1.58 \cdot 10^{+91}:\\
\;\;\;\;\mathsf{fma}\left(-t, a, z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -1.12e-31 or 1.5799999999999999e91 < j Initial program 75.1%
Taylor expanded in j around inf
Applied rewrites60.6%
if -1.12e-31 < j < 2.9e-223Initial program 74.5%
Taylor expanded in c around inf
Applied rewrites73.5%
Taylor expanded in z around inf
Applied rewrites63.4%
if 2.9e-223 < j < 2.29999999999999988e-73Initial program 78.1%
Taylor expanded in a around inf
Applied rewrites66.5%
if 2.29999999999999988e-73 < j < 1.5799999999999999e91Initial program 79.1%
Taylor expanded in x around inf
Applied rewrites60.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- a) (* t x))))
(if (<= x -6.5e+239)
(* (* z y) x)
(if (<= x -9.5e+73)
t_1
(if (<= x -6.2e-278)
(* (* c t) j)
(if (<= x 3.6e+87) (* (* 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 = -a * (t * x);
double tmp;
if (x <= -6.5e+239) {
tmp = (z * y) * x;
} else if (x <= -9.5e+73) {
tmp = t_1;
} else if (x <= -6.2e-278) {
tmp = (c * t) * j;
} else if (x <= 3.6e+87) {
tmp = (i * a) * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = -a * (t * x)
if (x <= (-6.5d+239)) then
tmp = (z * y) * x
else if (x <= (-9.5d+73)) then
tmp = t_1
else if (x <= (-6.2d-278)) then
tmp = (c * t) * j
else if (x <= 3.6d+87) then
tmp = (i * a) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -a * (t * x);
double tmp;
if (x <= -6.5e+239) {
tmp = (z * y) * x;
} else if (x <= -9.5e+73) {
tmp = t_1;
} else if (x <= -6.2e-278) {
tmp = (c * t) * j;
} else if (x <= 3.6e+87) {
tmp = (i * a) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = -a * (t * x) tmp = 0 if x <= -6.5e+239: tmp = (z * y) * x elif x <= -9.5e+73: tmp = t_1 elif x <= -6.2e-278: tmp = (c * t) * j elif x <= 3.6e+87: tmp = (i * a) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-a) * Float64(t * x)) tmp = 0.0 if (x <= -6.5e+239) tmp = Float64(Float64(z * y) * x); elseif (x <= -9.5e+73) tmp = t_1; elseif (x <= -6.2e-278) tmp = Float64(Float64(c * t) * j); elseif (x <= 3.6e+87) tmp = Float64(Float64(i * a) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = -a * (t * x); tmp = 0.0; if (x <= -6.5e+239) tmp = (z * y) * x; elseif (x <= -9.5e+73) tmp = t_1; elseif (x <= -6.2e-278) tmp = (c * t) * j; elseif (x <= 3.6e+87) tmp = (i * a) * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+239], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, -9.5e+73], t$95$1, If[LessEqual[x, -6.2e-278], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[x, 3.6e+87], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+239}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-278}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+87}:\\
\;\;\;\;\left(i \cdot a\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.5e239Initial program 80.3%
Taylor expanded in x around inf
Applied rewrites85.4%
Taylor expanded in y around inf
Applied rewrites61.5%
if -6.5e239 < x < -9.4999999999999996e73 or 3.59999999999999994e87 < x Initial program 75.6%
Taylor expanded in x around inf
Applied rewrites66.9%
Taylor expanded in y around 0
Applied rewrites48.2%
if -9.4999999999999996e73 < x < -6.19999999999999983e-278Initial program 78.5%
Taylor expanded in t around inf
Applied rewrites34.6%
Taylor expanded in x around 0
Applied rewrites26.8%
Applied rewrites29.9%
if -6.19999999999999983e-278 < x < 3.59999999999999994e87Initial program 73.5%
Taylor expanded in b around inf
Applied rewrites55.7%
Taylor expanded in z around 0
Applied rewrites36.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- t) a (* z y)) x)))
(if (<= x -1.05e+74)
t_1
(if (<= x -2.4e-252)
(* (fma (- z) b (* j t)) c)
(if (<= x 1.55e+25) (* (fma (- z) c (* 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(-t, a, (z * y)) * x;
double tmp;
if (x <= -1.05e+74) {
tmp = t_1;
} else if (x <= -2.4e-252) {
tmp = fma(-z, b, (j * t)) * c;
} else if (x <= 1.55e+25) {
tmp = fma(-z, c, (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(-t), a, Float64(z * y)) * x) tmp = 0.0 if (x <= -1.05e+74) tmp = t_1; elseif (x <= -2.4e-252) tmp = Float64(fma(Float64(-z), b, Float64(j * t)) * c); elseif (x <= 1.55e+25) tmp = Float64(fma(Float64(-z), c, 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[((-t) * a + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.05e+74], t$95$1, If[LessEqual[x, -2.4e-252], N[(N[((-z) * b + N[(j * t), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 1.55e+25], N[(N[((-z) * c + N[(i * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-t, a, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{-252}:\\
\;\;\;\;\mathsf{fma}\left(-z, b, j \cdot t\right) \cdot c\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(-z, c, i \cdot a\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.0499999999999999e74 or 1.5499999999999999e25 < x Initial program 74.8%
Taylor expanded in x around inf
Applied rewrites68.7%
if -1.0499999999999999e74 < x < -2.4000000000000002e-252Initial program 77.6%
Taylor expanded in c around inf
Applied rewrites56.8%
if -2.4000000000000002e-252 < x < 1.5499999999999999e25Initial program 76.3%
Taylor expanded in b around inf
Applied rewrites57.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- t) a (* z y)) x)))
(if (<= x -1.05e+74)
t_1
(if (<= x -3.3e-175)
(* (fma (- z) b (* j t)) c)
(if (<= x 1.9e-6) (* (fma (- y) j (* b a)) i) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-t, a, (z * y)) * x;
double tmp;
if (x <= -1.05e+74) {
tmp = t_1;
} else if (x <= -3.3e-175) {
tmp = fma(-z, b, (j * t)) * c;
} else if (x <= 1.9e-6) {
tmp = fma(-y, j, (b * a)) * i;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-t), a, Float64(z * y)) * x) tmp = 0.0 if (x <= -1.05e+74) tmp = t_1; elseif (x <= -3.3e-175) tmp = Float64(fma(Float64(-z), b, Float64(j * t)) * c); elseif (x <= 1.9e-6) tmp = Float64(fma(Float64(-y), j, Float64(b * a)) * i); 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) * a + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.05e+74], t$95$1, If[LessEqual[x, -3.3e-175], N[(N[((-z) * b + N[(j * t), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 1.9e-6], N[(N[((-y) * j + N[(b * a), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-t, a, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-175}:\\
\;\;\;\;\mathsf{fma}\left(-z, b, j \cdot t\right) \cdot c\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(-y, j, b \cdot a\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.0499999999999999e74 or 1.9e-6 < x Initial program 74.8%
Taylor expanded in x around inf
Applied rewrites67.8%
if -1.0499999999999999e74 < x < -3.29999999999999999e-175Initial program 77.2%
Taylor expanded in c around inf
Applied rewrites58.8%
if -3.29999999999999999e-175 < x < 1.9e-6Initial program 76.8%
Taylor expanded in i around inf
Applied rewrites52.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) y (* c t)) j)))
(if (<= j -1.12e-31)
t_1
(if (<= j 3.9e-197)
(* (fma y x (* (- b) c)) z)
(if (<= j 1.58e+91) (* (fma (- t) a (* z y)) x) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, y, (c * t)) * j;
double tmp;
if (j <= -1.12e-31) {
tmp = t_1;
} else if (j <= 3.9e-197) {
tmp = fma(y, x, (-b * c)) * z;
} else if (j <= 1.58e+91) {
tmp = fma(-t, a, (z * y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), y, Float64(c * t)) * j) tmp = 0.0 if (j <= -1.12e-31) tmp = t_1; elseif (j <= 3.9e-197) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); elseif (j <= 1.58e+91) tmp = Float64(fma(Float64(-t), a, Float64(z * y)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -1.12e-31], t$95$1, If[LessEqual[j, 3.9e-197], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[j, 1.58e+91], N[(N[((-t) * a + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\
\mathbf{if}\;j \leq -1.12 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 3.9 \cdot 10^{-197}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{elif}\;j \leq 1.58 \cdot 10^{+91}:\\
\;\;\;\;\mathsf{fma}\left(-t, a, z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -1.12e-31 or 1.5799999999999999e91 < j Initial program 75.1%
Taylor expanded in j around inf
Applied rewrites60.6%
if -1.12e-31 < j < 3.8999999999999999e-197Initial program 75.1%
Taylor expanded in c around inf
Applied rewrites74.3%
Taylor expanded in z around inf
Applied rewrites61.2%
if 3.8999999999999999e-197 < j < 1.5799999999999999e91Initial program 78.3%
Taylor expanded in x around inf
Applied rewrites55.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= z -7.6e+60) (not (<= z 310000000.0))) (* (fma y x (* (- b) c)) z) (* (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 ((z <= -7.6e+60) || !(z <= 310000000.0)) {
tmp = fma(y, x, (-b * c)) * z;
} 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 ((z <= -7.6e+60) || !(z <= 310000000.0)) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); 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[Or[LessEqual[z, -7.6e+60], N[Not[LessEqual[z, 310000000.0]], $MachinePrecision]], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+60} \lor \neg \left(z \leq 310000000\right):\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\end{array}
\end{array}
if z < -7.60000000000000019e60 or 3.1e8 < z Initial program 66.1%
Taylor expanded in c around inf
Applied rewrites65.7%
Taylor expanded in z around inf
Applied rewrites61.9%
if -7.60000000000000019e60 < z < 3.1e8Initial program 84.5%
Taylor expanded in t around inf
Applied rewrites48.7%
Final simplification54.8%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= i -4.8e+125)
(* (* i a) b)
(if (<= i 1.4e-210)
(* (* z y) x)
(if (<= i 2.25e+52) (* (* j c) t) (* (* (- i) j) y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -4.8e+125) {
tmp = (i * a) * b;
} else if (i <= 1.4e-210) {
tmp = (z * y) * x;
} else if (i <= 2.25e+52) {
tmp = (j * c) * t;
} else {
tmp = (-i * j) * y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (i <= (-4.8d+125)) then
tmp = (i * a) * b
else if (i <= 1.4d-210) then
tmp = (z * y) * x
else if (i <= 2.25d+52) then
tmp = (j * c) * t
else
tmp = (-i * j) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -4.8e+125) {
tmp = (i * a) * b;
} else if (i <= 1.4e-210) {
tmp = (z * y) * x;
} else if (i <= 2.25e+52) {
tmp = (j * c) * t;
} else {
tmp = (-i * j) * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if i <= -4.8e+125: tmp = (i * a) * b elif i <= 1.4e-210: tmp = (z * y) * x elif i <= 2.25e+52: tmp = (j * c) * t else: tmp = (-i * j) * y return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -4.8e+125) tmp = Float64(Float64(i * a) * b); elseif (i <= 1.4e-210) tmp = Float64(Float64(z * y) * x); elseif (i <= 2.25e+52) tmp = Float64(Float64(j * c) * t); else tmp = Float64(Float64(Float64(-i) * j) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (i <= -4.8e+125) tmp = (i * a) * b; elseif (i <= 1.4e-210) tmp = (z * y) * x; elseif (i <= 2.25e+52) tmp = (j * c) * t; else tmp = (-i * j) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -4.8e+125], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[i, 1.4e-210], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[i, 2.25e+52], N[(N[(j * c), $MachinePrecision] * t), $MachinePrecision], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -4.8 \cdot 10^{+125}:\\
\;\;\;\;\left(i \cdot a\right) \cdot b\\
\mathbf{elif}\;i \leq 1.4 \cdot 10^{-210}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;i \leq 2.25 \cdot 10^{+52}:\\
\;\;\;\;\left(j \cdot c\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\end{array}
\end{array}
if i < -4.7999999999999999e125Initial program 56.3%
Taylor expanded in b around inf
Applied rewrites63.8%
Taylor expanded in z around 0
Applied rewrites48.1%
if -4.7999999999999999e125 < i < 1.4e-210Initial program 81.0%
Taylor expanded in x around inf
Applied rewrites54.1%
Taylor expanded in y around inf
Applied rewrites33.5%
if 1.4e-210 < i < 2.25e52Initial program 80.3%
Taylor expanded in t around inf
Applied rewrites52.6%
Taylor expanded in x around 0
Applied rewrites38.1%
if 2.25e52 < i Initial program 77.1%
Taylor expanded in i around inf
Applied rewrites66.1%
Taylor expanded in y around inf
Applied rewrites45.6%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= z -1.05e+61)
(* (fma (- b) c (* y x)) z)
(if (<= z 310000000.0)
(* (fma (- a) x (* j c)) t)
(* (fma y x (* (- b) c)) z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -1.05e+61) {
tmp = fma(-b, c, (y * x)) * z;
} else if (z <= 310000000.0) {
tmp = fma(-a, x, (j * c)) * t;
} else {
tmp = fma(y, x, (-b * c)) * z;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -1.05e+61) tmp = Float64(fma(Float64(-b), c, Float64(y * x)) * z); elseif (z <= 310000000.0) tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); else tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -1.05e+61], N[(N[((-b) * c + N[(y * x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 310000000.0], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z\\
\mathbf{elif}\;z \leq 310000000:\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\end{array}
\end{array}
if z < -1.0500000000000001e61Initial program 59.4%
Taylor expanded in z around inf
Applied rewrites65.1%
if -1.0500000000000001e61 < z < 3.1e8Initial program 84.5%
Taylor expanded in t around inf
Applied rewrites48.7%
if 3.1e8 < z Initial program 70.0%
Taylor expanded in c around inf
Applied rewrites71.6%
Taylor expanded in z around inf
Applied rewrites61.3%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= i -3.5e+215) (* (* b a) i) (if (<= i 3.1e-12) (* (fma y x (* (- b) c)) z) (* (* (- i) j) y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -3.5e+215) {
tmp = (b * a) * i;
} else if (i <= 3.1e-12) {
tmp = fma(y, x, (-b * c)) * z;
} else {
tmp = (-i * j) * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -3.5e+215) tmp = Float64(Float64(b * a) * i); elseif (i <= 3.1e-12) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); else tmp = Float64(Float64(Float64(-i) * j) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -3.5e+215], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[i, 3.1e-12], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -3.5 \cdot 10^{+215}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;i \leq 3.1 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\end{array}
\end{array}
if i < -3.49999999999999977e215Initial program 56.0%
Taylor expanded in i around inf
Applied rewrites76.4%
Taylor expanded in y around 0
Applied rewrites53.3%
if -3.49999999999999977e215 < i < 3.1000000000000001e-12Initial program 78.1%
Taylor expanded in c around inf
Applied rewrites76.6%
Taylor expanded in z around inf
Applied rewrites51.1%
if 3.1000000000000001e-12 < i Initial program 78.1%
Taylor expanded in i around inf
Applied rewrites61.4%
Taylor expanded in y around inf
Applied rewrites39.9%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -4.5e+38)
(* (* b a) i)
(if (<= b -3.8e-146)
(* (* c t) j)
(if (<= b 1.6e+177) (* (* z y) x) (* (* i b) a)))))
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+38) {
tmp = (b * a) * i;
} else if (b <= -3.8e-146) {
tmp = (c * t) * j;
} else if (b <= 1.6e+177) {
tmp = (z * y) * x;
} else {
tmp = (i * b) * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (b <= (-4.5d+38)) then
tmp = (b * a) * i
else if (b <= (-3.8d-146)) then
tmp = (c * t) * j
else if (b <= 1.6d+177) then
tmp = (z * y) * x
else
tmp = (i * b) * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -4.5e+38) {
tmp = (b * a) * i;
} else if (b <= -3.8e-146) {
tmp = (c * t) * j;
} else if (b <= 1.6e+177) {
tmp = (z * y) * x;
} else {
tmp = (i * b) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -4.5e+38: tmp = (b * a) * i elif b <= -3.8e-146: tmp = (c * t) * j elif b <= 1.6e+177: tmp = (z * y) * x else: tmp = (i * b) * a return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -4.5e+38) tmp = Float64(Float64(b * a) * i); elseif (b <= -3.8e-146) tmp = Float64(Float64(c * t) * j); elseif (b <= 1.6e+177) tmp = Float64(Float64(z * y) * x); else tmp = Float64(Float64(i * b) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -4.5e+38) tmp = (b * a) * i; elseif (b <= -3.8e-146) tmp = (c * t) * j; elseif (b <= 1.6e+177) tmp = (z * y) * x; else tmp = (i * b) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -4.5e+38], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[b, -3.8e-146], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[b, 1.6e+177], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+38}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;b \leq -3.8 \cdot 10^{-146}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{+177}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\end{array}
\end{array}
if b < -4.4999999999999998e38Initial program 74.8%
Taylor expanded in i around inf
Applied rewrites49.9%
Taylor expanded in y around 0
Applied rewrites46.1%
if -4.4999999999999998e38 < b < -3.79999999999999994e-146Initial program 86.8%
Taylor expanded in t around inf
Applied rewrites55.7%
Taylor expanded in x around 0
Applied rewrites36.3%
Applied rewrites38.4%
if -3.79999999999999994e-146 < b < 1.6e177Initial program 73.4%
Taylor expanded in x around inf
Applied rewrites49.4%
Taylor expanded in y around inf
Applied rewrites30.7%
if 1.6e177 < b Initial program 72.3%
Taylor expanded in b around inf
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites60.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* i b) a)))
(if (<= i -4.8e+125)
t_1
(if (<= i 1.4e-210)
(* (* z y) x)
(if (<= i 2.45e+138) (* (* j c) t) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * b) * a;
double tmp;
if (i <= -4.8e+125) {
tmp = t_1;
} else if (i <= 1.4e-210) {
tmp = (z * y) * x;
} else if (i <= 2.45e+138) {
tmp = (j * c) * t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (i * b) * a
if (i <= (-4.8d+125)) then
tmp = t_1
else if (i <= 1.4d-210) then
tmp = (z * y) * x
else if (i <= 2.45d+138) then
tmp = (j * c) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * b) * a;
double tmp;
if (i <= -4.8e+125) {
tmp = t_1;
} else if (i <= 1.4e-210) {
tmp = (z * y) * x;
} else if (i <= 2.45e+138) {
tmp = (j * c) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (i * b) * a tmp = 0 if i <= -4.8e+125: tmp = t_1 elif i <= 1.4e-210: tmp = (z * y) * x elif i <= 2.45e+138: tmp = (j * c) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * b) * a) tmp = 0.0 if (i <= -4.8e+125) tmp = t_1; elseif (i <= 1.4e-210) tmp = Float64(Float64(z * y) * x); elseif (i <= 2.45e+138) tmp = Float64(Float64(j * c) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (i * b) * a; tmp = 0.0; if (i <= -4.8e+125) tmp = t_1; elseif (i <= 1.4e-210) tmp = (z * y) * x; elseif (i <= 2.45e+138) tmp = (j * c) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[i, -4.8e+125], t$95$1, If[LessEqual[i, 1.4e-210], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[i, 2.45e+138], N[(N[(j * c), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot b\right) \cdot a\\
\mathbf{if}\;i \leq -4.8 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.4 \cdot 10^{-210}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;i \leq 2.45 \cdot 10^{+138}:\\
\;\;\;\;\left(j \cdot c\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -4.7999999999999999e125 or 2.44999999999999992e138 < i Initial program 62.7%
Taylor expanded in b around inf
Applied rewrites59.4%
Taylor expanded in z around 0
Applied rewrites46.6%
if -4.7999999999999999e125 < i < 1.4e-210Initial program 81.0%
Taylor expanded in x around inf
Applied rewrites54.1%
Taylor expanded in y around inf
Applied rewrites33.5%
if 1.4e-210 < i < 2.44999999999999992e138Initial program 83.0%
Taylor expanded in t around inf
Applied rewrites49.0%
Taylor expanded in x around 0
Applied rewrites33.8%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= a -3.55e+78) (not (<= a 900000000.0))) (* (* i b) a) (* (* 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 ((a <= -3.55e+78) || !(a <= 900000000.0)) {
tmp = (i * b) * a;
} else {
tmp = (j * c) * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if ((a <= (-3.55d+78)) .or. (.not. (a <= 900000000.0d0))) then
tmp = (i * b) * a
else
tmp = (j * c) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((a <= -3.55e+78) || !(a <= 900000000.0)) {
tmp = (i * b) * a;
} else {
tmp = (j * c) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (a <= -3.55e+78) or not (a <= 900000000.0): tmp = (i * b) * a else: tmp = (j * c) * t return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((a <= -3.55e+78) || !(a <= 900000000.0)) tmp = Float64(Float64(i * b) * a); else tmp = Float64(Float64(j * c) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((a <= -3.55e+78) || ~((a <= 900000000.0))) tmp = (i * b) * a; else tmp = (j * c) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[a, -3.55e+78], N[Not[LessEqual[a, 900000000.0]], $MachinePrecision]], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], N[(N[(j * c), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.55 \cdot 10^{+78} \lor \neg \left(a \leq 900000000\right):\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot c\right) \cdot t\\
\end{array}
\end{array}
if a < -3.54999999999999996e78 or 9e8 < a Initial program 65.9%
Taylor expanded in b around inf
Applied rewrites54.1%
Taylor expanded in z around 0
Applied rewrites41.5%
if -3.54999999999999996e78 < a < 9e8Initial program 83.3%
Taylor expanded in t around inf
Applied rewrites39.7%
Taylor expanded in x around 0
Applied rewrites28.2%
Final simplification33.8%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= i -255000000.0) (not (<= i 1.5e-51))) (* (* i b) a) (* (* c t) j)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((i <= -255000000.0) || !(i <= 1.5e-51)) {
tmp = (i * b) * a;
} else {
tmp = (c * t) * j;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if ((i <= (-255000000.0d0)) .or. (.not. (i <= 1.5d-51))) then
tmp = (i * b) * a
else
tmp = (c * t) * j
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((i <= -255000000.0) || !(i <= 1.5e-51)) {
tmp = (i * b) * a;
} else {
tmp = (c * t) * j;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (i <= -255000000.0) or not (i <= 1.5e-51): tmp = (i * b) * a else: tmp = (c * t) * j return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((i <= -255000000.0) || !(i <= 1.5e-51)) tmp = Float64(Float64(i * b) * a); else tmp = Float64(Float64(c * t) * j); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((i <= -255000000.0) || ~((i <= 1.5e-51))) tmp = (i * b) * a; else tmp = (c * t) * j; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[i, -255000000.0], N[Not[LessEqual[i, 1.5e-51]], $MachinePrecision]], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -255000000 \lor \neg \left(i \leq 1.5 \cdot 10^{-51}\right):\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\end{array}
\end{array}
if i < -2.55e8 or 1.50000000000000001e-51 < i Initial program 72.4%
Taylor expanded in b around inf
Applied rewrites46.3%
Taylor expanded in z around 0
Applied rewrites36.0%
if -2.55e8 < i < 1.50000000000000001e-51Initial program 80.0%
Taylor expanded in t around inf
Applied rewrites49.0%
Taylor expanded in x around 0
Applied rewrites30.0%
Applied rewrites30.9%
Final simplification33.6%
(FPCore (x y z t a b c i j) :precision binary64 (* (* c t) j))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (c * t) * j;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = (c * t) * j
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (c * t) * j;
}
def code(x, y, z, t, a, b, c, i, j): return (c * t) * j
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(c * t) * j) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (c * t) * j; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision]
\begin{array}{l}
\\
\left(c \cdot t\right) \cdot j
\end{array}
Initial program 75.9%
Taylor expanded in t around inf
Applied rewrites38.8%
Taylor expanded in x around 0
Applied rewrites19.9%
Applied rewrites21.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(/
(* j (- (pow (* c t) 2.0) (pow (* i y) 2.0)))
(+ (* c t) (* i y)))))
(t_2
(-
(* x (- (* z y) (* a t)))
(- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j)))))
(if (< t -8.120978919195912e-33)
t_2
(if (< t -4.712553818218485e-169)
t_1
(if (< t -7.633533346031584e-308)
t_2
(if (< t 1.0535888557455487e-139) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (pow((c * t), 2.0) - pow((i * y), 2.0))) / ((c * t) + (i * y)));
double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
double tmp;
if (t < -8.120978919195912e-33) {
tmp = t_2;
} else if (t < -4.712553818218485e-169) {
tmp = t_1;
} else if (t < -7.633533346031584e-308) {
tmp = t_2;
} else if (t < 1.0535888557455487e-139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ** 2.0d0) - ((i * y) ** 2.0d0))) / ((c * t) + (i * y)))
t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j))
if (t < (-8.120978919195912d-33)) then
tmp = t_2
else if (t < (-4.712553818218485d-169)) then
tmp = t_1
else if (t < (-7.633533346031584d-308)) then
tmp = t_2
else if (t < 1.0535888557455487d-139) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (Math.pow((c * t), 2.0) - Math.pow((i * y), 2.0))) / ((c * t) + (i * y)));
double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
double tmp;
if (t < -8.120978919195912e-33) {
tmp = t_2;
} else if (t < -4.712553818218485e-169) {
tmp = t_1;
} else if (t < -7.633533346031584e-308) {
tmp = t_2;
} else if (t < 1.0535888557455487e-139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (math.pow((c * t), 2.0) - math.pow((i * y), 2.0))) / ((c * t) + (i * y))) t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j)) tmp = 0 if t < -8.120978919195912e-33: tmp = t_2 elif t < -4.712553818218485e-169: tmp = t_1 elif t < -7.633533346031584e-308: tmp = t_2 elif t < 1.0535888557455487e-139: 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(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(Float64(j * Float64((Float64(c * t) ^ 2.0) - (Float64(i * y) ^ 2.0))) / Float64(Float64(c * t) + Float64(i * y)))) t_2 = Float64(Float64(x * Float64(Float64(z * y) - Float64(a * t))) - Float64(Float64(b * Float64(Float64(z * c) - Float64(a * i))) - Float64(Float64(Float64(c * t) - Float64(y * i)) * j))) tmp = 0.0 if (t < -8.120978919195912e-33) tmp = t_2; elseif (t < -4.712553818218485e-169) tmp = t_1; elseif (t < -7.633533346031584e-308) tmp = t_2; elseif (t < 1.0535888557455487e-139) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ^ 2.0) - ((i * y) ^ 2.0))) / ((c * t) + (i * y))); t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j)); tmp = 0.0; if (t < -8.120978919195912e-33) tmp = t_2; elseif (t < -4.712553818218485e-169) tmp = t_1; elseif (t < -7.633533346031584e-308) tmp = t_2; elseif (t < 1.0535888557455487e-139) 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[(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[(N[(j * N[(N[Power[N[(c * t), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(i * y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * t), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[(z * c), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * t), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -8.120978919195912e-33], t$95$2, If[Less[t, -4.712553818218485e-169], t$95$1, If[Less[t, -7.633533346031584e-308], t$95$2, If[Less[t, 1.0535888557455487e-139], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\
t_2 := x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\
\mathbf{if}\;t < -8.120978919195912 \cdot 10^{-33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < -4.712553818218485 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < -7.633533346031584 \cdot 10^{-308}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < 1.0535888557455487 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2025019
(FPCore (x y z t a b c i j)
:name "Linear.Matrix:det33 from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (if (< t -1015122364899489/125000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -942510763643697/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (if (< t -238547917063487/3125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t 10535888557455487/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))