
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- y) j (* b t)) i))
(t_2 (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))))
(t_3 (+ t_2 (* j (- (* c a) (* y i))))))
(if (<= t_3 2e+297)
(+ t_2 (fma (* c a) j (* (* (- y) i) j)))
(if (<= t_3 INFINITY)
(+ (fma (fma (- z) b (* j a)) c (* (fma (- a) t (* z y)) x)) t_1)
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(-y, j, (b * t)) * i;
double t_2 = (x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)));
double t_3 = t_2 + (j * ((c * a) - (y * i)));
double tmp;
if (t_3 <= 2e+297) {
tmp = t_2 + fma((c * a), j, ((-y * i) * j));
} else if (t_3 <= ((double) INFINITY)) {
tmp = fma(fma(-z, b, (j * a)), c, (fma(-a, t, (z * y)) * x)) + t_1;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-y), j, Float64(b * t)) * i) t_2 = Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) t_3 = Float64(t_2 + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (t_3 <= 2e+297) tmp = Float64(t_2 + fma(Float64(c * a), j, Float64(Float64(Float64(-y) * i) * j))); elseif (t_3 <= Inf) tmp = Float64(fma(fma(Float64(-z), b, Float64(j * a)), c, Float64(fma(Float64(-a), t, Float64(z * y)) * x)) + t_1); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-y) * j + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 2e+297], N[(t$95$2 + N[(N[(c * a), $MachinePrecision] * j + N[(N[((-y) * i), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[(N[((-z) * b + N[(j * a), $MachinePrecision]), $MachinePrecision] * c + N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, j, b \cdot t\right) \cdot i\\
t_2 := x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\\
t_3 := t\_2 + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{+297}:\\
\;\;\;\;t\_2 + \mathsf{fma}\left(c \cdot a, j, \left(\left(-y\right) \cdot i\right) \cdot j\right)\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-z, b, j \cdot a\right), c, \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < 2e297Initial program 92.8%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-neg.f6492.8
Applied rewrites92.8%
if 2e297 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 84.7%
Taylor expanded in c around 0
Applied rewrites95.1%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 0.0%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6458.5
Applied rewrites58.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- y) j (* b t)) i))
(t_2
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
(* j (- (* c a) (* y i))))))
(if (<= t_2 2e+297)
(fma
(fma (- t) a (* z y))
x
(fma (- b) (fma (- t) i (* c z)) (* (fma (- y) i (* c a)) j)))
(if (<= t_2 INFINITY)
(+ (fma (fma (- z) b (* j a)) c (* (fma (- a) t (* z y)) x)) t_1)
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(-y, j, (b * t)) * i;
double t_2 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_2 <= 2e+297) {
tmp = fma(fma(-t, a, (z * y)), x, fma(-b, fma(-t, i, (c * z)), (fma(-y, i, (c * a)) * j)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma(fma(-z, b, (j * a)), c, (fma(-a, t, (z * y)) * x)) + t_1;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-y), j, Float64(b * t)) * i) t_2 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (t_2 <= 2e+297) tmp = fma(fma(Float64(-t), a, Float64(z * y)), x, fma(Float64(-b), fma(Float64(-t), i, Float64(c * z)), Float64(fma(Float64(-y), i, Float64(c * a)) * j))); elseif (t_2 <= Inf) tmp = Float64(fma(fma(Float64(-z), b, Float64(j * a)), c, Float64(fma(Float64(-a), t, Float64(z * y)) * x)) + t_1); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-y) * j + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 2e+297], N[(N[((-t) * a + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * N[((-t) * i + N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(N[((-y) * i + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(N[((-z) * b + N[(j * a), $MachinePrecision]), $MachinePrecision] * c + N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, j, b \cdot t\right) \cdot i\\
t_2 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_2 \leq 2 \cdot 10^{+297}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-t, a, z \cdot y\right), x, \mathsf{fma}\left(-b, \mathsf{fma}\left(-t, i, c \cdot z\right), \mathsf{fma}\left(-y, i, c \cdot a\right) \cdot j\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-z, b, j \cdot a\right), c, \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < 2e297Initial program 92.8%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites92.8%
if 2e297 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 84.7%
Taylor expanded in c around 0
Applied rewrites95.1%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 0.0%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6458.5
Applied rewrites58.5%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -1.1e+125)
(* (* (fma (- i) (/ y a) c) j) a)
(if (<= j 1.2e+113)
(+
(fma (fma (- z) b (* j a)) c (* (fma (- a) t (* z y)) x))
(* (fma (- y) j (* b t)) i))
(* (- a) (fma t x (- (fma j c (* (/ (fma (- i) t (* z c)) a) (- b)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -1.1e+125) {
tmp = (fma(-i, (y / a), c) * j) * a;
} else if (j <= 1.2e+113) {
tmp = fma(fma(-z, b, (j * a)), c, (fma(-a, t, (z * y)) * x)) + (fma(-y, j, (b * t)) * i);
} else {
tmp = -a * fma(t, x, -fma(j, c, ((fma(-i, t, (z * c)) / a) * -b)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -1.1e+125) tmp = Float64(Float64(fma(Float64(-i), Float64(y / a), c) * j) * a); elseif (j <= 1.2e+113) tmp = Float64(fma(fma(Float64(-z), b, Float64(j * a)), c, Float64(fma(Float64(-a), t, Float64(z * y)) * x)) + Float64(fma(Float64(-y), j, Float64(b * t)) * i)); else tmp = Float64(Float64(-a) * fma(t, x, Float64(-fma(j, c, Float64(Float64(fma(Float64(-i), t, Float64(z * c)) / a) * Float64(-b)))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -1.1e+125], N[(N[(N[((-i) * N[(y / a), $MachinePrecision] + c), $MachinePrecision] * j), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[j, 1.2e+113], N[(N[(N[((-z) * b + N[(j * a), $MachinePrecision]), $MachinePrecision] * c + N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + N[(N[((-y) * j + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], N[((-a) * N[(t * x + (-N[(j * c + N[(N[(N[((-i) * t + N[(z * c), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -1.1 \cdot 10^{+125}:\\
\;\;\;\;\left(\mathsf{fma}\left(-i, \frac{y}{a}, c\right) \cdot j\right) \cdot a\\
\mathbf{elif}\;j \leq 1.2 \cdot 10^{+113}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-z, b, j \cdot a\right), c, \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\right) + \mathsf{fma}\left(-y, j, b \cdot t\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \mathsf{fma}\left(t, x, -\mathsf{fma}\left(j, c, \frac{\mathsf{fma}\left(-i, t, z \cdot c\right)}{a} \cdot \left(-b\right)\right)\right)\\
\end{array}
\end{array}
if j < -1.09999999999999995e125Initial program 65.4%
Taylor expanded in a around -inf
Applied rewrites82.8%
Taylor expanded in j around inf
Applied rewrites89.7%
if -1.09999999999999995e125 < j < 1.19999999999999992e113Initial program 72.1%
Taylor expanded in c around 0
Applied rewrites83.4%
if 1.19999999999999992e113 < j Initial program 69.2%
Taylor expanded in a around -inf
Applied rewrites69.6%
Taylor expanded in y around 0
Applied rewrites71.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- j) i (* z x)) y)))
(if (<= y -1.3e+25)
(fma (- b) (fma (- i) t (* c z)) t_1)
(if (<= y 2.3e+175)
(* (- a) (fma t x (- (fma j c (* (/ (fma (- i) t (* z c)) a) (- b))))))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-j, i, (z * x)) * y;
double tmp;
if (y <= -1.3e+25) {
tmp = fma(-b, fma(-i, t, (c * z)), t_1);
} else if (y <= 2.3e+175) {
tmp = -a * fma(t, x, -fma(j, c, ((fma(-i, t, (z * c)) / a) * -b)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-j), i, Float64(z * x)) * y) tmp = 0.0 if (y <= -1.3e+25) tmp = fma(Float64(-b), fma(Float64(-i), t, Float64(c * z)), t_1); elseif (y <= 2.3e+175) tmp = Float64(Float64(-a) * fma(t, x, Float64(-fma(j, c, Float64(Float64(fma(Float64(-i), t, Float64(z * c)) / a) * Float64(-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[((-j) * i + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -1.3e+25], N[((-b) * N[((-i) * t + N[(c * z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[y, 2.3e+175], N[((-a) * N[(t * x + (-N[(j * c + N[(N[(N[((-i) * t + N[(z * c), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(-b, \mathsf{fma}\left(-i, t, c \cdot z\right), t\_1\right)\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+175}:\\
\;\;\;\;\left(-a\right) \cdot \mathsf{fma}\left(t, x, -\mathsf{fma}\left(j, c, \frac{\mathsf{fma}\left(-i, t, z \cdot c\right)}{a} \cdot \left(-b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.2999999999999999e25Initial program 65.0%
Taylor expanded in a around 0
fp-cancel-sub-sign-invN/A
+-commutativeN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-inN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
Applied rewrites74.3%
if -1.2999999999999999e25 < y < 2.3e175Initial program 76.5%
Taylor expanded in a around -inf
Applied rewrites77.3%
Taylor expanded in y around 0
Applied rewrites78.5%
if 2.3e175 < y Initial program 54.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6481.4
Applied rewrites81.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (- b) (fma (- i) t (* c z)) (* (fma (- j) i (* z x)) y))))
(if (<= i -1.75e-28)
t_1
(if (<= i 6e-69)
(fma (fma (- z) b (* j a)) c (* (fma (- a) t (* z y)) x))
(if (<= i 7.5e+205) t_1 (* (fma (- y) j (* b t)) i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-b, fma(-i, t, (c * z)), (fma(-j, i, (z * x)) * y));
double tmp;
if (i <= -1.75e-28) {
tmp = t_1;
} else if (i <= 6e-69) {
tmp = fma(fma(-z, b, (j * a)), c, (fma(-a, t, (z * y)) * x));
} else if (i <= 7.5e+205) {
tmp = t_1;
} else {
tmp = fma(-y, j, (b * t)) * i;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(-b), fma(Float64(-i), t, Float64(c * z)), Float64(fma(Float64(-j), i, Float64(z * x)) * y)) tmp = 0.0 if (i <= -1.75e-28) tmp = t_1; elseif (i <= 6e-69) tmp = fma(fma(Float64(-z), b, Float64(j * a)), c, Float64(fma(Float64(-a), t, Float64(z * y)) * x)); elseif (i <= 7.5e+205) tmp = t_1; else tmp = Float64(fma(Float64(-y), j, Float64(b * t)) * i); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-b) * N[((-i) * t + N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(N[((-j) * i + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.75e-28], t$95$1, If[LessEqual[i, 6e-69], N[(N[((-z) * b + N[(j * a), $MachinePrecision]), $MachinePrecision] * c + N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7.5e+205], t$95$1, N[(N[((-y) * j + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-b, \mathsf{fma}\left(-i, t, c \cdot z\right), \mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y\right)\\
\mathbf{if}\;i \leq -1.75 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 6 \cdot 10^{-69}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-z, b, j \cdot a\right), c, \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\right)\\
\mathbf{elif}\;i \leq 7.5 \cdot 10^{+205}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y, j, b \cdot t\right) \cdot i\\
\end{array}
\end{array}
if i < -1.75e-28 or 5.99999999999999978e-69 < i < 7.5000000000000003e205Initial program 65.7%
Taylor expanded in a around 0
fp-cancel-sub-sign-invN/A
+-commutativeN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-inN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
Applied rewrites76.8%
if -1.75e-28 < i < 5.99999999999999978e-69Initial program 83.5%
Taylor expanded in i around 0
Applied rewrites77.6%
if 7.5000000000000003e205 < i Initial program 35.2%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6474.7
Applied rewrites74.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- x) t (* j c)) a)) (t_2 (* (fma (- y) j (* b t)) i)))
(if (<= i -1.1e-10)
t_2
(if (<= i -6.5e-167)
t_1
(if (<= i -1.55e-304)
(* (fma (- b) c (* y x)) z)
(if (<= i 1.6e-289)
t_1
(if (<= i 6e-67)
(* (fma (- a) t (* y z)) x)
(if (<= i 8e+136) t_2 (* (fma (- j) i (* z x)) y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-x, t, (j * c)) * a;
double t_2 = fma(-y, j, (b * t)) * i;
double tmp;
if (i <= -1.1e-10) {
tmp = t_2;
} else if (i <= -6.5e-167) {
tmp = t_1;
} else if (i <= -1.55e-304) {
tmp = fma(-b, c, (y * x)) * z;
} else if (i <= 1.6e-289) {
tmp = t_1;
} else if (i <= 6e-67) {
tmp = fma(-a, t, (y * z)) * x;
} else if (i <= 8e+136) {
tmp = t_2;
} else {
tmp = fma(-j, i, (z * x)) * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-x), t, Float64(j * c)) * a) t_2 = Float64(fma(Float64(-y), j, Float64(b * t)) * i) tmp = 0.0 if (i <= -1.1e-10) tmp = t_2; elseif (i <= -6.5e-167) tmp = t_1; elseif (i <= -1.55e-304) tmp = Float64(fma(Float64(-b), c, Float64(y * x)) * z); elseif (i <= 1.6e-289) tmp = t_1; elseif (i <= 6e-67) tmp = Float64(fma(Float64(-a), t, Float64(y * z)) * x); elseif (i <= 8e+136) tmp = t_2; else tmp = Float64(fma(Float64(-j), i, Float64(z * x)) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-x) * t + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-y) * j + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -1.1e-10], t$95$2, If[LessEqual[i, -6.5e-167], t$95$1, If[LessEqual[i, -1.55e-304], N[(N[((-b) * c + N[(y * x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[i, 1.6e-289], t$95$1, If[LessEqual[i, 6e-67], N[(N[((-a) * t + N[(y * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[i, 8e+136], t$95$2, N[(N[((-j) * i + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-x, t, j \cdot c\right) \cdot a\\
t_2 := \mathsf{fma}\left(-y, j, b \cdot t\right) \cdot i\\
\mathbf{if}\;i \leq -1.1 \cdot 10^{-10}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;i \leq -6.5 \cdot 10^{-167}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -1.55 \cdot 10^{-304}:\\
\;\;\;\;\mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z\\
\mathbf{elif}\;i \leq 1.6 \cdot 10^{-289}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 6 \cdot 10^{-67}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, y \cdot z\right) \cdot x\\
\mathbf{elif}\;i \leq 8 \cdot 10^{+136}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y\\
\end{array}
\end{array}
if i < -1.09999999999999995e-10 or 6.00000000000000065e-67 < i < 8.00000000000000047e136Initial program 66.1%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6470.5
Applied rewrites70.5%
if -1.09999999999999995e-10 < i < -6.49999999999999973e-167 or -1.54999999999999992e-304 < i < 1.6000000000000001e-289Initial program 88.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6474.1
Applied rewrites74.1%
if -6.49999999999999973e-167 < i < -1.54999999999999992e-304Initial program 71.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6462.3
Applied rewrites62.3%
if 1.6000000000000001e-289 < i < 6.00000000000000065e-67Initial program 86.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6446.5
Applied rewrites46.5%
Taylor expanded in x around 0
Applied rewrites10.4%
Taylor expanded in x around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6466.2
Applied rewrites66.2%
if 8.00000000000000047e136 < i Initial program 45.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6473.4
Applied rewrites73.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- y) j (* b t)) i)))
(if (<= i -0.008)
t_1
(if (<= i 1.96e-66)
(fma (fma (- z) b (* j a)) c (* (fma (- a) t (* z y)) x))
(if (<= i 8e+136) t_1 (* (fma (- j) i (* z x)) y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-y, j, (b * t)) * i;
double tmp;
if (i <= -0.008) {
tmp = t_1;
} else if (i <= 1.96e-66) {
tmp = fma(fma(-z, b, (j * a)), c, (fma(-a, t, (z * y)) * x));
} else if (i <= 8e+136) {
tmp = t_1;
} else {
tmp = fma(-j, i, (z * x)) * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-y), j, Float64(b * t)) * i) tmp = 0.0 if (i <= -0.008) tmp = t_1; elseif (i <= 1.96e-66) tmp = fma(fma(Float64(-z), b, Float64(j * a)), c, Float64(fma(Float64(-a), t, Float64(z * y)) * x)); elseif (i <= 8e+136) tmp = t_1; else tmp = Float64(fma(Float64(-j), i, Float64(z * x)) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-y) * j + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -0.008], t$95$1, If[LessEqual[i, 1.96e-66], N[(N[((-z) * b + N[(j * a), $MachinePrecision]), $MachinePrecision] * c + N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 8e+136], t$95$1, N[(N[((-j) * i + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, j, b \cdot t\right) \cdot i\\
\mathbf{if}\;i \leq -0.008:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.96 \cdot 10^{-66}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-z, b, j \cdot a\right), c, \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\right)\\
\mathbf{elif}\;i \leq 8 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y\\
\end{array}
\end{array}
if i < -0.0080000000000000002 or 1.95999999999999997e-66 < i < 8.00000000000000047e136Initial program 65.8%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6471.2
Applied rewrites71.2%
if -0.0080000000000000002 < i < 1.95999999999999997e-66Initial program 83.9%
Taylor expanded in i around 0
Applied rewrites77.3%
if 8.00000000000000047e136 < i Initial program 45.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6473.4
Applied rewrites73.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- y) j (* b t)) i)))
(if (<= i -1.1e-10)
t_1
(if (<= i -5.8e-150)
(* (- a) (fma (- j) c (* x t)))
(if (<= i -3.05e-261)
(* (fma (- z) b (* j a)) c)
(if (<= i 6e-67)
(* (fma (- a) t (* y z)) x)
(if (<= i 8e+136) t_1 (* (fma (- j) i (* z x)) y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-y, j, (b * t)) * i;
double tmp;
if (i <= -1.1e-10) {
tmp = t_1;
} else if (i <= -5.8e-150) {
tmp = -a * fma(-j, c, (x * t));
} else if (i <= -3.05e-261) {
tmp = fma(-z, b, (j * a)) * c;
} else if (i <= 6e-67) {
tmp = fma(-a, t, (y * z)) * x;
} else if (i <= 8e+136) {
tmp = t_1;
} else {
tmp = fma(-j, i, (z * x)) * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-y), j, Float64(b * t)) * i) tmp = 0.0 if (i <= -1.1e-10) tmp = t_1; elseif (i <= -5.8e-150) tmp = Float64(Float64(-a) * fma(Float64(-j), c, Float64(x * t))); elseif (i <= -3.05e-261) tmp = Float64(fma(Float64(-z), b, Float64(j * a)) * c); elseif (i <= 6e-67) tmp = Float64(fma(Float64(-a), t, Float64(y * z)) * x); elseif (i <= 8e+136) tmp = t_1; else tmp = Float64(fma(Float64(-j), i, Float64(z * x)) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-y) * j + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -1.1e-10], t$95$1, If[LessEqual[i, -5.8e-150], N[((-a) * N[((-j) * c + N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, -3.05e-261], N[(N[((-z) * b + N[(j * a), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[i, 6e-67], N[(N[((-a) * t + N[(y * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[i, 8e+136], t$95$1, N[(N[((-j) * i + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, j, b \cdot t\right) \cdot i\\
\mathbf{if}\;i \leq -1.1 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -5.8 \cdot 10^{-150}:\\
\;\;\;\;\left(-a\right) \cdot \mathsf{fma}\left(-j, c, x \cdot t\right)\\
\mathbf{elif}\;i \leq -3.05 \cdot 10^{-261}:\\
\;\;\;\;\mathsf{fma}\left(-z, b, j \cdot a\right) \cdot c\\
\mathbf{elif}\;i \leq 6 \cdot 10^{-67}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, y \cdot z\right) \cdot x\\
\mathbf{elif}\;i \leq 8 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y\\
\end{array}
\end{array}
if i < -1.09999999999999995e-10 or 6.00000000000000065e-67 < i < 8.00000000000000047e136Initial program 66.1%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6470.5
Applied rewrites70.5%
if -1.09999999999999995e-10 < i < -5.7999999999999996e-150Initial program 90.9%
Taylor expanded in a around -inf
Applied rewrites93.8%
Taylor expanded in a around -inf
associate-*r*N/A
mul-1-negN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6472.0
Applied rewrites72.0%
if -5.7999999999999996e-150 < i < -3.0499999999999999e-261Initial program 68.3%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6474.9
Applied rewrites74.9%
if -3.0499999999999999e-261 < i < 6.00000000000000065e-67Initial program 86.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.1
Applied rewrites40.1%
Taylor expanded in x around 0
Applied rewrites8.6%
Taylor expanded in x around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6462.1
Applied rewrites62.1%
if 8.00000000000000047e136 < i Initial program 45.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6473.4
Applied rewrites73.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- y) j (* b t)) i)))
(if (<= i -1.1e-10)
t_1
(if (<= i -5.8e-150)
(* (fma (- x) t (* j c)) a)
(if (<= i -3.05e-261)
(* (fma (- z) b (* j a)) c)
(if (<= i 6e-67)
(* (fma (- a) t (* y z)) x)
(if (<= i 8e+136) t_1 (* (fma (- j) i (* z x)) y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-y, j, (b * t)) * i;
double tmp;
if (i <= -1.1e-10) {
tmp = t_1;
} else if (i <= -5.8e-150) {
tmp = fma(-x, t, (j * c)) * a;
} else if (i <= -3.05e-261) {
tmp = fma(-z, b, (j * a)) * c;
} else if (i <= 6e-67) {
tmp = fma(-a, t, (y * z)) * x;
} else if (i <= 8e+136) {
tmp = t_1;
} else {
tmp = fma(-j, i, (z * x)) * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-y), j, Float64(b * t)) * i) tmp = 0.0 if (i <= -1.1e-10) tmp = t_1; elseif (i <= -5.8e-150) tmp = Float64(fma(Float64(-x), t, Float64(j * c)) * a); elseif (i <= -3.05e-261) tmp = Float64(fma(Float64(-z), b, Float64(j * a)) * c); elseif (i <= 6e-67) tmp = Float64(fma(Float64(-a), t, Float64(y * z)) * x); elseif (i <= 8e+136) tmp = t_1; else tmp = Float64(fma(Float64(-j), i, Float64(z * x)) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-y) * j + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -1.1e-10], t$95$1, If[LessEqual[i, -5.8e-150], N[(N[((-x) * t + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[i, -3.05e-261], N[(N[((-z) * b + N[(j * a), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[i, 6e-67], N[(N[((-a) * t + N[(y * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[i, 8e+136], t$95$1, N[(N[((-j) * i + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, j, b \cdot t\right) \cdot i\\
\mathbf{if}\;i \leq -1.1 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -5.8 \cdot 10^{-150}:\\
\;\;\;\;\mathsf{fma}\left(-x, t, j \cdot c\right) \cdot a\\
\mathbf{elif}\;i \leq -3.05 \cdot 10^{-261}:\\
\;\;\;\;\mathsf{fma}\left(-z, b, j \cdot a\right) \cdot c\\
\mathbf{elif}\;i \leq 6 \cdot 10^{-67}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, y \cdot z\right) \cdot x\\
\mathbf{elif}\;i \leq 8 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y\\
\end{array}
\end{array}
if i < -1.09999999999999995e-10 or 6.00000000000000065e-67 < i < 8.00000000000000047e136Initial program 66.1%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6470.5
Applied rewrites70.5%
if -1.09999999999999995e-10 < i < -5.7999999999999996e-150Initial program 90.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6472.0
Applied rewrites72.0%
if -5.7999999999999996e-150 < i < -3.0499999999999999e-261Initial program 68.3%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6474.9
Applied rewrites74.9%
if -3.0499999999999999e-261 < i < 6.00000000000000065e-67Initial program 86.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.1
Applied rewrites40.1%
Taylor expanded in x around 0
Applied rewrites8.6%
Taylor expanded in x around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6462.1
Applied rewrites62.1%
if 8.00000000000000047e136 < i Initial program 45.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6473.4
Applied rewrites73.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- y) j (* b t)) i)))
(if (<= i -0.0028)
t_1
(if (<= i 1.96e-66)
(fma (fma (- a) t (* y z)) x (* (* c a) j))
(if (<= i 8e+136) t_1 (* (fma (- j) i (* z x)) y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-y, j, (b * t)) * i;
double tmp;
if (i <= -0.0028) {
tmp = t_1;
} else if (i <= 1.96e-66) {
tmp = fma(fma(-a, t, (y * z)), x, ((c * a) * j));
} else if (i <= 8e+136) {
tmp = t_1;
} else {
tmp = fma(-j, i, (z * x)) * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-y), j, Float64(b * t)) * i) tmp = 0.0 if (i <= -0.0028) tmp = t_1; elseif (i <= 1.96e-66) tmp = fma(fma(Float64(-a), t, Float64(y * z)), x, Float64(Float64(c * a) * j)); elseif (i <= 8e+136) tmp = t_1; else tmp = Float64(fma(Float64(-j), i, Float64(z * x)) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-y) * j + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -0.0028], t$95$1, If[LessEqual[i, 1.96e-66], N[(N[((-a) * t + N[(y * z), $MachinePrecision]), $MachinePrecision] * x + N[(N[(c * a), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 8e+136], t$95$1, N[(N[((-j) * i + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, j, b \cdot t\right) \cdot i\\
\mathbf{if}\;i \leq -0.0028:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.96 \cdot 10^{-66}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, y \cdot z\right), x, \left(c \cdot a\right) \cdot j\right)\\
\mathbf{elif}\;i \leq 8 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y\\
\end{array}
\end{array}
if i < -0.00279999999999999997 or 1.95999999999999997e-66 < i < 8.00000000000000047e136Initial program 65.8%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6471.2
Applied rewrites71.2%
if -0.00279999999999999997 < i < 1.95999999999999997e-66Initial program 83.9%
Taylor expanded in i around 0
Applied rewrites77.3%
Taylor expanded in b around 0
Applied rewrites67.8%
if 8.00000000000000047e136 < i Initial program 45.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6473.4
Applied rewrites73.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* (- t) a) x)))
(if (<= a -1.25e+38)
t_1
(if (<= a 6e-99)
(* (* (- z) c) b)
(if (<= a 2.6e+110)
(* (* b t) i)
(if (<= a 1.6e+131) (* (* j c) 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 = (-t * a) * x;
double tmp;
if (a <= -1.25e+38) {
tmp = t_1;
} else if (a <= 6e-99) {
tmp = (-z * c) * b;
} else if (a <= 2.6e+110) {
tmp = (b * t) * i;
} else if (a <= 1.6e+131) {
tmp = (j * c) * 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 = (-t * a) * x
if (a <= (-1.25d+38)) then
tmp = t_1
else if (a <= 6d-99) then
tmp = (-z * c) * b
else if (a <= 2.6d+110) then
tmp = (b * t) * i
else if (a <= 1.6d+131) then
tmp = (j * c) * 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 = (-t * a) * x;
double tmp;
if (a <= -1.25e+38) {
tmp = t_1;
} else if (a <= 6e-99) {
tmp = (-z * c) * b;
} else if (a <= 2.6e+110) {
tmp = (b * t) * i;
} else if (a <= 1.6e+131) {
tmp = (j * c) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-t * a) * x tmp = 0 if a <= -1.25e+38: tmp = t_1 elif a <= 6e-99: tmp = (-z * c) * b elif a <= 2.6e+110: tmp = (b * t) * i elif a <= 1.6e+131: tmp = (j * c) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(-t) * a) * x) tmp = 0.0 if (a <= -1.25e+38) tmp = t_1; elseif (a <= 6e-99) tmp = Float64(Float64(Float64(-z) * c) * b); elseif (a <= 2.6e+110) tmp = Float64(Float64(b * t) * i); elseif (a <= 1.6e+131) tmp = Float64(Float64(j * c) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-t * a) * x; tmp = 0.0; if (a <= -1.25e+38) tmp = t_1; elseif (a <= 6e-99) tmp = (-z * c) * b; elseif (a <= 2.6e+110) tmp = (b * t) * i; elseif (a <= 1.6e+131) tmp = (j * c) * 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[((-t) * a), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[a, -1.25e+38], t$95$1, If[LessEqual[a, 6e-99], N[(N[((-z) * c), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[a, 2.6e+110], N[(N[(b * t), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[a, 1.6e+131], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-t\right) \cdot a\right) \cdot x\\
\mathbf{if}\;a \leq -1.25 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-99}:\\
\;\;\;\;\left(\left(-z\right) \cdot c\right) \cdot b\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{+110}:\\
\;\;\;\;\left(b \cdot t\right) \cdot i\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+131}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.24999999999999992e38 or 1.6000000000000001e131 < a Initial program 66.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6458.8
Applied rewrites58.8%
Taylor expanded in x around 0
Applied rewrites24.1%
Taylor expanded in x around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6456.9
Applied rewrites56.9%
Taylor expanded in y around 0
Applied rewrites51.0%
if -1.24999999999999992e38 < a < 6.00000000000000012e-99Initial program 78.6%
Taylor expanded in i around 0
Applied rewrites58.4%
Taylor expanded in b around inf
Applied rewrites33.1%
if 6.00000000000000012e-99 < a < 2.6e110Initial program 67.9%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6454.6
Applied rewrites54.6%
Taylor expanded in y around 0
Applied rewrites37.9%
if 2.6e110 < a < 1.6000000000000001e131Initial program 61.0%
Taylor expanded in i around 0
Applied rewrites79.9%
Taylor expanded in b around 0
Applied rewrites69.9%
Taylor expanded in x around 0
Applied rewrites51.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- x) t (* j c)) a)))
(if (<= a -2.5e+41)
t_1
(if (<= a 1.8e-38)
(* (fma (- j) i (* z x)) y)
(if (<= a 2.35e+110) (* (fma (- a) x (* i b)) t) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-x, t, (j * c)) * a;
double tmp;
if (a <= -2.5e+41) {
tmp = t_1;
} else if (a <= 1.8e-38) {
tmp = fma(-j, i, (z * x)) * y;
} else if (a <= 2.35e+110) {
tmp = fma(-a, x, (i * b)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-x), t, Float64(j * c)) * a) tmp = 0.0 if (a <= -2.5e+41) tmp = t_1; elseif (a <= 1.8e-38) tmp = Float64(fma(Float64(-j), i, Float64(z * x)) * y); elseif (a <= 2.35e+110) tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-x) * t + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -2.5e+41], t$95$1, If[LessEqual[a, 1.8e-38], N[(N[((-j) * i + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[a, 2.35e+110], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-x, t, j \cdot c\right) \cdot a\\
\mathbf{if}\;a \leq -2.5 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y\\
\mathbf{elif}\;a \leq 2.35 \cdot 10^{+110}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.50000000000000011e41 or 2.3499999999999999e110 < a Initial program 65.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6469.8
Applied rewrites69.8%
if -2.50000000000000011e41 < a < 1.8e-38Initial program 76.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6456.1
Applied rewrites56.1%
if 1.8e-38 < a < 2.3499999999999999e110Initial program 69.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6461.2
Applied rewrites61.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- b) c (* y x)) z)))
(if (<= z -1.32e+25)
t_1
(if (<= z -1.4e-200)
(* (fma (- i) y (* c a)) j)
(if (<= z 3.65e+158) (* (fma (- a) x (* i b)) t) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-b, c, (y * x)) * z;
double tmp;
if (z <= -1.32e+25) {
tmp = t_1;
} else if (z <= -1.4e-200) {
tmp = fma(-i, y, (c * a)) * j;
} else if (z <= 3.65e+158) {
tmp = fma(-a, x, (i * b)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-b), c, Float64(y * x)) * z) tmp = 0.0 if (z <= -1.32e+25) tmp = t_1; elseif (z <= -1.4e-200) tmp = Float64(fma(Float64(-i), y, Float64(c * a)) * j); elseif (z <= 3.65e+158) tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-b) * c + N[(y * x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.32e+25], t$95$1, If[LessEqual[z, -1.4e-200], N[(N[((-i) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[z, 3.65e+158], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z\\
\mathbf{if}\;z \leq -1.32 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-200}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{elif}\;z \leq 3.65 \cdot 10^{+158}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.32e25 or 3.65e158 < z Initial program 62.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6474.9
Applied rewrites74.9%
if -1.32e25 < z < -1.40000000000000003e-200Initial program 82.2%
Taylor expanded in a around -inf
Applied rewrites78.6%
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
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6459.4
Applied rewrites59.4%
if -1.40000000000000003e-200 < z < 3.65e158Initial program 72.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6451.0
Applied rewrites51.0%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= y -3900000000000.0) (not (<= y 1.06e+188))) (* (fma (- j) i (* z x)) y) (* (fma (- a) x (* i b)) t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((y <= -3900000000000.0) || !(y <= 1.06e+188)) {
tmp = fma(-j, i, (z * x)) * y;
} else {
tmp = fma(-a, x, (i * b)) * t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((y <= -3900000000000.0) || !(y <= 1.06e+188)) tmp = Float64(fma(Float64(-j), i, Float64(z * x)) * y); else tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[y, -3900000000000.0], N[Not[LessEqual[y, 1.06e+188]], $MachinePrecision]], N[(N[((-j) * i + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3900000000000 \lor \neg \left(y \leq 1.06 \cdot 10^{+188}\right):\\
\;\;\;\;\mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\end{array}
\end{array}
if y < -3.9e12 or 1.06000000000000007e188 < y Initial program 62.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6469.2
Applied rewrites69.2%
if -3.9e12 < y < 1.06000000000000007e188Initial program 76.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6455.1
Applied rewrites55.1%
Final simplification60.7%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= z -1.35e+72) (not (<= z 3.65e+158))) (* (fma (- b) c (* y x)) z) (* (fma (- a) x (* i b)) t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((z <= -1.35e+72) || !(z <= 3.65e+158)) {
tmp = fma(-b, c, (y * x)) * z;
} else {
tmp = fma(-a, x, (i * b)) * t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((z <= -1.35e+72) || !(z <= 3.65e+158)) tmp = Float64(fma(Float64(-b), c, Float64(y * x)) * z); else tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[z, -1.35e+72], N[Not[LessEqual[z, 3.65e+158]], $MachinePrecision]], N[(N[((-b) * c + N[(y * x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+72} \lor \neg \left(z \leq 3.65 \cdot 10^{+158}\right):\\
\;\;\;\;\mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\end{array}
\end{array}
if z < -1.35e72 or 3.65e158 < z Initial program 60.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6479.7
Applied rewrites79.7%
if -1.35e72 < z < 3.65e158Initial program 75.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.9
Applied rewrites49.9%
Final simplification58.8%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= b -6.6e+43) (not (<= b 8500000000000.0))) (* (fma (- a) x (* i b)) t) (* (fma (- a) t (* y z)) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((b <= -6.6e+43) || !(b <= 8500000000000.0)) {
tmp = fma(-a, x, (i * b)) * t;
} else {
tmp = fma(-a, t, (y * z)) * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((b <= -6.6e+43) || !(b <= 8500000000000.0)) tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); else tmp = Float64(fma(Float64(-a), t, Float64(y * z)) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[b, -6.6e+43], N[Not[LessEqual[b, 8500000000000.0]], $MachinePrecision]], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], N[(N[((-a) * t + N[(y * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.6 \cdot 10^{+43} \lor \neg \left(b \leq 8500000000000\right):\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, y \cdot z\right) \cdot x\\
\end{array}
\end{array}
if b < -6.6000000000000003e43 or 8.5e12 < b Initial program 70.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6458.2
Applied rewrites58.2%
if -6.6000000000000003e43 < b < 8.5e12Initial program 71.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6432.3
Applied rewrites32.3%
Taylor expanded in x around 0
Applied rewrites10.7%
Taylor expanded in x around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6451.0
Applied rewrites51.0%
Final simplification54.3%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= x -1.05e-8)
(* (- a) (* x t))
(if (<= x 1.6e-233)
(* (* b t) i)
(if (<= x 1.35e+57) (* (* (- i) y) j) (* (* (- a) x) t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -1.05e-8) {
tmp = -a * (x * t);
} else if (x <= 1.6e-233) {
tmp = (b * t) * i;
} else if (x <= 1.35e+57) {
tmp = (-i * y) * j;
} else {
tmp = (-a * x) * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (x <= (-1.05d-8)) then
tmp = -a * (x * t)
else if (x <= 1.6d-233) then
tmp = (b * t) * i
else if (x <= 1.35d+57) then
tmp = (-i * y) * j
else
tmp = (-a * x) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -1.05e-8) {
tmp = -a * (x * t);
} else if (x <= 1.6e-233) {
tmp = (b * t) * i;
} else if (x <= 1.35e+57) {
tmp = (-i * y) * j;
} else {
tmp = (-a * x) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -1.05e-8: tmp = -a * (x * t) elif x <= 1.6e-233: tmp = (b * t) * i elif x <= 1.35e+57: tmp = (-i * y) * j else: tmp = (-a * x) * t return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -1.05e-8) tmp = Float64(Float64(-a) * Float64(x * t)); elseif (x <= 1.6e-233) tmp = Float64(Float64(b * t) * i); elseif (x <= 1.35e+57) tmp = Float64(Float64(Float64(-i) * y) * j); else tmp = Float64(Float64(Float64(-a) * x) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (x <= -1.05e-8) tmp = -a * (x * t); elseif (x <= 1.6e-233) tmp = (b * t) * i; elseif (x <= 1.35e+57) tmp = (-i * y) * j; else tmp = (-a * x) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -1.05e-8], N[((-a) * N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e-233], N[(N[(b * t), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[x, 1.35e+57], N[(N[((-i) * y), $MachinePrecision] * j), $MachinePrecision], N[(N[((-a) * x), $MachinePrecision] * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-8}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot t\right)\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-233}:\\
\;\;\;\;\left(b \cdot t\right) \cdot i\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+57}:\\
\;\;\;\;\left(\left(-i\right) \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-a\right) \cdot x\right) \cdot t\\
\end{array}
\end{array}
if x < -1.04999999999999997e-8Initial program 66.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.6
Applied rewrites49.6%
Taylor expanded in x around inf
Applied rewrites49.3%
if -1.04999999999999997e-8 < x < 1.5999999999999999e-233Initial program 75.0%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6457.9
Applied rewrites57.9%
Taylor expanded in y around 0
Applied rewrites39.1%
if 1.5999999999999999e-233 < x < 1.3499999999999999e57Initial program 66.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in x around 0
Applied rewrites19.6%
Taylor expanded in j around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6453.0
Applied rewrites53.0%
Taylor expanded in y around inf
Applied rewrites38.4%
if 1.3499999999999999e57 < x Initial program 76.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6446.4
Applied rewrites46.4%
Taylor expanded in x around inf
Applied rewrites37.6%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= x -1.05e-8)
(* (- a) (* x t))
(if (<= x 3.8e-218)
(* (* b t) i)
(if (<= x 4.5e-23) (* (* j c) a) (* (* (- a) x) t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -1.05e-8) {
tmp = -a * (x * t);
} else if (x <= 3.8e-218) {
tmp = (b * t) * i;
} else if (x <= 4.5e-23) {
tmp = (j * c) * a;
} else {
tmp = (-a * x) * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (x <= (-1.05d-8)) then
tmp = -a * (x * t)
else if (x <= 3.8d-218) then
tmp = (b * t) * i
else if (x <= 4.5d-23) then
tmp = (j * c) * a
else
tmp = (-a * x) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -1.05e-8) {
tmp = -a * (x * t);
} else if (x <= 3.8e-218) {
tmp = (b * t) * i;
} else if (x <= 4.5e-23) {
tmp = (j * c) * a;
} else {
tmp = (-a * x) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -1.05e-8: tmp = -a * (x * t) elif x <= 3.8e-218: tmp = (b * t) * i elif x <= 4.5e-23: tmp = (j * c) * a else: tmp = (-a * x) * t return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -1.05e-8) tmp = Float64(Float64(-a) * Float64(x * t)); elseif (x <= 3.8e-218) tmp = Float64(Float64(b * t) * i); elseif (x <= 4.5e-23) tmp = Float64(Float64(j * c) * a); else tmp = Float64(Float64(Float64(-a) * x) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (x <= -1.05e-8) tmp = -a * (x * t); elseif (x <= 3.8e-218) tmp = (b * t) * i; elseif (x <= 4.5e-23) tmp = (j * c) * a; else tmp = (-a * x) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -1.05e-8], N[((-a) * N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e-218], N[(N[(b * t), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[x, 4.5e-23], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], N[(N[((-a) * x), $MachinePrecision] * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-8}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot t\right)\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-218}:\\
\;\;\;\;\left(b \cdot t\right) \cdot i\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-23}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-a\right) \cdot x\right) \cdot t\\
\end{array}
\end{array}
if x < -1.04999999999999997e-8Initial program 66.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.6
Applied rewrites49.6%
Taylor expanded in x around inf
Applied rewrites49.3%
if -1.04999999999999997e-8 < x < 3.7999999999999999e-218Initial program 73.7%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6458.9
Applied rewrites58.9%
Taylor expanded in y around 0
Applied rewrites39.6%
if 3.7999999999999999e-218 < x < 4.49999999999999975e-23Initial program 71.6%
Taylor expanded in i around 0
Applied rewrites62.0%
Taylor expanded in b around 0
Applied rewrites54.8%
Taylor expanded in x around 0
Applied rewrites41.6%
if 4.49999999999999975e-23 < x Initial program 72.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6443.2
Applied rewrites43.2%
Taylor expanded in x around inf
Applied rewrites33.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- a) (* x t))))
(if (<= x -1.05e-8)
t_1
(if (<= x 3.8e-218)
(* (* b t) i)
(if (<= x 4.5e-23) (* (* j c) 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 = -a * (x * t);
double tmp;
if (x <= -1.05e-8) {
tmp = t_1;
} else if (x <= 3.8e-218) {
tmp = (b * t) * i;
} else if (x <= 4.5e-23) {
tmp = (j * c) * 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 = -a * (x * t)
if (x <= (-1.05d-8)) then
tmp = t_1
else if (x <= 3.8d-218) then
tmp = (b * t) * i
else if (x <= 4.5d-23) then
tmp = (j * c) * 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 = -a * (x * t);
double tmp;
if (x <= -1.05e-8) {
tmp = t_1;
} else if (x <= 3.8e-218) {
tmp = (b * t) * i;
} else if (x <= 4.5e-23) {
tmp = (j * c) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = -a * (x * t) tmp = 0 if x <= -1.05e-8: tmp = t_1 elif x <= 3.8e-218: tmp = (b * t) * i elif x <= 4.5e-23: tmp = (j * c) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-a) * Float64(x * t)) tmp = 0.0 if (x <= -1.05e-8) tmp = t_1; elseif (x <= 3.8e-218) tmp = Float64(Float64(b * t) * i); elseif (x <= 4.5e-23) tmp = Float64(Float64(j * c) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = -a * (x * t); tmp = 0.0; if (x <= -1.05e-8) tmp = t_1; elseif (x <= 3.8e-218) tmp = (b * t) * i; elseif (x <= 4.5e-23) tmp = (j * c) * 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[((-a) * N[(x * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e-8], t$95$1, If[LessEqual[x, 3.8e-218], N[(N[(b * t), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[x, 4.5e-23], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-a\right) \cdot \left(x \cdot t\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-218}:\\
\;\;\;\;\left(b \cdot t\right) \cdot i\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-23}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.04999999999999997e-8 or 4.49999999999999975e-23 < x Initial program 69.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6446.4
Applied rewrites46.4%
Taylor expanded in x around inf
Applied rewrites39.9%
if -1.04999999999999997e-8 < x < 3.7999999999999999e-218Initial program 73.7%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6458.9
Applied rewrites58.9%
Taylor expanded in y around 0
Applied rewrites39.6%
if 3.7999999999999999e-218 < x < 4.49999999999999975e-23Initial program 71.6%
Taylor expanded in i around 0
Applied rewrites62.0%
Taylor expanded in b around 0
Applied rewrites54.8%
Taylor expanded in x around 0
Applied rewrites41.6%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= j -2.2e+63) (* (* (- i) y) j) (if (<= j 1.1e+192) (* (fma (- a) t (* y z)) x) (* (* (- j) y) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -2.2e+63) {
tmp = (-i * y) * j;
} else if (j <= 1.1e+192) {
tmp = fma(-a, t, (y * z)) * x;
} else {
tmp = (-j * y) * i;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -2.2e+63) tmp = Float64(Float64(Float64(-i) * y) * j); elseif (j <= 1.1e+192) tmp = Float64(fma(Float64(-a), t, Float64(y * z)) * x); else tmp = Float64(Float64(Float64(-j) * y) * i); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -2.2e+63], N[(N[((-i) * y), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[j, 1.1e+192], N[(N[((-a) * t + N[(y * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[((-j) * y), $MachinePrecision] * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -2.2 \cdot 10^{+63}:\\
\;\;\;\;\left(\left(-i\right) \cdot y\right) \cdot j\\
\mathbf{elif}\;j \leq 1.1 \cdot 10^{+192}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, y \cdot z\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-j\right) \cdot y\right) \cdot i\\
\end{array}
\end{array}
if j < -2.1999999999999999e63Initial program 69.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6423.1
Applied rewrites23.1%
Taylor expanded in x around 0
Applied rewrites10.4%
Taylor expanded in j around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6478.6
Applied rewrites78.6%
Taylor expanded in y around inf
Applied rewrites51.5%
if -2.1999999999999999e63 < j < 1.1e192Initial program 72.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.5
Applied rewrites49.5%
Taylor expanded in x around 0
Applied rewrites28.2%
Taylor expanded in x around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6451.1
Applied rewrites51.1%
if 1.1e192 < j Initial program 59.0%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6473.0
Applied rewrites73.0%
Taylor expanded in y around inf
Applied rewrites59.6%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= j -6.5e+24) (not (<= j 6.2e+99))) (* (* j c) a) (* (* i t) b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((j <= -6.5e+24) || !(j <= 6.2e+99)) {
tmp = (j * c) * a;
} else {
tmp = (i * t) * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if ((j <= (-6.5d+24)) .or. (.not. (j <= 6.2d+99))) then
tmp = (j * c) * a
else
tmp = (i * t) * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((j <= -6.5e+24) || !(j <= 6.2e+99)) {
tmp = (j * c) * a;
} else {
tmp = (i * t) * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (j <= -6.5e+24) or not (j <= 6.2e+99): tmp = (j * c) * a else: tmp = (i * t) * b return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((j <= -6.5e+24) || !(j <= 6.2e+99)) tmp = Float64(Float64(j * c) * a); else tmp = Float64(Float64(i * t) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((j <= -6.5e+24) || ~((j <= 6.2e+99))) tmp = (j * c) * a; else tmp = (i * t) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[j, -6.5e+24], N[Not[LessEqual[j, 6.2e+99]], $MachinePrecision]], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -6.5 \cdot 10^{+24} \lor \neg \left(j \leq 6.2 \cdot 10^{+99}\right):\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\end{array}
\end{array}
if j < -6.4999999999999996e24 or 6.2000000000000001e99 < j Initial program 70.1%
Taylor expanded in i around 0
Applied rewrites46.8%
Taylor expanded in b around 0
Applied rewrites48.6%
Taylor expanded in x around 0
Applied rewrites37.1%
if -6.4999999999999996e24 < j < 6.2000000000000001e99Initial program 71.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6454.0
Applied rewrites54.0%
Taylor expanded in x around 0
Applied rewrites30.9%
Final simplification33.3%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= i -2.5e-26) (* (* i t) b) (if (<= i 2.25e-82) (* (* c a) j) (* (* i b) t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -2.5e-26) {
tmp = (i * t) * b;
} else if (i <= 2.25e-82) {
tmp = (c * a) * j;
} else {
tmp = (i * b) * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (i <= (-2.5d-26)) then
tmp = (i * t) * b
else if (i <= 2.25d-82) then
tmp = (c * a) * j
else
tmp = (i * b) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -2.5e-26) {
tmp = (i * t) * b;
} else if (i <= 2.25e-82) {
tmp = (c * a) * j;
} else {
tmp = (i * b) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if i <= -2.5e-26: tmp = (i * t) * b elif i <= 2.25e-82: tmp = (c * a) * j else: tmp = (i * b) * t return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -2.5e-26) tmp = Float64(Float64(i * t) * b); elseif (i <= 2.25e-82) tmp = Float64(Float64(c * a) * j); else tmp = Float64(Float64(i * b) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (i <= -2.5e-26) tmp = (i * t) * b; elseif (i <= 2.25e-82) tmp = (c * a) * j; else tmp = (i * b) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -2.5e-26], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[i, 2.25e-82], N[(N[(c * a), $MachinePrecision] * j), $MachinePrecision], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.5 \cdot 10^{-26}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;i \leq 2.25 \cdot 10^{-82}:\\
\;\;\;\;\left(c \cdot a\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\end{array}
\end{array}
if i < -2.5000000000000001e-26Initial program 63.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6457.5
Applied rewrites57.5%
Taylor expanded in x around 0
Applied rewrites39.9%
if -2.5000000000000001e-26 < i < 2.2499999999999999e-82Initial program 82.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6432.0
Applied rewrites32.0%
Taylor expanded in x around 0
Applied rewrites8.2%
Taylor expanded in j around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6435.0
Applied rewrites35.0%
Taylor expanded in y around 0
Applied rewrites28.8%
if 2.2499999999999999e-82 < i Initial program 60.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.9
Applied rewrites49.9%
Taylor expanded in x around 0
Applied rewrites36.0%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= i -2.5e-26) (* (* i t) b) (if (<= i 2.25e-82) (* (* j c) a) (* (* i b) t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -2.5e-26) {
tmp = (i * t) * b;
} else if (i <= 2.25e-82) {
tmp = (j * c) * a;
} else {
tmp = (i * b) * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (i <= (-2.5d-26)) then
tmp = (i * t) * b
else if (i <= 2.25d-82) then
tmp = (j * c) * a
else
tmp = (i * b) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -2.5e-26) {
tmp = (i * t) * b;
} else if (i <= 2.25e-82) {
tmp = (j * c) * a;
} else {
tmp = (i * b) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if i <= -2.5e-26: tmp = (i * t) * b elif i <= 2.25e-82: tmp = (j * c) * a else: tmp = (i * b) * t return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -2.5e-26) tmp = Float64(Float64(i * t) * b); elseif (i <= 2.25e-82) tmp = Float64(Float64(j * c) * a); else tmp = Float64(Float64(i * b) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (i <= -2.5e-26) tmp = (i * t) * b; elseif (i <= 2.25e-82) tmp = (j * c) * a; else tmp = (i * b) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -2.5e-26], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[i, 2.25e-82], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.5 \cdot 10^{-26}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;i \leq 2.25 \cdot 10^{-82}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\end{array}
\end{array}
if i < -2.5000000000000001e-26Initial program 63.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6457.5
Applied rewrites57.5%
Taylor expanded in x around 0
Applied rewrites39.9%
if -2.5000000000000001e-26 < i < 2.2499999999999999e-82Initial program 82.9%
Taylor expanded in i around 0
Applied rewrites76.8%
Taylor expanded in b around 0
Applied rewrites65.8%
Taylor expanded in x around 0
Applied rewrites28.7%
if 2.2499999999999999e-82 < i Initial program 60.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.9
Applied rewrites49.9%
Taylor expanded in x around 0
Applied rewrites36.0%
(FPCore (x y z t a b c i j) :precision binary64 (* (* i t) b))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (i * t) * b;
}
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 * t) * b
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 * t) * b;
}
def code(x, y, z, t, a, b, c, i, j): return (i * t) * b
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(i * t) * b) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (i * t) * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]
\begin{array}{l}
\\
\left(i \cdot t\right) \cdot b
\end{array}
Initial program 70.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6444.2
Applied rewrites44.2%
Taylor expanded in x around 0
Applied rewrites24.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c a) (* y i))))
(t_2
(+
(-
(* x (- (* y z) (* t a)))
(/
(* b (- (pow (* c z) 2.0) (pow (* t i) 2.0)))
(+ (* c z) (* t i))))
t_1)))
(if (< x -1.469694296777705e-64)
t_2
(if (< x 3.2113527362226803e-147)
(- (* (- (* b i) (* x a)) t) (- (* z (* c b)) t_1))
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * a) - (y * i));
double t_2 = ((x * ((y * z) - (t * a))) - ((b * (pow((c * z), 2.0) - pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1;
double tmp;
if (x < -1.469694296777705e-64) {
tmp = t_2;
} else if (x < 3.2113527362226803e-147) {
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - 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 = j * ((c * a) - (y * i))
t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ** 2.0d0) - ((t * i) ** 2.0d0))) / ((c * z) + (t * i)))) + t_1
if (x < (-1.469694296777705d-64)) then
tmp = t_2
else if (x < 3.2113527362226803d-147) then
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - 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 = j * ((c * a) - (y * i));
double t_2 = ((x * ((y * z) - (t * a))) - ((b * (Math.pow((c * z), 2.0) - Math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1;
double tmp;
if (x < -1.469694296777705e-64) {
tmp = t_2;
} else if (x < 3.2113527362226803e-147) {
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((c * a) - (y * i)) t_2 = ((x * ((y * z) - (t * a))) - ((b * (math.pow((c * z), 2.0) - math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1 tmp = 0 if x < -1.469694296777705e-64: tmp = t_2 elif x < 3.2113527362226803e-147: tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(c * a) - Float64(y * i))) t_2 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(Float64(b * Float64((Float64(c * z) ^ 2.0) - (Float64(t * i) ^ 2.0))) / Float64(Float64(c * z) + Float64(t * i)))) + t_1) tmp = 0.0 if (x < -1.469694296777705e-64) tmp = t_2; elseif (x < 3.2113527362226803e-147) tmp = Float64(Float64(Float64(Float64(b * i) - Float64(x * a)) * t) - Float64(Float64(z * Float64(c * b)) - 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 = j * ((c * a) - (y * i)); t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ^ 2.0) - ((t * i) ^ 2.0))) / ((c * z) + (t * i)))) + t_1; tmp = 0.0; if (x < -1.469694296777705e-64) tmp = t_2; elseif (x < 3.2113527362226803e-147) tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - 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[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[Power[N[(c * z), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(t * i), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * z), $MachinePrecision] + N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[Less[x, -1.469694296777705e-64], t$95$2, If[Less[x, 3.2113527362226803e-147], N[(N[(N[(N[(b * i), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] - N[(N[(z * N[(c * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot a - y \cdot i\right)\\
t_2 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left({\left(c \cdot z\right)}^{2} - {\left(t \cdot i\right)}^{2}\right)}{c \cdot z + t \cdot i}\right) + t\_1\\
\mathbf{if}\;x < -1.469694296777705 \cdot 10^{-64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x < 3.2113527362226803 \cdot 10^{-147}:\\
\;\;\;\;\left(b \cdot i - x \cdot a\right) \cdot t - \left(z \cdot \left(c \cdot b\right) - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024364
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
:alt
(! :herbie-platform default (if (< x -293938859355541/2000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))) (if (< x 32113527362226803/10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (- (* b i) (* x a)) t) (- (* z (* c b)) (* j (- (* c a) (* y i))))) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))