
(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 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
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 INFINITY) t_1 (* (- x) (* (fma a (/ t z) (- y)) 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 = -x * (fma(a, (t / z), -y) * 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(-x) * Float64(fma(a, Float64(t / z), Float64(-y)) * 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[((-x) * N[(N[(a * N[(t / z), $MachinePrecision] + (-y)), $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(-x\right) \cdot \left(\mathsf{fma}\left(a, \frac{t}{z}, -y\right) \cdot z\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 94.6%
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 t around 0
lower--.f64N/A
Applied rewrites23.9%
Taylor expanded in x 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
lower-*.f6455.1
Applied rewrites55.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-neg.f6459.2
Applied rewrites59.2%
Final simplification88.2%
(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))))))
(if (<= (+ t_1 (* j (- (* c t) (* i y)))) INFINITY)
(+ t_1 (* j (* c t)))
(* (- x) (* (fma a (/ t z) (- y)) 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)));
double tmp;
if ((t_1 + (j * ((c * t) - (i * y)))) <= ((double) INFINITY)) {
tmp = t_1 + (j * (c * t));
} else {
tmp = -x * (fma(a, (t / z), -y) * z);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) tmp = 0.0 if (Float64(t_1 + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) <= Inf) tmp = Float64(t_1 + Float64(j * Float64(c * t))); else tmp = Float64(Float64(-x) * Float64(fma(a, Float64(t / z), Float64(-y)) * z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = 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]}, If[LessEqual[N[(t$95$1 + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 + N[(j * N[(c * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x) * N[(N[(a * N[(t / z), $MachinePrecision] + (-y)), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\\
\mathbf{if}\;t\_1 + j \cdot \left(c \cdot t - i \cdot y\right) \leq \infty:\\
\;\;\;\;t\_1 + j \cdot \left(c \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-x\right) \cdot \left(\mathsf{fma}\left(a, \frac{t}{z}, -y\right) \cdot z\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 94.6%
Taylor expanded in y around 0
lift-*.f6484.5
Applied rewrites84.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 0.0%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites23.9%
Taylor expanded in x 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
lower-*.f6455.1
Applied rewrites55.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-neg.f6459.2
Applied rewrites59.2%
Final simplification79.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (* (- i) j) y (fma (fma (- a) x (* j c)) t (* (* z y) x))))
(t_2 (fma (- a) i (* c z))))
(if (<= j -3.2e+31)
(- (fma (- a) (* t x) (* (* j t) c)) (* t_2 b))
(if (<= j -5.4e-46)
t_1
(if (<= j 4800.0)
(fma (fma (- a) t (* z y)) x (* (- b) t_2))
(if (<= j 1.85e+182) t_1 (* (fma (- i) y (* c t)) j)))))))
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 * j), y, fma(fma(-a, x, (j * c)), t, ((z * y) * x)));
double t_2 = fma(-a, i, (c * z));
double tmp;
if (j <= -3.2e+31) {
tmp = fma(-a, (t * x), ((j * t) * c)) - (t_2 * b);
} else if (j <= -5.4e-46) {
tmp = t_1;
} else if (j <= 4800.0) {
tmp = fma(fma(-a, t, (z * y)), x, (-b * t_2));
} else if (j <= 1.85e+182) {
tmp = t_1;
} else {
tmp = fma(-i, y, (c * t)) * j;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(Float64(-i) * j), y, fma(fma(Float64(-a), x, Float64(j * c)), t, Float64(Float64(z * y) * x))) t_2 = fma(Float64(-a), i, Float64(c * z)) tmp = 0.0 if (j <= -3.2e+31) tmp = Float64(fma(Float64(-a), Float64(t * x), Float64(Float64(j * t) * c)) - Float64(t_2 * b)); elseif (j <= -5.4e-46) tmp = t_1; elseif (j <= 4800.0) tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(-b) * t_2)); elseif (j <= 1.85e+182) tmp = t_1; else tmp = Float64(fma(Float64(-i), y, Float64(c * t)) * j); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * j), $MachinePrecision] * y + N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t + N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-a) * i + N[(c * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -3.2e+31], N[(N[((-a) * N[(t * x), $MachinePrecision] + N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision] - N[(t$95$2 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -5.4e-46], t$95$1, If[LessEqual[j, 4800.0], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.85e+182], t$95$1, N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(-i\right) \cdot j, y, \mathsf{fma}\left(\mathsf{fma}\left(-a, x, j \cdot c\right), t, \left(z \cdot y\right) \cdot x\right)\right)\\
t_2 := \mathsf{fma}\left(-a, i, c \cdot z\right)\\
\mathbf{if}\;j \leq -3.2 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{fma}\left(-a, t \cdot x, \left(j \cdot t\right) \cdot c\right) - t\_2 \cdot b\\
\mathbf{elif}\;j \leq -5.4 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 4800:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot t\_2\right)\\
\mathbf{elif}\;j \leq 1.85 \cdot 10^{+182}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\
\end{array}
\end{array}
if j < -3.2000000000000001e31Initial program 72.1%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.6%
if -3.2000000000000001e31 < j < -5.4e-46 or 4800 < j < 1.84999999999999988e182Initial program 76.5%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites74.9%
Taylor expanded in b around 0
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
associate-*r*N/A
Applied rewrites86.8%
if -5.4e-46 < j < 4800Initial program 78.4%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.1%
if 1.84999999999999988e182 < j Initial program 86.9%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f6490.0
Applied rewrites90.0%
Final simplification79.6%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= x -4e-11)
(* (- x) (* (fma a (/ t z) (- y)) z))
(if (<= x -1.15e-274)
(* (fma j t (* (- b) z)) c)
(if (<= x 1.9e-237)
(* (- i) (fma j y (* (- a) b)))
(if (<= x 1.85e-83)
(* (fma i a (* (- c) z)) b)
(if (<= x 5600000000.0)
(* (fma (- i) j (* z x)) y)
(* (- x) (* (fma a (/ t y) (- z)) y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -4e-11) {
tmp = -x * (fma(a, (t / z), -y) * z);
} else if (x <= -1.15e-274) {
tmp = fma(j, t, (-b * z)) * c;
} else if (x <= 1.9e-237) {
tmp = -i * fma(j, y, (-a * b));
} else if (x <= 1.85e-83) {
tmp = fma(i, a, (-c * z)) * b;
} else if (x <= 5600000000.0) {
tmp = fma(-i, j, (z * x)) * y;
} else {
tmp = -x * (fma(a, (t / y), -z) * y);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -4e-11) tmp = Float64(Float64(-x) * Float64(fma(a, Float64(t / z), Float64(-y)) * z)); elseif (x <= -1.15e-274) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (x <= 1.9e-237) tmp = Float64(Float64(-i) * fma(j, y, Float64(Float64(-a) * b))); elseif (x <= 1.85e-83) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); elseif (x <= 5600000000.0) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); else tmp = Float64(Float64(-x) * Float64(fma(a, Float64(t / y), Float64(-z)) * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -4e-11], N[((-x) * N[(N[(a * N[(t / z), $MachinePrecision] + (-y)), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.15e-274], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 1.9e-237], N[((-i) * N[(j * y + N[((-a) * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e-83], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 5600000000.0], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[((-x) * N[(N[(a * N[(t / y), $MachinePrecision] + (-z)), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-11}:\\
\;\;\;\;\left(-x\right) \cdot \left(\mathsf{fma}\left(a, \frac{t}{z}, -y\right) \cdot z\right)\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-274}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-237}:\\
\;\;\;\;\left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-a\right) \cdot b\right)\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-83}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;x \leq 5600000000:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(-x\right) \cdot \left(\mathsf{fma}\left(a, \frac{t}{y}, -z\right) \cdot y\right)\\
\end{array}
\end{array}
if x < -3.99999999999999976e-11Initial program 76.4%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites79.5%
Taylor expanded in x 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
lower-*.f6462.1
Applied rewrites62.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-neg.f6465.1
Applied rewrites65.1%
if -3.99999999999999976e-11 < x < -1.14999999999999998e-274Initial program 88.0%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6460.1
Applied rewrites60.1%
if -1.14999999999999998e-274 < x < 1.90000000000000012e-237Initial program 70.7%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6471.0
Applied rewrites71.0%
if 1.90000000000000012e-237 < x < 1.84999999999999997e-83Initial program 70.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6474.4
Applied rewrites74.4%
if 1.84999999999999997e-83 < x < 5.6e9Initial program 78.8%
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-*.f6466.2
Applied rewrites66.2%
if 5.6e9 < x Initial program 74.3%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites67.1%
Taylor expanded in x 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
lower-*.f6469.6
Applied rewrites69.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6472.4
Applied rewrites72.4%
Final simplification67.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- x) (* (fma a (/ t y) (- z)) y))))
(if (<= x -2.06e-53)
t_1
(if (<= x -1.15e-274)
(* (fma j t (* (- b) z)) c)
(if (<= x 1.9e-237)
(* (- i) (fma j y (* (- a) b)))
(if (<= x 1.85e-83)
(* (fma i a (* (- c) z)) b)
(if (<= x 5600000000.0) (* (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 = -x * (fma(a, (t / y), -z) * y);
double tmp;
if (x <= -2.06e-53) {
tmp = t_1;
} else if (x <= -1.15e-274) {
tmp = fma(j, t, (-b * z)) * c;
} else if (x <= 1.9e-237) {
tmp = -i * fma(j, y, (-a * b));
} else if (x <= 1.85e-83) {
tmp = fma(i, a, (-c * z)) * b;
} else if (x <= 5600000000.0) {
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(Float64(-x) * Float64(fma(a, Float64(t / y), Float64(-z)) * y)) tmp = 0.0 if (x <= -2.06e-53) tmp = t_1; elseif (x <= -1.15e-274) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (x <= 1.9e-237) tmp = Float64(Float64(-i) * fma(j, y, Float64(Float64(-a) * b))); elseif (x <= 1.85e-83) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); elseif (x <= 5600000000.0) 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[((-x) * N[(N[(a * N[(t / y), $MachinePrecision] + (-z)), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.06e-53], t$95$1, If[LessEqual[x, -1.15e-274], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 1.9e-237], N[((-i) * N[(j * y + N[((-a) * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e-83], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 5600000000.0], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-x\right) \cdot \left(\mathsf{fma}\left(a, \frac{t}{y}, -z\right) \cdot y\right)\\
\mathbf{if}\;x \leq -2.06 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-274}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-237}:\\
\;\;\;\;\left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-a\right) \cdot b\right)\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-83}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;x \leq 5600000000:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.06000000000000003e-53 or 5.6e9 < x Initial program 76.6%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites74.5%
Taylor expanded in x 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
lower-*.f6464.0
Applied rewrites64.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6467.5
Applied rewrites67.5%
if -2.06000000000000003e-53 < x < -1.14999999999999998e-274Initial program 86.5%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6462.3
Applied rewrites62.3%
if -1.14999999999999998e-274 < x < 1.90000000000000012e-237Initial program 70.7%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6471.0
Applied rewrites71.0%
if 1.90000000000000012e-237 < x < 1.84999999999999997e-83Initial program 70.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6474.4
Applied rewrites74.4%
if 1.84999999999999997e-83 < x < 5.6e9Initial program 78.8%
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-*.f6466.2
Applied rewrites66.2%
Final simplification67.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= t -2.4e+53) (not (<= t 1.65e+176))) (fma (* (- i) j) y (fma (fma (- a) x (* j c)) t (* (* z y) x))) (fma (fma (- a) t (* z y)) x (* (- b) (fma (- a) i (* 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 ((t <= -2.4e+53) || !(t <= 1.65e+176)) {
tmp = fma((-i * j), y, fma(fma(-a, x, (j * c)), t, ((z * y) * x)));
} else {
tmp = fma(fma(-a, t, (z * y)), x, (-b * fma(-a, i, (c * z))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((t <= -2.4e+53) || !(t <= 1.65e+176)) tmp = fma(Float64(Float64(-i) * j), y, fma(fma(Float64(-a), x, Float64(j * c)), t, Float64(Float64(z * y) * x))); else tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(-b) * fma(Float64(-a), i, Float64(c * z)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[t, -2.4e+53], N[Not[LessEqual[t, 1.65e+176]], $MachinePrecision]], N[(N[((-i) * j), $MachinePrecision] * y + N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t + N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * N[((-a) * i + N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+53} \lor \neg \left(t \leq 1.65 \cdot 10^{+176}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(-i\right) \cdot j, y, \mathsf{fma}\left(\mathsf{fma}\left(-a, x, j \cdot c\right), t, \left(z \cdot y\right) \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-a, i, c \cdot z\right)\right)\\
\end{array}
\end{array}
if t < -2.4e53 or 1.65000000000000012e176 < t Initial program 64.7%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites74.4%
Taylor expanded in b around 0
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
associate-*r*N/A
Applied rewrites82.5%
if -2.4e53 < t < 1.65000000000000012e176Initial program 84.5%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.0%
Final simplification76.3%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -2.1e+101)
(+ (* (* z y) x) (* j (- (* c t) (* i y))))
(if (<= j 4e+89)
(fma (fma (- a) t (* z y)) x (* (- b) (fma (- a) i (* c z))))
(* (fma (- i) y (* 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 (j <= -2.1e+101) {
tmp = ((z * y) * x) + (j * ((c * t) - (i * y)));
} else if (j <= 4e+89) {
tmp = fma(fma(-a, t, (z * y)), x, (-b * fma(-a, i, (c * z))));
} else {
tmp = fma(-i, y, (c * t)) * j;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -2.1e+101) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); elseif (j <= 4e+89) tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(-b) * fma(Float64(-a), i, Float64(c * z)))); else tmp = Float64(fma(Float64(-i), y, Float64(c * t)) * j); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -2.1e+101], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 4e+89], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * N[((-a) * i + N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -2.1 \cdot 10^{+101}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;j \leq 4 \cdot 10^{+89}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-a, i, c \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\
\end{array}
\end{array}
if j < -2.1e101Initial program 71.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6462.6
Applied rewrites62.6%
if -2.1e101 < j < 3.99999999999999998e89Initial program 78.2%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites75.4%
if 3.99999999999999998e89 < j Initial program 79.7%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f6479.1
Applied rewrites79.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= x -7.2e-13)
(* (fma (- a) t (* z y)) x)
(if (<= x -1.15e-274)
(* (fma j t (* (- b) z)) c)
(if (<= x 1.9e-237)
(* (- i) (fma j y (* (- a) b)))
(if (<= x 1.85e-83)
(* (fma i a (* (- c) z)) b)
(if (<= x 5600000000.0)
(* (fma (- i) j (* z x)) y)
(* (- x) (fma (- y) z (* a t)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -7.2e-13) {
tmp = fma(-a, t, (z * y)) * x;
} else if (x <= -1.15e-274) {
tmp = fma(j, t, (-b * z)) * c;
} else if (x <= 1.9e-237) {
tmp = -i * fma(j, y, (-a * b));
} else if (x <= 1.85e-83) {
tmp = fma(i, a, (-c * z)) * b;
} else if (x <= 5600000000.0) {
tmp = fma(-i, j, (z * x)) * y;
} else {
tmp = -x * fma(-y, z, (a * t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -7.2e-13) tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); elseif (x <= -1.15e-274) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (x <= 1.9e-237) tmp = Float64(Float64(-i) * fma(j, y, Float64(Float64(-a) * b))); elseif (x <= 1.85e-83) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); elseif (x <= 5600000000.0) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); else tmp = Float64(Float64(-x) * fma(Float64(-y), z, Float64(a * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -7.2e-13], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, -1.15e-274], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 1.9e-237], N[((-i) * N[(j * y + N[((-a) * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e-83], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 5600000000.0], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[((-x) * N[((-y) * z + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-274}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-237}:\\
\;\;\;\;\left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-a\right) \cdot b\right)\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-83}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;x \leq 5600000000:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(-x\right) \cdot \mathsf{fma}\left(-y, z, a \cdot t\right)\\
\end{array}
\end{array}
if x < -7.1999999999999996e-13Initial program 76.4%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6462.1
Applied rewrites62.1%
if -7.1999999999999996e-13 < x < -1.14999999999999998e-274Initial program 88.0%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6460.1
Applied rewrites60.1%
if -1.14999999999999998e-274 < x < 1.90000000000000012e-237Initial program 70.7%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6471.0
Applied rewrites71.0%
if 1.90000000000000012e-237 < x < 1.84999999999999997e-83Initial program 70.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6474.4
Applied rewrites74.4%
if 1.84999999999999997e-83 < x < 5.6e9Initial program 78.8%
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-*.f6466.2
Applied rewrites66.2%
if 5.6e9 < x Initial program 74.3%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites67.1%
Taylor expanded in x 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
lower-*.f6469.6
Applied rewrites69.6%
Final simplification65.9%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= a -6.8e+87) (not (<= a 4e+29))) (* (fma (- t) x (* i b)) a) (+ (* (* z y) x) (* 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) {
double tmp;
if ((a <= -6.8e+87) || !(a <= 4e+29)) {
tmp = fma(-t, x, (i * b)) * a;
} else {
tmp = ((z * y) * x) + (j * ((c * t) - (i * y)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((a <= -6.8e+87) || !(a <= 4e+29)) tmp = Float64(fma(Float64(-t), x, Float64(i * b)) * a); else tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[a, -6.8e+87], N[Not[LessEqual[a, 4e+29]], $MachinePrecision]], N[(N[((-t) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{+87} \lor \neg \left(a \leq 4 \cdot 10^{+29}\right):\\
\;\;\;\;\mathsf{fma}\left(-t, x, i \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\\
\end{array}
\end{array}
if a < -6.8000000000000004e87 or 3.99999999999999966e29 < a Initial program 64.3%
Taylor expanded in i around 0
lower--.f64N/A
Applied rewrites66.2%
Taylor expanded in a around inf
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lift-*.f6468.7
Applied rewrites68.7%
if -6.8000000000000004e87 < a < 3.99999999999999966e29Initial program 86.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6466.0
Applied rewrites66.0%
Final simplification67.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -7.8e-19)
(* (fma j t (* (- b) z)) c)
(if (<= j -8.5e-80)
(* (fma (- i) j (* z x)) y)
(if (<= j 1.16e-299)
(* (fma (- t) x (* i b)) a)
(if (<= j 6e+33)
(* (fma y x (* (- b) c)) z)
(* (fma (- i) y (* 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 (j <= -7.8e-19) {
tmp = fma(j, t, (-b * z)) * c;
} else if (j <= -8.5e-80) {
tmp = fma(-i, j, (z * x)) * y;
} else if (j <= 1.16e-299) {
tmp = fma(-t, x, (i * b)) * a;
} else if (j <= 6e+33) {
tmp = fma(y, x, (-b * c)) * z;
} else {
tmp = fma(-i, y, (c * t)) * j;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -7.8e-19) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (j <= -8.5e-80) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (j <= 1.16e-299) tmp = Float64(fma(Float64(-t), x, Float64(i * b)) * a); elseif (j <= 6e+33) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); else tmp = Float64(fma(Float64(-i), y, Float64(c * t)) * j); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -7.8e-19], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[j, -8.5e-80], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[j, 1.16e-299], N[(N[((-t) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[j, 6e+33], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -7.8 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;j \leq -8.5 \cdot 10^{-80}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;j \leq 1.16 \cdot 10^{-299}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, i \cdot b\right) \cdot a\\
\mathbf{elif}\;j \leq 6 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\
\end{array}
\end{array}
if j < -7.7999999999999999e-19Initial program 70.9%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6458.3
Applied rewrites58.3%
if -7.7999999999999999e-19 < j < -8.49999999999999939e-80Initial program 79.8%
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-*.f6470.2
Applied rewrites70.2%
if -8.49999999999999939e-80 < j < 1.15999999999999997e-299Initial program 74.9%
Taylor expanded in i around 0
lower--.f64N/A
Applied rewrites71.6%
Taylor expanded in a around inf
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lift-*.f6462.7
Applied rewrites62.7%
if 1.15999999999999997e-299 < j < 5.99999999999999967e33Initial program 83.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6460.1
Applied rewrites60.1%
if 5.99999999999999967e33 < j Initial program 79.4%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f6475.7
Applied rewrites75.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) t (* z y)) x)))
(if (<= x -7.2e-13)
t_1
(if (<= x -5e-222)
(* (fma j t (* (- b) z)) c)
(if (<= x 1.85e-83)
(* (fma i a (* (- c) z)) b)
(if (<= x 5600000000.0) (* (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, t, (z * y)) * x;
double tmp;
if (x <= -7.2e-13) {
tmp = t_1;
} else if (x <= -5e-222) {
tmp = fma(j, t, (-b * z)) * c;
} else if (x <= 1.85e-83) {
tmp = fma(i, a, (-c * z)) * b;
} else if (x <= 5600000000.0) {
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), t, Float64(z * y)) * x) tmp = 0.0 if (x <= -7.2e-13) tmp = t_1; elseif (x <= -5e-222) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (x <= 1.85e-83) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); elseif (x <= 5600000000.0) 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) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -7.2e-13], t$95$1, If[LessEqual[x, -5e-222], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 1.85e-83], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 5600000000.0], 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, t, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -7.2 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-222}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-83}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;x \leq 5600000000:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.1999999999999996e-13 or 5.6e9 < x Initial program 75.4%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6465.1
Applied rewrites65.1%
if -7.1999999999999996e-13 < x < -5.00000000000000008e-222Initial program 91.2%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6462.3
Applied rewrites62.3%
if -5.00000000000000008e-222 < x < 1.84999999999999997e-83Initial program 71.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6461.0
Applied rewrites61.0%
if 1.84999999999999997e-83 < x < 5.6e9Initial program 78.8%
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-*.f6466.2
Applied rewrites66.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* i a) b)))
(if (<= x -4.8e+212)
(* (- a) (* t x))
(if (<= x -7.2e+102)
(* (* z y) x)
(if (<= x -1.45e-114)
t_1
(if (<= x -2.35e-221)
(* (* j t) c)
(if (<= x 3.4e-83) t_1 (* (* y x) z))))))))
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) * b;
double tmp;
if (x <= -4.8e+212) {
tmp = -a * (t * x);
} else if (x <= -7.2e+102) {
tmp = (z * y) * x;
} else if (x <= -1.45e-114) {
tmp = t_1;
} else if (x <= -2.35e-221) {
tmp = (j * t) * c;
} else if (x <= 3.4e-83) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (i * a) * b
if (x <= (-4.8d+212)) then
tmp = -a * (t * x)
else if (x <= (-7.2d+102)) then
tmp = (z * y) * x
else if (x <= (-1.45d-114)) then
tmp = t_1
else if (x <= (-2.35d-221)) then
tmp = (j * t) * c
else if (x <= 3.4d-83) then
tmp = t_1
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 t_1 = (i * a) * b;
double tmp;
if (x <= -4.8e+212) {
tmp = -a * (t * x);
} else if (x <= -7.2e+102) {
tmp = (z * y) * x;
} else if (x <= -1.45e-114) {
tmp = t_1;
} else if (x <= -2.35e-221) {
tmp = (j * t) * c;
} else if (x <= 3.4e-83) {
tmp = t_1;
} else {
tmp = (y * x) * z;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (i * a) * b tmp = 0 if x <= -4.8e+212: tmp = -a * (t * x) elif x <= -7.2e+102: tmp = (z * y) * x elif x <= -1.45e-114: tmp = t_1 elif x <= -2.35e-221: tmp = (j * t) * c elif x <= 3.4e-83: tmp = t_1 else: tmp = (y * x) * z return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * a) * b) tmp = 0.0 if (x <= -4.8e+212) tmp = Float64(Float64(-a) * Float64(t * x)); elseif (x <= -7.2e+102) tmp = Float64(Float64(z * y) * x); elseif (x <= -1.45e-114) tmp = t_1; elseif (x <= -2.35e-221) tmp = Float64(Float64(j * t) * c); elseif (x <= 3.4e-83) tmp = t_1; else tmp = Float64(Float64(y * x) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (i * a) * b; tmp = 0.0; if (x <= -4.8e+212) tmp = -a * (t * x); elseif (x <= -7.2e+102) tmp = (z * y) * x; elseif (x <= -1.45e-114) tmp = t_1; elseif (x <= -2.35e-221) tmp = (j * t) * c; elseif (x <= 3.4e-83) tmp = t_1; else tmp = (y * x) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[x, -4.8e+212], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.2e+102], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, -1.45e-114], t$95$1, If[LessEqual[x, -2.35e-221], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 3.4e-83], t$95$1, N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot a\right) \cdot b\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+212}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{+102}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.35 \cdot 10^{-221}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-83}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\end{array}
\end{array}
if x < -4.8e212Initial program 82.4%
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-*.f6463.9
Applied rewrites63.9%
Taylor expanded in x around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6446.7
Applied rewrites46.7%
if -4.8e212 < x < -7.2000000000000003e102Initial program 71.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6459.8
Applied rewrites59.8%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6459.7
Applied rewrites59.7%
if -7.2000000000000003e102 < x < -1.44999999999999998e-114 or -2.34999999999999987e-221 < x < 3.3999999999999998e-83Initial program 77.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6458.8
Applied rewrites58.8%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f6438.9
Applied rewrites38.9%
if -1.44999999999999998e-114 < x < -2.34999999999999987e-221Initial program 88.5%
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-*.f6457.3
Applied rewrites57.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6449.1
Applied rewrites49.1%
if 3.3999999999999998e-83 < x Initial program 75.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6444.9
Applied rewrites44.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6440.6
Applied rewrites40.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) t (* z y)) x)))
(if (<= x -7.2e-13)
t_1
(if (<= x -5e-222)
(* (fma j t (* (- b) z)) c)
(if (<= x 1.85e-83) (* (fma i a (* (- c) z)) 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, t, (z * y)) * x;
double tmp;
if (x <= -7.2e-13) {
tmp = t_1;
} else if (x <= -5e-222) {
tmp = fma(j, t, (-b * z)) * c;
} else if (x <= 1.85e-83) {
tmp = fma(i, a, (-c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), t, Float64(z * y)) * x) tmp = 0.0 if (x <= -7.2e-13) tmp = t_1; elseif (x <= -5e-222) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (x <= 1.85e-83) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * 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) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -7.2e-13], t$95$1, If[LessEqual[x, -5e-222], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 1.85e-83], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -7.2 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-222}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-83}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.1999999999999996e-13 or 1.84999999999999997e-83 < x Initial program 75.9%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6462.2
Applied rewrites62.2%
if -7.1999999999999996e-13 < x < -5.00000000000000008e-222Initial program 91.2%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6462.3
Applied rewrites62.3%
if -5.00000000000000008e-222 < x < 1.84999999999999997e-83Initial program 71.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6461.0
Applied rewrites61.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma j t (* (- b) z)) c)))
(if (<= j -2.2e-66)
t_1
(if (<= j 5.5e-253)
(* (fma i a (* (- c) z)) b)
(if (<= j 1e+50) (* (fma y x (* (- b) c)) z) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(j, t, (-b * z)) * c;
double tmp;
if (j <= -2.2e-66) {
tmp = t_1;
} else if (j <= 5.5e-253) {
tmp = fma(i, a, (-c * z)) * b;
} else if (j <= 1e+50) {
tmp = fma(y, x, (-b * c)) * z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(j, t, Float64(Float64(-b) * z)) * c) tmp = 0.0 if (j <= -2.2e-66) tmp = t_1; elseif (j <= 5.5e-253) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); elseif (j <= 1e+50) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[j, -2.2e-66], t$95$1, If[LessEqual[j, 5.5e-253], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[j, 1e+50], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{if}\;j \leq -2.2 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 5.5 \cdot 10^{-253}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;j \leq 10^{+50}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -2.2000000000000001e-66 or 1.0000000000000001e50 < j Initial program 76.7%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6453.8
Applied rewrites53.8%
if -2.2000000000000001e-66 < j < 5.49999999999999974e-253Initial program 72.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.3
Applied rewrites49.3%
if 5.49999999999999974e-253 < j < 1.0000000000000001e50Initial program 84.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6460.6
Applied rewrites60.6%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= x -4.8e+212)
(* (- a) (* t x))
(if (<= x -1.55e+103)
(* (* z y) x)
(if (<= x 2.3e+72) (* (fma i a (* (- c) z)) b) (* (* 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 (x <= -4.8e+212) {
tmp = -a * (t * x);
} else if (x <= -1.55e+103) {
tmp = (z * y) * x;
} else if (x <= 2.3e+72) {
tmp = fma(i, a, (-c * z)) * b;
} else {
tmp = (y * x) * z;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -4.8e+212) tmp = Float64(Float64(-a) * Float64(t * x)); elseif (x <= -1.55e+103) tmp = Float64(Float64(z * y) * x); elseif (x <= 2.3e+72) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); else tmp = Float64(Float64(y * x) * z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -4.8e+212], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.55e+103], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 2.3e+72], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+212}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{+103}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+72}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\end{array}
\end{array}
if x < -4.8e212Initial program 82.4%
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-*.f6463.9
Applied rewrites63.9%
Taylor expanded in x around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6446.7
Applied rewrites46.7%
if -4.8e212 < x < -1.5500000000000001e103Initial program 71.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6459.8
Applied rewrites59.8%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6459.7
Applied rewrites59.7%
if -1.5500000000000001e103 < x < 2.3e72Initial program 80.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6450.5
Applied rewrites50.5%
if 2.3e72 < x Initial program 68.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6447.8
Applied rewrites47.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6447.9
Applied rewrites47.9%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= x -4.8e+212)
(* (- a) (* t x))
(if (<= x -4.5e+81)
(* (* z y) x)
(if (<= x -5.8e-237)
(* (* (- c) z) b)
(if (<= x 3.4e-83) (* (* i a) b) (* (* 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 (x <= -4.8e+212) {
tmp = -a * (t * x);
} else if (x <= -4.5e+81) {
tmp = (z * y) * x;
} else if (x <= -5.8e-237) {
tmp = (-c * z) * b;
} else if (x <= 3.4e-83) {
tmp = (i * a) * b;
} 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 (x <= (-4.8d+212)) then
tmp = -a * (t * x)
else if (x <= (-4.5d+81)) then
tmp = (z * y) * x
else if (x <= (-5.8d-237)) then
tmp = (-c * z) * b
else if (x <= 3.4d-83) then
tmp = (i * a) * b
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 (x <= -4.8e+212) {
tmp = -a * (t * x);
} else if (x <= -4.5e+81) {
tmp = (z * y) * x;
} else if (x <= -5.8e-237) {
tmp = (-c * z) * b;
} else if (x <= 3.4e-83) {
tmp = (i * a) * b;
} else {
tmp = (y * x) * z;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -4.8e+212: tmp = -a * (t * x) elif x <= -4.5e+81: tmp = (z * y) * x elif x <= -5.8e-237: tmp = (-c * z) * b elif x <= 3.4e-83: tmp = (i * a) * b else: tmp = (y * x) * z return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -4.8e+212) tmp = Float64(Float64(-a) * Float64(t * x)); elseif (x <= -4.5e+81) tmp = Float64(Float64(z * y) * x); elseif (x <= -5.8e-237) tmp = Float64(Float64(Float64(-c) * z) * b); elseif (x <= 3.4e-83) tmp = Float64(Float64(i * a) * b); 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 (x <= -4.8e+212) tmp = -a * (t * x); elseif (x <= -4.5e+81) tmp = (z * y) * x; elseif (x <= -5.8e-237) tmp = (-c * z) * b; elseif (x <= 3.4e-83) tmp = (i * a) * b; else tmp = (y * x) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -4.8e+212], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.5e+81], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, -5.8e-237], N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 3.4e-83], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+212}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{+81}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-237}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-83}:\\
\;\;\;\;\left(i \cdot a\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\end{array}
\end{array}
if x < -4.8e212Initial program 82.4%
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-*.f6463.9
Applied rewrites63.9%
Taylor expanded in x around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6446.7
Applied rewrites46.7%
if -4.8e212 < x < -4.50000000000000017e81Initial program 72.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6453.8
Applied rewrites53.8%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6453.8
Applied rewrites53.8%
if -4.50000000000000017e81 < x < -5.80000000000000022e-237Initial program 86.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6451.6
Applied rewrites51.6%
Taylor expanded in z around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
lift-neg.f6434.3
Applied rewrites34.3%
if -5.80000000000000022e-237 < x < 3.3999999999999998e-83Initial program 70.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6459.2
Applied rewrites59.2%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f6444.8
Applied rewrites44.8%
if 3.3999999999999998e-83 < x Initial program 75.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6444.9
Applied rewrites44.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6440.6
Applied rewrites40.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* i a) b)))
(if (<= x -7.2e+102)
(* (* z y) x)
(if (<= x -1.45e-114)
t_1
(if (<= x -2.35e-221)
(* (* j t) c)
(if (<= x 3.4e-83) t_1 (* (* y x) z)))))))
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) * b;
double tmp;
if (x <= -7.2e+102) {
tmp = (z * y) * x;
} else if (x <= -1.45e-114) {
tmp = t_1;
} else if (x <= -2.35e-221) {
tmp = (j * t) * c;
} else if (x <= 3.4e-83) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (i * a) * b
if (x <= (-7.2d+102)) then
tmp = (z * y) * x
else if (x <= (-1.45d-114)) then
tmp = t_1
else if (x <= (-2.35d-221)) then
tmp = (j * t) * c
else if (x <= 3.4d-83) then
tmp = t_1
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 t_1 = (i * a) * b;
double tmp;
if (x <= -7.2e+102) {
tmp = (z * y) * x;
} else if (x <= -1.45e-114) {
tmp = t_1;
} else if (x <= -2.35e-221) {
tmp = (j * t) * c;
} else if (x <= 3.4e-83) {
tmp = t_1;
} else {
tmp = (y * x) * z;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (i * a) * b tmp = 0 if x <= -7.2e+102: tmp = (z * y) * x elif x <= -1.45e-114: tmp = t_1 elif x <= -2.35e-221: tmp = (j * t) * c elif x <= 3.4e-83: tmp = t_1 else: tmp = (y * x) * z return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * a) * b) tmp = 0.0 if (x <= -7.2e+102) tmp = Float64(Float64(z * y) * x); elseif (x <= -1.45e-114) tmp = t_1; elseif (x <= -2.35e-221) tmp = Float64(Float64(j * t) * c); elseif (x <= 3.4e-83) tmp = t_1; else tmp = Float64(Float64(y * x) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (i * a) * b; tmp = 0.0; if (x <= -7.2e+102) tmp = (z * y) * x; elseif (x <= -1.45e-114) tmp = t_1; elseif (x <= -2.35e-221) tmp = (j * t) * c; elseif (x <= 3.4e-83) tmp = t_1; else tmp = (y * x) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[x, -7.2e+102], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, -1.45e-114], t$95$1, If[LessEqual[x, -2.35e-221], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 3.4e-83], t$95$1, N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot a\right) \cdot b\\
\mathbf{if}\;x \leq -7.2 \cdot 10^{+102}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.35 \cdot 10^{-221}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-83}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\end{array}
\end{array}
if x < -7.2000000000000003e102Initial program 76.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6450.2
Applied rewrites50.2%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6443.3
Applied rewrites43.3%
if -7.2000000000000003e102 < x < -1.44999999999999998e-114 or -2.34999999999999987e-221 < x < 3.3999999999999998e-83Initial program 77.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6458.8
Applied rewrites58.8%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f6438.9
Applied rewrites38.9%
if -1.44999999999999998e-114 < x < -2.34999999999999987e-221Initial program 88.5%
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-*.f6457.3
Applied rewrites57.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6449.1
Applied rewrites49.1%
if 3.3999999999999998e-83 < x Initial program 75.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6444.9
Applied rewrites44.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6440.6
Applied rewrites40.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* z y) x)))
(if (<= z -1.32e+68)
t_1
(if (<= z -5.5e-134)
(* (* i a) b)
(if (<= z -2.8e-242)
(* (* j t) c)
(if (<= z 6.5e-140) (* (* i b) a) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * y) * x;
double tmp;
if (z <= -1.32e+68) {
tmp = t_1;
} else if (z <= -5.5e-134) {
tmp = (i * a) * b;
} else if (z <= -2.8e-242) {
tmp = (j * t) * c;
} else if (z <= 6.5e-140) {
tmp = (i * b) * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (z * y) * x
if (z <= (-1.32d+68)) then
tmp = t_1
else if (z <= (-5.5d-134)) then
tmp = (i * a) * b
else if (z <= (-2.8d-242)) then
tmp = (j * t) * c
else if (z <= 6.5d-140) then
tmp = (i * b) * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * y) * x;
double tmp;
if (z <= -1.32e+68) {
tmp = t_1;
} else if (z <= -5.5e-134) {
tmp = (i * a) * b;
} else if (z <= -2.8e-242) {
tmp = (j * t) * c;
} else if (z <= 6.5e-140) {
tmp = (i * b) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (z * y) * x tmp = 0 if z <= -1.32e+68: tmp = t_1 elif z <= -5.5e-134: tmp = (i * a) * b elif z <= -2.8e-242: tmp = (j * t) * c elif z <= 6.5e-140: tmp = (i * b) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * y) * x) tmp = 0.0 if (z <= -1.32e+68) tmp = t_1; elseif (z <= -5.5e-134) tmp = Float64(Float64(i * a) * b); elseif (z <= -2.8e-242) tmp = Float64(Float64(j * t) * c); elseif (z <= 6.5e-140) tmp = Float64(Float64(i * b) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (z * y) * x; tmp = 0.0; if (z <= -1.32e+68) tmp = t_1; elseif (z <= -5.5e-134) tmp = (i * a) * b; elseif (z <= -2.8e-242) tmp = (j * t) * c; elseif (z <= 6.5e-140) tmp = (i * b) * a; 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[(z * y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -1.32e+68], t$95$1, If[LessEqual[z, -5.5e-134], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[z, -2.8e-242], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[z, 6.5e-140], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y\right) \cdot x\\
\mathbf{if}\;z \leq -1.32 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-134}:\\
\;\;\;\;\left(i \cdot a\right) \cdot b\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-242}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-140}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.3200000000000001e68 or 6.4999999999999995e-140 < z Initial program 73.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6458.6
Applied rewrites58.6%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6438.0
Applied rewrites38.0%
if -1.3200000000000001e68 < z < -5.5000000000000002e-134Initial program 89.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6447.9
Applied rewrites47.9%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f6436.4
Applied rewrites36.4%
if -5.5000000000000002e-134 < z < -2.79999999999999983e-242Initial program 76.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-*.f6470.3
Applied rewrites70.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6451.4
Applied rewrites51.4%
if -2.79999999999999983e-242 < z < 6.4999999999999995e-140Initial program 79.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6441.6
Applied rewrites41.6%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6439.1
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* i b) a)) (t_2 (* (* z y) x)))
(if (<= z -5.1e+23)
t_2
(if (<= z -5.5e-134)
t_1
(if (<= z -2.8e-242) (* (* j t) c) (if (<= z 6.5e-140) 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 * b) * a;
double t_2 = (z * y) * x;
double tmp;
if (z <= -5.1e+23) {
tmp = t_2;
} else if (z <= -5.5e-134) {
tmp = t_1;
} else if (z <= -2.8e-242) {
tmp = (j * t) * c;
} else if (z <= 6.5e-140) {
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 * b) * a
t_2 = (z * y) * x
if (z <= (-5.1d+23)) then
tmp = t_2
else if (z <= (-5.5d-134)) then
tmp = t_1
else if (z <= (-2.8d-242)) then
tmp = (j * t) * c
else if (z <= 6.5d-140) 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 * b) * a;
double t_2 = (z * y) * x;
double tmp;
if (z <= -5.1e+23) {
tmp = t_2;
} else if (z <= -5.5e-134) {
tmp = t_1;
} else if (z <= -2.8e-242) {
tmp = (j * t) * c;
} else if (z <= 6.5e-140) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (i * b) * a t_2 = (z * y) * x tmp = 0 if z <= -5.1e+23: tmp = t_2 elif z <= -5.5e-134: tmp = t_1 elif z <= -2.8e-242: tmp = (j * t) * c elif z <= 6.5e-140: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * b) * a) t_2 = Float64(Float64(z * y) * x) tmp = 0.0 if (z <= -5.1e+23) tmp = t_2; elseif (z <= -5.5e-134) tmp = t_1; elseif (z <= -2.8e-242) tmp = Float64(Float64(j * t) * c); elseif (z <= 6.5e-140) 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 * b) * a; t_2 = (z * y) * x; tmp = 0.0; if (z <= -5.1e+23) tmp = t_2; elseif (z <= -5.5e-134) tmp = t_1; elseif (z <= -2.8e-242) tmp = (j * t) * c; elseif (z <= 6.5e-140) 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[(i * b), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -5.1e+23], t$95$2, If[LessEqual[z, -5.5e-134], t$95$1, If[LessEqual[z, -2.8e-242], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[z, 6.5e-140], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot b\right) \cdot a\\
t_2 := \left(z \cdot y\right) \cdot x\\
\mathbf{if}\;z \leq -5.1 \cdot 10^{+23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-134}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-242}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-140}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -5.10000000000000021e23 or 6.4999999999999995e-140 < z Initial program 74.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6458.5
Applied rewrites58.5%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6437.8
Applied rewrites37.8%
if -5.10000000000000021e23 < z < -5.5000000000000002e-134 or -2.79999999999999983e-242 < z < 6.4999999999999995e-140Initial program 84.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6443.9
Applied rewrites43.9%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6436.5
Applied rewrites36.5%
if -5.5000000000000002e-134 < z < -2.79999999999999983e-242Initial program 76.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-*.f6470.3
Applied rewrites70.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6451.4
Applied rewrites51.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= j -2.2e-66) (not (<= j 2.5e+38))) (* (fma j t (* (- b) z)) c) (* (fma i a (* (- c) z)) b)))
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.2e-66) || !(j <= 2.5e+38)) {
tmp = fma(j, t, (-b * z)) * c;
} else {
tmp = fma(i, a, (-c * z)) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((j <= -2.2e-66) || !(j <= 2.5e+38)) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); else tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[j, -2.2e-66], N[Not[LessEqual[j, 2.5e+38]], $MachinePrecision]], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -2.2 \cdot 10^{-66} \lor \neg \left(j \leq 2.5 \cdot 10^{+38}\right):\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\end{array}
\end{array}
if j < -2.2000000000000001e-66 or 2.49999999999999985e38 < j Initial program 76.2%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6453.7
Applied rewrites53.7%
if -2.2000000000000001e-66 < j < 2.49999999999999985e38Initial program 78.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6447.2
Applied rewrites47.2%
Final simplification50.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= i -5.8e+68) (not (<= i 0.00062))) (* (* i b) a) (* (* z y) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((i <= -5.8e+68) || !(i <= 0.00062)) {
tmp = (i * b) * a;
} else {
tmp = (z * y) * x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if ((i <= (-5.8d+68)) .or. (.not. (i <= 0.00062d0))) then
tmp = (i * b) * a
else
tmp = (z * y) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((i <= -5.8e+68) || !(i <= 0.00062)) {
tmp = (i * b) * a;
} else {
tmp = (z * y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (i <= -5.8e+68) or not (i <= 0.00062): tmp = (i * b) * a else: tmp = (z * y) * x return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((i <= -5.8e+68) || !(i <= 0.00062)) tmp = Float64(Float64(i * b) * a); else tmp = Float64(Float64(z * y) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((i <= -5.8e+68) || ~((i <= 0.00062))) tmp = (i * b) * a; else tmp = (z * y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[i, -5.8e+68], N[Not[LessEqual[i, 0.00062]], $MachinePrecision]], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -5.8 \cdot 10^{+68} \lor \neg \left(i \leq 0.00062\right):\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\end{array}
\end{array}
if i < -5.80000000000000023e68 or 6.2e-4 < i Initial program 65.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.7
Applied rewrites49.7%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6438.3
Applied rewrites38.3%
if -5.80000000000000023e68 < i < 6.2e-4Initial program 87.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6449.7
Applied rewrites49.7%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6433.3
Applied rewrites33.3%
Final simplification35.5%
(FPCore (x y z t a b c i j) :precision binary64 (* (* i b) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (i * b) * a;
}
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 = (i * b) * a
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 (i * b) * a;
}
def code(x, y, z, t, a, b, c, i, j): return (i * b) * a
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(i * b) * a) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (i * b) * a; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]
\begin{array}{l}
\\
\left(i \cdot b\right) \cdot a
\end{array}
Initial program 77.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6438.8
Applied rewrites38.8%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6423.2
Applied rewrites23.2%
(FPCore (x y z t a b c i j) :precision binary64 (* (* b a) i))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (b * a) * i;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = (b * a) * i
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (b * a) * i;
}
def code(x, y, z, t, a, b, c, i, j): return (b * a) * i
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(b * a) * i) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (b * a) * i; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]
\begin{array}{l}
\\
\left(b \cdot a\right) \cdot i
\end{array}
Initial program 77.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6438.8
Applied rewrites38.8%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6423.2
Applied rewrites23.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.8
Applied rewrites21.8%
herbie shell --seed 2025085
(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)))))