
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * 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)
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
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
Herbie found 29 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * 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)
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
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (fma (- (+ t y) 2.0) b (- x (fma (- t 1.0) a (* (- y 1.0) z)))))
double code(double x, double y, double z, double t, double a, double b) {
return fma(((t + y) - 2.0), b, (x - fma((t - 1.0), a, ((y - 1.0) * z))));
}
function code(x, y, z, t, a, b) return fma(Float64(Float64(t + y) - 2.0), b, Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z)))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\left(t + y\right) - 2, b, x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\right)
\end{array}
Initial program 95.1%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites97.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (fma (- 1.0 t) a (* (- (+ y t) 2.0) b)) x))
(t_2 (* (- y 1.0) z)))
(if (<= t -5.2e+128)
t_1
(if (<= t -1.46e-9)
(fma y b (- x (fma (- t 1.0) a t_2)))
(if (<= t 7.2e-7) (- (- (fma (- y 2.0) b x) (- a)) t_2) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - t), a, (((y + t) - 2.0) * b)) + x;
double t_2 = (y - 1.0) * z;
double tmp;
if (t <= -5.2e+128) {
tmp = t_1;
} else if (t <= -1.46e-9) {
tmp = fma(y, b, (x - fma((t - 1.0), a, t_2)));
} else if (t <= 7.2e-7) {
tmp = (fma((y - 2.0), b, x) - -a) - t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(1.0 - t), a, Float64(Float64(Float64(y + t) - 2.0) * b)) + x) t_2 = Float64(Float64(y - 1.0) * z) tmp = 0.0 if (t <= -5.2e+128) tmp = t_1; elseif (t <= -1.46e-9) tmp = fma(y, b, Float64(x - fma(Float64(t - 1.0), a, t_2))); elseif (t <= 7.2e-7) tmp = Float64(Float64(fma(Float64(y - 2.0), b, x) - Float64(-a)) - t_2); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t, -5.2e+128], t$95$1, If[LessEqual[t, -1.46e-9], N[(y * b + N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-7], N[(N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - (-a)), $MachinePrecision] - t$95$2), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - t, a, \left(\left(y + t\right) - 2\right) \cdot b\right) + x\\
t_2 := \left(y - 1\right) \cdot z\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.46 \cdot 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x - \mathsf{fma}\left(t - 1, a, t\_2\right)\right)\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-7}:\\
\;\;\;\;\left(\mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right)\right) - t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.2e128 or 7.19999999999999989e-7 < t Initial program 91.1%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6476.9
Applied rewrites76.9%
Taylor expanded in a around 0
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6479.6
Applied rewrites79.6%
if -5.2e128 < t < -1.4599999999999999e-9Initial program 97.3%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites98.5%
Taylor expanded in y around inf
+-commutative81.1
Applied rewrites81.1%
if -1.4599999999999999e-9 < t < 7.19999999999999989e-7Initial program 98.0%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites98.9%
lift-fma.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate--r+N/A
Applied rewrites98.0%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6497.8
Applied rewrites97.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (fma (- 1.0 t) a (* (- (+ y t) 2.0) b)) x)))
(if (<= t -7e+85)
t_1
(if (<= t 7.2e-7)
(- (- (fma (- y 2.0) b x) (- a)) (* (- y 1.0) z))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - t), a, (((y + t) - 2.0) * b)) + x;
double tmp;
if (t <= -7e+85) {
tmp = t_1;
} else if (t <= 7.2e-7) {
tmp = (fma((y - 2.0), b, x) - -a) - ((y - 1.0) * z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(1.0 - t), a, Float64(Float64(Float64(y + t) - 2.0) * b)) + x) tmp = 0.0 if (t <= -7e+85) tmp = t_1; elseif (t <= 7.2e-7) tmp = Float64(Float64(fma(Float64(y - 2.0), b, x) - Float64(-a)) - Float64(Float64(y - 1.0) * z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -7e+85], t$95$1, If[LessEqual[t, 7.2e-7], N[(N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - (-a)), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - t, a, \left(\left(y + t\right) - 2\right) \cdot b\right) + x\\
\mathbf{if}\;t \leq -7 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-7}:\\
\;\;\;\;\left(\mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right)\right) - \left(y - 1\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.0000000000000001e85 or 7.19999999999999989e-7 < t Initial program 91.5%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6477.0
Applied rewrites77.0%
Taylor expanded in a around 0
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6479.6
Applied rewrites79.6%
if -7.0000000000000001e85 < t < 7.19999999999999989e-7Initial program 98.0%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites99.0%
lift-fma.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate--r+N/A
Applied rewrites98.0%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6493.1
Applied rewrites93.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (fma (- 1.0 t) a (* (- (+ y t) 2.0) b)) x)))
(if (<= t -7e+85)
t_1
(if (<= t 7.2e-7) (- (fma (- y 2.0) b x) (fma (- y 1.0) z (- a))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - t), a, (((y + t) - 2.0) * b)) + x;
double tmp;
if (t <= -7e+85) {
tmp = t_1;
} else if (t <= 7.2e-7) {
tmp = fma((y - 2.0), b, x) - fma((y - 1.0), z, -a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(1.0 - t), a, Float64(Float64(Float64(y + t) - 2.0) * b)) + x) tmp = 0.0 if (t <= -7e+85) tmp = t_1; elseif (t <= 7.2e-7) tmp = Float64(fma(Float64(y - 2.0), b, x) - fma(Float64(y - 1.0), z, Float64(-a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -7e+85], t$95$1, If[LessEqual[t, 7.2e-7], N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z + (-a)), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - t, a, \left(\left(y + t\right) - 2\right) \cdot b\right) + x\\
\mathbf{if}\;t \leq -7 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) - \mathsf{fma}\left(y - 1, z, -a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.0000000000000001e85 or 7.19999999999999989e-7 < t Initial program 91.5%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6477.0
Applied rewrites77.0%
Taylor expanded in a around 0
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6479.6
Applied rewrites79.6%
if -7.0000000000000001e85 < t < 7.19999999999999989e-7Initial program 98.0%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6493.1
Applied rewrites93.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (fma (- t 1.0) a (* (- y 1.0) z)))))
(if (<= z -2.2e+51)
t_1
(if (<= z 4.8e+86) (+ (fma (- 1.0 t) a (* (- (+ y t) 2.0) b)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - fma((t - 1.0), a, ((y - 1.0) * z));
double tmp;
if (z <= -2.2e+51) {
tmp = t_1;
} else if (z <= 4.8e+86) {
tmp = fma((1.0 - t), a, (((y + t) - 2.0) * b)) + x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))) tmp = 0.0 if (z <= -2.2e+51) tmp = t_1; elseif (z <= 4.8e+86) tmp = Float64(fma(Float64(1.0 - t), a, Float64(Float64(Float64(y + t) - 2.0) * b)) + x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+51], t$95$1, If[LessEqual[z, 4.8e+86], N[(N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \left(\left(y + t\right) - 2\right) \cdot b\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.19999999999999992e51 or 4.8000000000000001e86 < z Initial program 91.8%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6480.9
Applied rewrites80.9%
if -2.19999999999999992e51 < z < 4.8000000000000001e86Initial program 97.2%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6489.7
Applied rewrites89.7%
Taylor expanded in a around 0
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6490.8
Applied rewrites90.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (fma (- t 1.0) a (* (- y 1.0) z)))))
(if (<= z -2.2e+51)
t_1
(if (<= z 4.8e+86) (- (fma (- (+ t y) 2.0) b x) (* (- t 1.0) a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - fma((t - 1.0), a, ((y - 1.0) * z));
double tmp;
if (z <= -2.2e+51) {
tmp = t_1;
} else if (z <= 4.8e+86) {
tmp = fma(((t + y) - 2.0), b, x) - ((t - 1.0) * a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))) tmp = 0.0 if (z <= -2.2e+51) tmp = t_1; elseif (z <= 4.8e+86) tmp = Float64(fma(Float64(Float64(t + y) - 2.0), b, x) - Float64(Float64(t - 1.0) * a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+51], t$95$1, If[LessEqual[z, 4.8e+86], N[(N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.19999999999999992e51 or 4.8000000000000001e86 < z Initial program 91.8%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6480.9
Applied rewrites80.9%
if -2.19999999999999992e51 < z < 4.8000000000000001e86Initial program 97.2%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6489.7
Applied rewrites89.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- (+ t y) 2.0) b (* (- 1.0 y) z))))
(if (<= b -2e+78)
t_1
(if (<= b 6.4e+83) (- x (fma (- t 1.0) a (* (- y 1.0) z))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((t + y) - 2.0), b, ((1.0 - y) * z));
double tmp;
if (b <= -2e+78) {
tmp = t_1;
} else if (b <= 6.4e+83) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(t + y) - 2.0), b, Float64(Float64(1.0 - y) * z)) tmp = 0.0 if (b <= -2e+78) tmp = t_1; elseif (b <= 6.4e+83) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2e+78], t$95$1, If[LessEqual[b, 6.4e+83], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, \left(1 - y\right) \cdot z\right)\\
\mathbf{if}\;b \leq -2 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6.4 \cdot 10^{+83}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.00000000000000002e78 or 6.3999999999999998e83 < b Initial program 89.6%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites94.4%
Taylor expanded in z around inf
+-commutativeN/A
associate--l-N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6480.9
Applied rewrites80.9%
if -2.00000000000000002e78 < b < 6.3999999999999998e83Initial program 98.3%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6486.5
Applied rewrites86.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ t y) 2.0)))
(if (<= b -3.9e+88)
(fma t_1 b z)
(if (<= b 2.4e+85)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(fma t_1 b (* (- y) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) - 2.0;
double tmp;
if (b <= -3.9e+88) {
tmp = fma(t_1, b, z);
} else if (b <= 2.4e+85) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = fma(t_1, b, (-y * z));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) tmp = 0.0 if (b <= -3.9e+88) tmp = fma(t_1, b, z); elseif (b <= 2.4e+85) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = fma(t_1, b, Float64(Float64(-y) * z)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[b, -3.9e+88], N[(t$95$1 * b + z), $MachinePrecision], If[LessEqual[b, 2.4e+85], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * b + N[((-y) * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
\mathbf{if}\;b \leq -3.9 \cdot 10^{+88}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, z\right)\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{+85}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, \left(-y\right) \cdot z\right)\\
\end{array}
\end{array}
if b < -3.9000000000000001e88Initial program 89.8%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites94.9%
Taylor expanded in z around inf
+-commutativeN/A
associate--l-N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6481.6
Applied rewrites81.6%
Taylor expanded in y around 0
Applied rewrites79.2%
if -3.9000000000000001e88 < b < 2.39999999999999997e85Initial program 98.3%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6486.1
Applied rewrites86.1%
if 2.39999999999999997e85 < b Initial program 89.2%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites93.7%
Taylor expanded in y around inf
+-commutativeN/A
associate--l-N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ t y) 2.0)))
(if (<= b -2.2e+23)
(fma t_1 b z)
(if (<= b 3.6e-108)
(- (* (- 1.0 t) a) (* (- y 1.0) z))
(if (<= b 2.6e+62) (- x (* (- t 1.0) a)) (fma t_1 b (* (- y) z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) - 2.0;
double tmp;
if (b <= -2.2e+23) {
tmp = fma(t_1, b, z);
} else if (b <= 3.6e-108) {
tmp = ((1.0 - t) * a) - ((y - 1.0) * z);
} else if (b <= 2.6e+62) {
tmp = x - ((t - 1.0) * a);
} else {
tmp = fma(t_1, b, (-y * z));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) tmp = 0.0 if (b <= -2.2e+23) tmp = fma(t_1, b, z); elseif (b <= 3.6e-108) tmp = Float64(Float64(Float64(1.0 - t) * a) - Float64(Float64(y - 1.0) * z)); elseif (b <= 2.6e+62) tmp = Float64(x - Float64(Float64(t - 1.0) * a)); else tmp = fma(t_1, b, Float64(Float64(-y) * z)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[b, -2.2e+23], N[(t$95$1 * b + z), $MachinePrecision], If[LessEqual[b, 3.6e-108], N[(N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.6e+62], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * b + N[((-y) * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
\mathbf{if}\;b \leq -2.2 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, z\right)\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{-108}:\\
\;\;\;\;\left(1 - t\right) \cdot a - \left(y - 1\right) \cdot z\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{+62}:\\
\;\;\;\;x - \left(t - 1\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, \left(-y\right) \cdot z\right)\\
\end{array}
\end{array}
if b < -2.20000000000000008e23Initial program 90.5%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites95.9%
Taylor expanded in z around inf
+-commutativeN/A
associate--l-N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6476.8
Applied rewrites76.8%
Taylor expanded in y around 0
Applied rewrites71.6%
if -2.20000000000000008e23 < b < 3.6000000000000001e-108Initial program 99.2%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites99.6%
lift-fma.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate--r+N/A
Applied rewrites99.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.7
Applied rewrites71.7%
if 3.6000000000000001e-108 < b < 2.59999999999999984e62Initial program 98.2%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6469.6
Applied rewrites69.6%
Taylor expanded in x around inf
Applied rewrites47.5%
if 2.59999999999999984e62 < b Initial program 89.6%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites94.1%
Taylor expanded in y around inf
+-commutativeN/A
associate--l-N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6475.8
Applied rewrites75.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- (+ t y) 2.0) b z)))
(if (<= b -2.2e+23)
t_1
(if (<= b 3.6e-108)
(- (* (- 1.0 t) a) (* (- y 1.0) z))
(if (<= b 6.6e+75) (- x (* (- t 1.0) a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((t + y) - 2.0), b, z);
double tmp;
if (b <= -2.2e+23) {
tmp = t_1;
} else if (b <= 3.6e-108) {
tmp = ((1.0 - t) * a) - ((y - 1.0) * z);
} else if (b <= 6.6e+75) {
tmp = x - ((t - 1.0) * a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(t + y) - 2.0), b, z) tmp = 0.0 if (b <= -2.2e+23) tmp = t_1; elseif (b <= 3.6e-108) tmp = Float64(Float64(Float64(1.0 - t) * a) - Float64(Float64(y - 1.0) * z)); elseif (b <= 6.6e+75) tmp = Float64(x - Float64(Float64(t - 1.0) * a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + z), $MachinePrecision]}, If[LessEqual[b, -2.2e+23], t$95$1, If[LessEqual[b, 3.6e-108], N[(N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.6e+75], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, z\right)\\
\mathbf{if}\;b \leq -2.2 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{-108}:\\
\;\;\;\;\left(1 - t\right) \cdot a - \left(y - 1\right) \cdot z\\
\mathbf{elif}\;b \leq 6.6 \cdot 10^{+75}:\\
\;\;\;\;x - \left(t - 1\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.20000000000000008e23 or 6.59999999999999996e75 < b Initial program 90.0%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites95.0%
Taylor expanded in z around inf
+-commutativeN/A
associate--l-N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6478.6
Applied rewrites78.6%
Taylor expanded in y around 0
Applied rewrites74.8%
if -2.20000000000000008e23 < b < 3.6000000000000001e-108Initial program 99.2%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites99.6%
lift-fma.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate--r+N/A
Applied rewrites99.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.7
Applied rewrites71.7%
if 3.6000000000000001e-108 < b < 6.59999999999999996e75Initial program 98.1%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6469.9
Applied rewrites69.9%
Taylor expanded in x around inf
Applied rewrites46.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- (+ t y) 2.0) b x)))
(if (<= b -130000000.0)
t_1
(if (<= b -4.1e-302)
(- x (* (- y 1.0) z))
(if (<= b 2.1e+75) (- x (* (- t 1.0) a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((t + y) - 2.0), b, x);
double tmp;
if (b <= -130000000.0) {
tmp = t_1;
} else if (b <= -4.1e-302) {
tmp = x - ((y - 1.0) * z);
} else if (b <= 2.1e+75) {
tmp = x - ((t - 1.0) * a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(t + y) - 2.0), b, x) tmp = 0.0 if (b <= -130000000.0) tmp = t_1; elseif (b <= -4.1e-302) tmp = Float64(x - Float64(Float64(y - 1.0) * z)); elseif (b <= 2.1e+75) tmp = Float64(x - Float64(Float64(t - 1.0) * a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]}, If[LessEqual[b, -130000000.0], t$95$1, If[LessEqual[b, -4.1e-302], N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.1e+75], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\\
\mathbf{if}\;b \leq -130000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -4.1 \cdot 10^{-302}:\\
\;\;\;\;x - \left(y - 1\right) \cdot z\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+75}:\\
\;\;\;\;x - \left(t - 1\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.3e8 or 2.09999999999999999e75 < b Initial program 90.2%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites95.1%
Taylor expanded in x around inf
+-commutative75.6
associate--l-75.6
Applied rewrites75.6%
if -1.3e8 < b < -4.0999999999999998e-302Initial program 99.1%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites99.5%
lift-fma.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate--r+N/A
Applied rewrites99.1%
Taylor expanded in x around inf
Applied rewrites58.2%
if -4.0999999999999998e-302 < b < 2.09999999999999999e75Initial program 98.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.3
Applied rewrites66.3%
Taylor expanded in x around inf
Applied rewrites53.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma (- (+ t y) 2.0) b z))) (if (<= b -4.3e-75) t_1 (if (<= b 6.6e+75) (- x (* (- t 1.0) a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((t + y) - 2.0), b, z);
double tmp;
if (b <= -4.3e-75) {
tmp = t_1;
} else if (b <= 6.6e+75) {
tmp = x - ((t - 1.0) * a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(t + y) - 2.0), b, z) tmp = 0.0 if (b <= -4.3e-75) tmp = t_1; elseif (b <= 6.6e+75) tmp = Float64(x - Float64(Float64(t - 1.0) * a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + z), $MachinePrecision]}, If[LessEqual[b, -4.3e-75], t$95$1, If[LessEqual[b, 6.6e+75], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, z\right)\\
\mathbf{if}\;b \leq -4.3 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6.6 \cdot 10^{+75}:\\
\;\;\;\;x - \left(t - 1\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -4.2999999999999999e-75 or 6.59999999999999996e75 < b Initial program 91.3%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites95.7%
Taylor expanded in z around inf
+-commutativeN/A
associate--l-N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6474.7
Applied rewrites74.7%
Taylor expanded in y around 0
Applied rewrites68.6%
if -4.2999999999999999e-75 < b < 6.59999999999999996e75Initial program 98.9%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6465.0
Applied rewrites65.0%
Taylor expanded in x around inf
Applied rewrites55.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (* (- y 1.0) z))) (t_2 (* (- b a) t)))
(if (<= t -7e+85)
t_2
(if (<= t -3.3e-134)
t_1
(if (<= t 4.2e-174)
(+ (fma -2.0 b x) a)
(if (<= t 1.2e-48)
t_1
(if (<= t 270000000.0) (fma (- y 2.0) b a) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - ((y - 1.0) * z);
double t_2 = (b - a) * t;
double tmp;
if (t <= -7e+85) {
tmp = t_2;
} else if (t <= -3.3e-134) {
tmp = t_1;
} else if (t <= 4.2e-174) {
tmp = fma(-2.0, b, x) + a;
} else if (t <= 1.2e-48) {
tmp = t_1;
} else if (t <= 270000000.0) {
tmp = fma((y - 2.0), b, a);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x - Float64(Float64(y - 1.0) * z)) t_2 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -7e+85) tmp = t_2; elseif (t <= -3.3e-134) tmp = t_1; elseif (t <= 4.2e-174) tmp = Float64(fma(-2.0, b, x) + a); elseif (t <= 1.2e-48) tmp = t_1; elseif (t <= 270000000.0) tmp = fma(Float64(y - 2.0), b, a); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -7e+85], t$95$2, If[LessEqual[t, -3.3e-134], t$95$1, If[LessEqual[t, 4.2e-174], N[(N[(-2.0 * b + x), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t, 1.2e-48], t$95$1, If[LessEqual[t, 270000000.0], N[(N[(y - 2.0), $MachinePrecision] * b + a), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \left(y - 1\right) \cdot z\\
t_2 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -7 \cdot 10^{+85}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -3.3 \cdot 10^{-134}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-174}:\\
\;\;\;\;\mathsf{fma}\left(-2, b, x\right) + a\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 270000000:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -7.0000000000000001e85 or 2.7e8 < t Initial program 91.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6467.5
Applied rewrites67.5%
if -7.0000000000000001e85 < t < -3.30000000000000019e-134 or 4.20000000000000021e-174 < t < 1.2e-48Initial program 98.0%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites98.9%
lift-fma.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate--r+N/A
Applied rewrites98.1%
Taylor expanded in x around inf
Applied rewrites49.9%
if -3.30000000000000019e-134 < t < 4.20000000000000021e-174Initial program 98.2%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6470.0
Applied rewrites70.0%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6470.0
Applied rewrites70.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f6451.2
Applied rewrites51.2%
if 1.2e-48 < t < 2.7e8Initial program 98.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6469.5
Applied rewrites69.5%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6460.3
Applied rewrites60.3%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6443.4
Applied rewrites43.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -72000000000.0)
t_1
(if (<= b -4.1e-302)
(- x (* (- y 1.0) z))
(if (<= b 6.6e+75) (- x (* (- t 1.0) a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -72000000000.0) {
tmp = t_1;
} else if (b <= -4.1e-302) {
tmp = x - ((y - 1.0) * z);
} else if (b <= 6.6e+75) {
tmp = x - ((t - 1.0) * 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)
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) :: t_1
real(8) :: tmp
t_1 = ((t + y) - 2.0d0) * b
if (b <= (-72000000000.0d0)) then
tmp = t_1
else if (b <= (-4.1d-302)) then
tmp = x - ((y - 1.0d0) * z)
else if (b <= 6.6d+75) then
tmp = x - ((t - 1.0d0) * 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 t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -72000000000.0) {
tmp = t_1;
} else if (b <= -4.1e-302) {
tmp = x - ((y - 1.0) * z);
} else if (b <= 6.6e+75) {
tmp = x - ((t - 1.0) * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t + y) - 2.0) * b tmp = 0 if b <= -72000000000.0: tmp = t_1 elif b <= -4.1e-302: tmp = x - ((y - 1.0) * z) elif b <= 6.6e+75: tmp = x - ((t - 1.0) * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -72000000000.0) tmp = t_1; elseif (b <= -4.1e-302) tmp = Float64(x - Float64(Float64(y - 1.0) * z)); elseif (b <= 6.6e+75) tmp = Float64(x - Float64(Float64(t - 1.0) * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t + y) - 2.0) * b; tmp = 0.0; if (b <= -72000000000.0) tmp = t_1; elseif (b <= -4.1e-302) tmp = x - ((y - 1.0) * z); elseif (b <= 6.6e+75) tmp = x - ((t - 1.0) * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -72000000000.0], t$95$1, If[LessEqual[b, -4.1e-302], N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.6e+75], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -72000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -4.1 \cdot 10^{-302}:\\
\;\;\;\;x - \left(y - 1\right) \cdot z\\
\mathbf{elif}\;b \leq 6.6 \cdot 10^{+75}:\\
\;\;\;\;x - \left(t - 1\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -7.2e10 or 6.59999999999999996e75 < b Initial program 90.1%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6469.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6469.2
Applied rewrites69.2%
if -7.2e10 < b < -4.0999999999999998e-302Initial program 99.1%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites99.5%
lift-fma.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate--r+N/A
Applied rewrites99.1%
Taylor expanded in x around inf
Applied rewrites58.0%
if -4.0999999999999998e-302 < b < 6.59999999999999996e75Initial program 98.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.3
Applied rewrites66.3%
Taylor expanded in x around inf
Applied rewrites53.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -2.55e+85)
t_1
(if (<= t -3.1e-123)
(fma (- y 2.0) b x)
(if (<= t 1.55e-167)
(+ (fma -2.0 b x) a)
(if (<= t 6.4e-49)
(* (- 1.0 y) z)
(if (<= t 270000000.0) (fma (- y 2.0) b a) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -2.55e+85) {
tmp = t_1;
} else if (t <= -3.1e-123) {
tmp = fma((y - 2.0), b, x);
} else if (t <= 1.55e-167) {
tmp = fma(-2.0, b, x) + a;
} else if (t <= 6.4e-49) {
tmp = (1.0 - y) * z;
} else if (t <= 270000000.0) {
tmp = fma((y - 2.0), b, a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -2.55e+85) tmp = t_1; elseif (t <= -3.1e-123) tmp = fma(Float64(y - 2.0), b, x); elseif (t <= 1.55e-167) tmp = Float64(fma(-2.0, b, x) + a); elseif (t <= 6.4e-49) tmp = Float64(Float64(1.0 - y) * z); elseif (t <= 270000000.0) tmp = fma(Float64(y - 2.0), b, a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2.55e+85], t$95$1, If[LessEqual[t, -3.1e-123], N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision], If[LessEqual[t, 1.55e-167], N[(N[(-2.0 * b + x), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t, 6.4e-49], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 270000000.0], N[(N[(y - 2.0), $MachinePrecision] * b + a), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -2.55 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-123}:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, x\right)\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-167}:\\
\;\;\;\;\mathsf{fma}\left(-2, b, x\right) + a\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{-49}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;t \leq 270000000:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.5499999999999999e85 or 2.7e8 < t Initial program 91.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6467.5
Applied rewrites67.5%
if -2.5499999999999999e85 < t < -3.09999999999999998e-123Initial program 98.1%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6468.9
Applied rewrites68.9%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6454.1
Applied rewrites54.1%
Taylor expanded in a around 0
*-commutativeN/A
+-commutativeN/A
lift-fma.f64N/A
lift--.f6443.3
Applied rewrites43.3%
if -3.09999999999999998e-123 < t < 1.55e-167Initial program 98.1%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6470.2
Applied rewrites70.2%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6470.2
Applied rewrites70.2%
Taylor expanded in y around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f6451.2
Applied rewrites51.2%
if 1.55e-167 < t < 6.40000000000000005e-49Initial program 98.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.2
Applied rewrites33.2%
if 6.40000000000000005e-49 < t < 2.7e8Initial program 96.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6467.3
Applied rewrites67.3%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6458.9
Applied rewrites58.9%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6440.6
Applied rewrites40.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -2.55e+85)
t_1
(if (<= t -3.7e-112)
(fma (- y 2.0) b x)
(if (<= t 270000000.0) (fma (- y 2.0) b a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -2.55e+85) {
tmp = t_1;
} else if (t <= -3.7e-112) {
tmp = fma((y - 2.0), b, x);
} else if (t <= 270000000.0) {
tmp = fma((y - 2.0), b, a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -2.55e+85) tmp = t_1; elseif (t <= -3.7e-112) tmp = fma(Float64(y - 2.0), b, x); elseif (t <= 270000000.0) tmp = fma(Float64(y - 2.0), b, a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2.55e+85], t$95$1, If[LessEqual[t, -3.7e-112], N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision], If[LessEqual[t, 270000000.0], N[(N[(y - 2.0), $MachinePrecision] * b + a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -2.55 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.7 \cdot 10^{-112}:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, x\right)\\
\mathbf{elif}\;t \leq 270000000:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.5499999999999999e85 or 2.7e8 < t Initial program 91.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6467.5
Applied rewrites67.5%
if -2.5499999999999999e85 < t < -3.6999999999999998e-112Initial program 98.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6468.0
Applied rewrites68.0%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6452.4
Applied rewrites52.4%
Taylor expanded in a around 0
*-commutativeN/A
+-commutativeN/A
lift-fma.f64N/A
lift--.f6442.2
Applied rewrites42.2%
if -3.6999999999999998e-112 < t < 2.7e8Initial program 97.9%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6470.1
Applied rewrites70.1%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6469.2
Applied rewrites69.2%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6450.3
Applied rewrites50.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- b z) y))) (if (<= y -3.55e+142) t_1 (if (<= y 1.05e+68) (- x (* (- t 1.0) a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -3.55e+142) {
tmp = t_1;
} else if (y <= 1.05e+68) {
tmp = x - ((t - 1.0) * 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)
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) :: t_1
real(8) :: tmp
t_1 = (b - z) * y
if (y <= (-3.55d+142)) then
tmp = t_1
else if (y <= 1.05d+68) then
tmp = x - ((t - 1.0d0) * 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 t_1 = (b - z) * y;
double tmp;
if (y <= -3.55e+142) {
tmp = t_1;
} else if (y <= 1.05e+68) {
tmp = x - ((t - 1.0) * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y tmp = 0 if y <= -3.55e+142: tmp = t_1 elif y <= 1.05e+68: tmp = x - ((t - 1.0) * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -3.55e+142) tmp = t_1; elseif (y <= 1.05e+68) tmp = Float64(x - Float64(Float64(t - 1.0) * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; tmp = 0.0; if (y <= -3.55e+142) tmp = t_1; elseif (y <= 1.05e+68) tmp = x - ((t - 1.0) * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -3.55e+142], t$95$1, If[LessEqual[y, 1.05e+68], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -3.55 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+68}:\\
\;\;\;\;x - \left(t - 1\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.55e142 or 1.05e68 < y Initial program 91.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6472.4
Applied rewrites72.4%
if -3.55e142 < y < 1.05e68Initial program 97.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6476.7
Applied rewrites76.7%
Taylor expanded in x around inf
Applied rewrites48.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- b a) t))) (if (<= t -1.06e+70) t_1 (if (<= t 270000000.0) (fma (- y 2.0) b a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -1.06e+70) {
tmp = t_1;
} else if (t <= 270000000.0) {
tmp = fma((y - 2.0), b, a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -1.06e+70) tmp = t_1; elseif (t <= 270000000.0) tmp = fma(Float64(y - 2.0), b, a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.06e+70], t$95$1, If[LessEqual[t, 270000000.0], N[(N[(y - 2.0), $MachinePrecision] * b + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -1.06 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 270000000:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.06e70 or 2.7e8 < t Initial program 91.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6466.8
Applied rewrites66.8%
if -1.06e70 < t < 2.7e8Initial program 98.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6469.8
Applied rewrites69.8%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6465.3
Applied rewrites65.3%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6446.9
Applied rewrites46.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -1.1e+70)
t_1
(if (<= t -4.8e-106)
(* (- b z) y)
(if (<= t 1.82e-168)
(+ a x)
(if (<= t 9.3e+42) (* (- 1.0 y) z) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -1.1e+70) {
tmp = t_1;
} else if (t <= -4.8e-106) {
tmp = (b - z) * y;
} else if (t <= 1.82e-168) {
tmp = a + x;
} else if (t <= 9.3e+42) {
tmp = (1.0 - y) * z;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (b - a) * t
if (t <= (-1.1d+70)) then
tmp = t_1
else if (t <= (-4.8d-106)) then
tmp = (b - z) * y
else if (t <= 1.82d-168) then
tmp = a + x
else if (t <= 9.3d+42) then
tmp = (1.0d0 - y) * z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -1.1e+70) {
tmp = t_1;
} else if (t <= -4.8e-106) {
tmp = (b - z) * y;
} else if (t <= 1.82e-168) {
tmp = a + x;
} else if (t <= 9.3e+42) {
tmp = (1.0 - y) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -1.1e+70: tmp = t_1 elif t <= -4.8e-106: tmp = (b - z) * y elif t <= 1.82e-168: tmp = a + x elif t <= 9.3e+42: tmp = (1.0 - y) * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -1.1e+70) tmp = t_1; elseif (t <= -4.8e-106) tmp = Float64(Float64(b - z) * y); elseif (t <= 1.82e-168) tmp = Float64(a + x); elseif (t <= 9.3e+42) tmp = Float64(Float64(1.0 - y) * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - a) * t; tmp = 0.0; if (t <= -1.1e+70) tmp = t_1; elseif (t <= -4.8e-106) tmp = (b - z) * y; elseif (t <= 1.82e-168) tmp = a + x; elseif (t <= 9.3e+42) tmp = (1.0 - y) * z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.1e+70], t$95$1, If[LessEqual[t, -4.8e-106], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.82e-168], N[(a + x), $MachinePrecision], If[LessEqual[t, 9.3e+42], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -1.1 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.8 \cdot 10^{-106}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{elif}\;t \leq 1.82 \cdot 10^{-168}:\\
\;\;\;\;a + x\\
\mathbf{elif}\;t \leq 9.3 \cdot 10^{+42}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.1e70 or 9.3000000000000005e42 < t Initial program 90.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.2
Applied rewrites69.2%
if -1.1e70 < t < -4.7999999999999995e-106Initial program 98.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6436.4
Applied rewrites36.4%
if -4.7999999999999995e-106 < t < 1.82000000000000001e-168Initial program 98.2%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6470.5
Applied rewrites70.5%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6470.5
Applied rewrites70.5%
Taylor expanded in b around 0
lower-+.f6438.1
Applied rewrites38.1%
if 1.82000000000000001e-168 < t < 9.3000000000000005e42Initial program 97.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.5
Applied rewrites33.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -1.06e+70)
t_1
(if (<= t -5e-161)
(* (- y 2.0) b)
(if (<= t 1.82e-168)
(+ a x)
(if (<= t 9.3e+42) (* (- 1.0 y) z) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -1.06e+70) {
tmp = t_1;
} else if (t <= -5e-161) {
tmp = (y - 2.0) * b;
} else if (t <= 1.82e-168) {
tmp = a + x;
} else if (t <= 9.3e+42) {
tmp = (1.0 - y) * z;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (b - a) * t
if (t <= (-1.06d+70)) then
tmp = t_1
else if (t <= (-5d-161)) then
tmp = (y - 2.0d0) * b
else if (t <= 1.82d-168) then
tmp = a + x
else if (t <= 9.3d+42) then
tmp = (1.0d0 - y) * z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -1.06e+70) {
tmp = t_1;
} else if (t <= -5e-161) {
tmp = (y - 2.0) * b;
} else if (t <= 1.82e-168) {
tmp = a + x;
} else if (t <= 9.3e+42) {
tmp = (1.0 - y) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -1.06e+70: tmp = t_1 elif t <= -5e-161: tmp = (y - 2.0) * b elif t <= 1.82e-168: tmp = a + x elif t <= 9.3e+42: tmp = (1.0 - y) * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -1.06e+70) tmp = t_1; elseif (t <= -5e-161) tmp = Float64(Float64(y - 2.0) * b); elseif (t <= 1.82e-168) tmp = Float64(a + x); elseif (t <= 9.3e+42) tmp = Float64(Float64(1.0 - y) * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - a) * t; tmp = 0.0; if (t <= -1.06e+70) tmp = t_1; elseif (t <= -5e-161) tmp = (y - 2.0) * b; elseif (t <= 1.82e-168) tmp = a + x; elseif (t <= 9.3e+42) tmp = (1.0 - y) * z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.06e+70], t$95$1, If[LessEqual[t, -5e-161], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 1.82e-168], N[(a + x), $MachinePrecision], If[LessEqual[t, 9.3e+42], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -1.06 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-161}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\
\mathbf{elif}\;t \leq 1.82 \cdot 10^{-168}:\\
\;\;\;\;a + x\\
\mathbf{elif}\;t \leq 9.3 \cdot 10^{+42}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.06e70 or 9.3000000000000005e42 < t Initial program 90.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.2
Applied rewrites69.2%
if -1.06e70 < t < -4.9999999999999999e-161Initial program 98.5%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6469.9
Applied rewrites69.9%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6458.6
Applied rewrites58.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6429.1
Applied rewrites29.1%
if -4.9999999999999999e-161 < t < 1.82000000000000001e-168Initial program 98.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6470.2
Applied rewrites70.2%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6470.2
Applied rewrites70.2%
Taylor expanded in b around 0
lower-+.f6438.4
Applied rewrites38.4%
if 1.82000000000000001e-168 < t < 9.3000000000000005e42Initial program 97.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.5
Applied rewrites33.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- 1.0 t) a)))
(if (<= a -8e-33)
t_1
(if (<= a -1.25e-282)
(fma y b x)
(if (<= a 4.2e-92)
(* (- 1.0 y) z)
(if (<= a 1.95e+84) (fma y b x) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - t) * a;
double tmp;
if (a <= -8e-33) {
tmp = t_1;
} else if (a <= -1.25e-282) {
tmp = fma(y, b, x);
} else if (a <= 4.2e-92) {
tmp = (1.0 - y) * z;
} else if (a <= 1.95e+84) {
tmp = fma(y, b, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 - t) * a) tmp = 0.0 if (a <= -8e-33) tmp = t_1; elseif (a <= -1.25e-282) tmp = fma(y, b, x); elseif (a <= 4.2e-92) tmp = Float64(Float64(1.0 - y) * z); elseif (a <= 1.95e+84) tmp = fma(y, b, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -8e-33], t$95$1, If[LessEqual[a, -1.25e-282], N[(y * b + x), $MachinePrecision], If[LessEqual[a, 4.2e-92], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 1.95e+84], N[(y * b + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - t\right) \cdot a\\
\mathbf{if}\;a \leq -8 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.25 \cdot 10^{-282}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-92}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{+84}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8.0000000000000004e-33 or 1.95000000000000008e84 < a Initial program 91.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6451.8
Applied rewrites51.8%
if -8.0000000000000004e-33 < a < -1.25e-282 or 4.2e-92 < a < 1.95000000000000008e84Initial program 97.6%
Taylor expanded in x around inf
Applied rewrites61.8%
Taylor expanded in y around inf
Applied rewrites37.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6437.2
+-commutative37.2
Applied rewrites37.2%
if -1.25e-282 < a < 4.2e-92Initial program 98.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6437.1
Applied rewrites37.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- 1.0 t) a))) (if (<= a -8e-33) t_1 (if (<= a 1.95e+84) (fma y b x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - t) * a;
double tmp;
if (a <= -8e-33) {
tmp = t_1;
} else if (a <= 1.95e+84) {
tmp = fma(y, b, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 - t) * a) tmp = 0.0 if (a <= -8e-33) tmp = t_1; elseif (a <= 1.95e+84) tmp = fma(y, b, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -8e-33], t$95$1, If[LessEqual[a, 1.95e+84], N[(y * b + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - t\right) \cdot a\\
\mathbf{if}\;a \leq -8 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{+84}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8.0000000000000004e-33 or 1.95000000000000008e84 < a Initial program 91.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6451.8
Applied rewrites51.8%
if -8.0000000000000004e-33 < a < 1.95000000000000008e84Initial program 97.8%
Taylor expanded in x around inf
Applied rewrites62.8%
Taylor expanded in y around inf
Applied rewrites37.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6437.5
+-commutative37.5
Applied rewrites37.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- y 2.0) b))) (if (<= b -4.6e+16) t_1 (if (<= b 5.6e+85) (+ a x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y - 2.0) * b;
double tmp;
if (b <= -4.6e+16) {
tmp = t_1;
} else if (b <= 5.6e+85) {
tmp = a + x;
} 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)
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) :: t_1
real(8) :: tmp
t_1 = (y - 2.0d0) * b
if (b <= (-4.6d+16)) then
tmp = t_1
else if (b <= 5.6d+85) then
tmp = a + x
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 t_1 = (y - 2.0) * b;
double tmp;
if (b <= -4.6e+16) {
tmp = t_1;
} else if (b <= 5.6e+85) {
tmp = a + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y - 2.0) * b tmp = 0 if b <= -4.6e+16: tmp = t_1 elif b <= 5.6e+85: tmp = a + x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y - 2.0) * b) tmp = 0.0 if (b <= -4.6e+16) tmp = t_1; elseif (b <= 5.6e+85) tmp = Float64(a + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y - 2.0) * b; tmp = 0.0; if (b <= -4.6e+16) tmp = t_1; elseif (b <= 5.6e+85) tmp = a + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -4.6e+16], t$95$1, If[LessEqual[b, 5.6e+85], N[(a + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - 2\right) \cdot b\\
\mathbf{if}\;b \leq -4.6 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+85}:\\
\;\;\;\;a + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -4.6e16 or 5.5999999999999998e85 < b Initial program 90.1%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6483.0
Applied rewrites83.0%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6456.1
Applied rewrites56.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.3
Applied rewrites44.3%
if -4.6e16 < b < 5.5999999999999998e85Initial program 98.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6465.5
Applied rewrites65.5%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6439.1
Applied rewrites39.1%
Taylor expanded in b around 0
lower-+.f6432.6
Applied rewrites32.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))))
(if (<= t_1 -1e+293) (fma y b x) (if (<= t_1 5e+278) (+ a x) (* (- z) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= -1e+293) {
tmp = fma(y, b, x);
} else if (t_1 <= 5e+278) {
tmp = a + x;
} else {
tmp = -z * y;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (t_1 <= -1e+293) tmp = fma(y, b, x); elseif (t_1 <= 5e+278) tmp = Float64(a + x); else tmp = Float64(Float64(-z) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+293], N[(y * b + x), $MachinePrecision], If[LessEqual[t$95$1, 5e+278], N[(a + x), $MachinePrecision], N[((-z) * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+293}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;a + x\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) \cdot y\\
\end{array}
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < -9.9999999999999992e292Initial program 100.0%
Taylor expanded in x around inf
Applied rewrites54.0%
Taylor expanded in y around inf
Applied rewrites32.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6432.7
+-commutative32.7
Applied rewrites32.7%
if -9.9999999999999992e292 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < 5.00000000000000029e278Initial program 100.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6474.6
Applied rewrites74.6%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6455.0
Applied rewrites55.0%
Taylor expanded in b around 0
lower-+.f6436.9
Applied rewrites36.9%
if 5.00000000000000029e278 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 82.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6445.8
Applied rewrites45.8%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6426.7
Applied rewrites26.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))))
(if (<= t_1 (- INFINITY))
(* b y)
(if (<= t_1 5e+278) (+ a x) (* (- z) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = b * y;
} else if (t_1 <= 5e+278) {
tmp = a + x;
} else {
tmp = -z * y;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = b * y;
} else if (t_1 <= 5e+278) {
tmp = a + x;
} else {
tmp = -z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b) tmp = 0 if t_1 <= -math.inf: tmp = b * y elif t_1 <= 5e+278: tmp = a + x else: tmp = -z * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(b * y); elseif (t_1 <= 5e+278) tmp = Float64(a + x); else tmp = Float64(Float64(-z) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); tmp = 0.0; if (t_1 <= -Inf) tmp = b * y; elseif (t_1 <= 5e+278) tmp = a + x; else tmp = -z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(b * y), $MachinePrecision], If[LessEqual[t$95$1, 5e+278], N[(a + x), $MachinePrecision], N[((-z) * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;a + x\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) \cdot y\\
\end{array}
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < -inf.0Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6456.7
Applied rewrites56.7%
Taylor expanded in z around 0
Applied rewrites32.6%
if -inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < 5.00000000000000029e278Initial program 100.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6474.5
Applied rewrites74.5%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6454.9
Applied rewrites54.9%
Taylor expanded in b around 0
lower-+.f6436.9
Applied rewrites36.9%
if 5.00000000000000029e278 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 82.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6445.8
Applied rewrites45.8%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6426.7
Applied rewrites26.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))))
(if (<= t_1 (- INFINITY)) (* b y) (if (<= t_1 5e+278) (+ a x) (* b y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = b * y;
} else if (t_1 <= 5e+278) {
tmp = a + x;
} else {
tmp = b * y;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = b * y;
} else if (t_1 <= 5e+278) {
tmp = a + x;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b) tmp = 0 if t_1 <= -math.inf: tmp = b * y elif t_1 <= 5e+278: tmp = a + x else: tmp = b * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(b * y); elseif (t_1 <= 5e+278) tmp = Float64(a + x); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); tmp = 0.0; if (t_1 <= -Inf) tmp = b * y; elseif (t_1 <= 5e+278) tmp = a + x; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(b * y), $MachinePrecision], If[LessEqual[t$95$1, 5e+278], N[(a + x), $MachinePrecision], N[(b * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;a + x\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < -inf.0 or 5.00000000000000029e278 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 88.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6449.7
Applied rewrites49.7%
Taylor expanded in z around 0
Applied rewrites27.6%
if -inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < 5.00000000000000029e278Initial program 100.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6474.5
Applied rewrites74.5%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6454.9
Applied rewrites54.9%
Taylor expanded in b around 0
lower-+.f6436.9
Applied rewrites36.9%
(FPCore (x y z t a b) :precision binary64 (+ a x))
double code(double x, double y, double z, double t, double a, double b) {
return a + x;
}
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)
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
code = a + x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a + x;
}
def code(x, y, z, t, a, b): return a + x
function code(x, y, z, t, a, b) return Float64(a + x) end
function tmp = code(x, y, z, t, a, b) tmp = a + x; end
code[x_, y_, z_, t_, a_, b_] := N[(a + x), $MachinePrecision]
\begin{array}{l}
\\
a + x
\end{array}
Initial program 95.1%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.9
Applied rewrites72.9%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6446.2
Applied rewrites46.2%
Taylor expanded in b around 0
lower-+.f6424.6
Applied rewrites24.6%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.6e+79) a (if (<= a 3.3e+115) x a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.6e+79) {
tmp = a;
} else if (a <= 3.3e+115) {
tmp = x;
} else {
tmp = a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (a <= (-1.6d+79)) then
tmp = a
else if (a <= 3.3d+115) then
tmp = x
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.6e+79) {
tmp = a;
} else if (a <= 3.3e+115) {
tmp = x;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.6e+79: tmp = a elif a <= 3.3e+115: tmp = x else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.6e+79) tmp = a; elseif (a <= 3.3e+115) tmp = x; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.6e+79) tmp = a; elseif (a <= 3.3e+115) tmp = x; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.6e+79], a, If[LessEqual[a, 3.3e+115], x, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+79}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{+115}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -1.60000000000000001e79 or 3.30000000000000005e115 < a Initial program 90.5%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6479.5
Applied rewrites79.5%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lift-neg.f6446.1
Applied rewrites46.1%
Taylor expanded in a around inf
Applied rewrites23.7%
if -1.60000000000000001e79 < a < 3.30000000000000005e115Initial program 97.5%
Taylor expanded in x around inf
Applied rewrites19.8%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
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)
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
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.1%
Taylor expanded in x around inf
Applied rewrites15.7%
herbie shell --seed 2025120
(FPCore (x y z t a b)
:name "Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2"
:precision binary64
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))