
(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}
Sampling outcomes in binary64 precision:
Herbie found 25 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
(if (<=
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))
INFINITY)
(- (+ (fma (- b z) y (* (- t 2.0) b)) x) (- (fma a t (- a)) z))
(+ (+ x z) (fma (- 1.0 t) a (* (- b z) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)) <= ((double) INFINITY)) {
tmp = (fma((b - z), y, ((t - 2.0) * b)) + x) - (fma(a, t, -a) - z);
} else {
tmp = (x + z) + fma((1.0 - t), a, ((b - z) * y));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) <= Inf) tmp = Float64(Float64(fma(Float64(b - z), y, Float64(Float64(t - 2.0) * b)) + x) - Float64(fma(a, t, Float64(-a)) - z)); else tmp = Float64(Float64(x + z) + fma(Float64(1.0 - t), a, Float64(Float64(b - z) * y))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[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], Infinity], N[(N[(N[(N[(b - z), $MachinePrecision] * y + N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] - N[(N[(a * t + (-a)), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(N[(x + z), $MachinePrecision] + N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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 \leq \infty:\\
\;\;\;\;\left(\mathsf{fma}\left(b - z, y, \left(t - 2\right) \cdot b\right) + x\right) - \left(\mathsf{fma}\left(a, t, -a\right) - z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z\right) + \mathsf{fma}\left(1 - t, a, \left(b - z\right) \cdot y\right)\\
\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 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lift-neg.f64100.0
Applied rewrites100.0%
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)) Initial program 0.0%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
associate-+r+N/A
lower-+.f64N/A
lower-+.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6453.8
Applied rewrites53.8%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f64N/A
lift--.f6476.9
Applied rewrites76.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -6.2e+35)
(+ (+ x z) (fma (- 1.0 t) a (* (- b z) y)))
(if (<= a 8.5e+56)
(- (+ (fma (- b z) y (* (- t 2.0) b)) x) (- z))
(fma (- (+ t y) 2.0) b (* (- 1.0 t) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6.2e+35) {
tmp = (x + z) + fma((1.0 - t), a, ((b - z) * y));
} else if (a <= 8.5e+56) {
tmp = (fma((b - z), y, ((t - 2.0) * b)) + x) - -z;
} else {
tmp = fma(((t + y) - 2.0), b, ((1.0 - t) * a));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6.2e+35) tmp = Float64(Float64(x + z) + fma(Float64(1.0 - t), a, Float64(Float64(b - z) * y))); elseif (a <= 8.5e+56) tmp = Float64(Float64(fma(Float64(b - z), y, Float64(Float64(t - 2.0) * b)) + x) - Float64(-z)); else tmp = fma(Float64(Float64(t + y) - 2.0), b, Float64(Float64(1.0 - t) * a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6.2e+35], N[(N[(x + z), $MachinePrecision] + N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.5e+56], N[(N[(N[(N[(b - z), $MachinePrecision] * y + N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] - (-z)), $MachinePrecision], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+35}:\\
\;\;\;\;\left(x + z\right) + \mathsf{fma}\left(1 - t, a, \left(b - z\right) \cdot y\right)\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{+56}:\\
\;\;\;\;\left(\mathsf{fma}\left(b - z, y, \left(t - 2\right) \cdot b\right) + x\right) - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, \left(1 - t\right) \cdot a\right)\\
\end{array}
\end{array}
if a < -6.19999999999999973e35Initial program 91.9%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6491.9
Applied rewrites91.9%
Taylor expanded in a around 0
associate-+r+N/A
lower-+.f64N/A
lower-+.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6493.5
Applied rewrites93.5%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f64N/A
lift--.f6495.1
Applied rewrites95.1%
if -6.19999999999999973e35 < a < 8.4999999999999998e56Initial program 95.8%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6497.9
Applied rewrites97.9%
Taylor expanded in z around inf
mul-1-negN/A
lift-neg.f6494.8
Applied rewrites94.8%
if 8.4999999999999998e56 < a Initial program 96.0%
Taylor expanded in x around inf
Applied rewrites35.5%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6435.5
Applied rewrites35.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6492.1
Applied rewrites92.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -2.8e+55)
(fma (- (+ t y) 2.0) b (* (- 1.0 t) a))
(if (<= b 6.5e+117)
(+ (+ x z) (fma (- 1.0 t) a (* (- b z) y)))
(+ (* (- 1.0 y) z) (* (- (+ y t) 2.0) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.8e+55) {
tmp = fma(((t + y) - 2.0), b, ((1.0 - t) * a));
} else if (b <= 6.5e+117) {
tmp = (x + z) + fma((1.0 - t), a, ((b - z) * y));
} else {
tmp = ((1.0 - y) * z) + (((y + t) - 2.0) * b);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.8e+55) tmp = fma(Float64(Float64(t + y) - 2.0), b, Float64(Float64(1.0 - t) * a)); elseif (b <= 6.5e+117) tmp = Float64(Float64(x + z) + fma(Float64(1.0 - t), a, Float64(Float64(b - z) * y))); else tmp = Float64(Float64(Float64(1.0 - y) * z) + Float64(Float64(Float64(y + t) - 2.0) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.8e+55], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.5e+117], N[(N[(x + z), $MachinePrecision] + N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.8 \cdot 10^{+55}:\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, \left(1 - t\right) \cdot a\right)\\
\mathbf{elif}\;b \leq 6.5 \cdot 10^{+117}:\\
\;\;\;\;\left(x + z\right) + \mathsf{fma}\left(1 - t, a, \left(b - z\right) \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - y\right) \cdot z + \left(\left(y + t\right) - 2\right) \cdot b\\
\end{array}
\end{array}
if b < -2.8000000000000001e55Initial program 85.2%
Taylor expanded in x around inf
Applied rewrites71.8%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6471.8
Applied rewrites71.8%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6486.5
Applied rewrites86.5%
if -2.8000000000000001e55 < b < 6.5000000000000004e117Initial program 98.7%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6499.3
Applied rewrites99.3%
Taylor expanded in a around 0
associate-+r+N/A
lower-+.f64N/A
lower-+.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64100.0
Applied rewrites100.0%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f64N/A
lift--.f6494.5
Applied rewrites94.5%
if 6.5000000000000004e117 < b Initial program 94.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6486.8
Applied rewrites86.8%
(FPCore (x y z t a b) :precision binary64 (fma (- (+ t y) 2.0) b (- (fma (- a) t x) (fma z (- y 1.0) (- a)))))
double code(double x, double y, double z, double t, double a, double b) {
return fma(((t + y) - 2.0), b, (fma(-a, t, x) - fma(z, (y - 1.0), -a)));
}
function code(x, y, z, t, a, b) return fma(Float64(Float64(t + y) - 2.0), b, Float64(fma(Float64(-a), t, x) - fma(z, Float64(y - 1.0), Float64(-a)))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[(N[((-a) * t + x), $MachinePrecision] - N[(z * N[(y - 1.0), $MachinePrecision] + (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\left(t + y\right) - 2, b, \mathsf{fma}\left(-a, t, x\right) - \mathsf{fma}\left(z, y - 1, -a\right)\right)
\end{array}
Initial program 94.9%
Taylor expanded in x around inf
Applied rewrites48.8%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6448.8
Applied rewrites48.8%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6497.6
Applied rewrites97.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- a) t a)))
(if (<= a -2.15e+145)
t_1
(if (<= a 1.6e-161)
(fma y b x)
(if (<= a 2e-56)
(* (- 1.0 y) z)
(if (<= a 4.2e+56) (fma y b x) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(-a, t, a);
double tmp;
if (a <= -2.15e+145) {
tmp = t_1;
} else if (a <= 1.6e-161) {
tmp = fma(y, b, x);
} else if (a <= 2e-56) {
tmp = (1.0 - y) * z;
} else if (a <= 4.2e+56) {
tmp = fma(y, b, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(-a), t, a) tmp = 0.0 if (a <= -2.15e+145) tmp = t_1; elseif (a <= 1.6e-161) tmp = fma(y, b, x); elseif (a <= 2e-56) tmp = Float64(Float64(1.0 - y) * z); elseif (a <= 4.2e+56) 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[((-a) * t + a), $MachinePrecision]}, If[LessEqual[a, -2.15e+145], t$95$1, If[LessEqual[a, 1.6e-161], N[(y * b + x), $MachinePrecision], If[LessEqual[a, 2e-56], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 4.2e+56], N[(y * b + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, t, a\right)\\
\mathbf{if}\;a \leq -2.15 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{-161}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-56}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.14999999999999999e145 or 4.20000000000000034e56 < a Initial program 91.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6468.7
Applied rewrites68.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lift-neg.f6468.7
Applied rewrites68.7%
if -2.14999999999999999e145 < a < 1.59999999999999993e-161 or 2.0000000000000001e-56 < a < 4.20000000000000034e56Initial program 95.7%
Taylor expanded in x around inf
Applied rewrites63.0%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6463.0
Applied rewrites63.0%
Taylor expanded in y around inf
Applied rewrites44.1%
if 1.59999999999999993e-161 < a < 2.0000000000000001e-56Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6452.2
Applied rewrites52.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- a) t a)))
(if (<= a -2.15e+145)
t_1
(if (<= a 8.5e-159)
(fma y b x)
(if (<= a 1.6e-57) (* (- z) y) (if (<= a 4.2e+56) (fma y b x) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(-a, t, a);
double tmp;
if (a <= -2.15e+145) {
tmp = t_1;
} else if (a <= 8.5e-159) {
tmp = fma(y, b, x);
} else if (a <= 1.6e-57) {
tmp = -z * y;
} else if (a <= 4.2e+56) {
tmp = fma(y, b, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(-a), t, a) tmp = 0.0 if (a <= -2.15e+145) tmp = t_1; elseif (a <= 8.5e-159) tmp = fma(y, b, x); elseif (a <= 1.6e-57) tmp = Float64(Float64(-z) * y); elseif (a <= 4.2e+56) 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[((-a) * t + a), $MachinePrecision]}, If[LessEqual[a, -2.15e+145], t$95$1, If[LessEqual[a, 8.5e-159], N[(y * b + x), $MachinePrecision], If[LessEqual[a, 1.6e-57], N[((-z) * y), $MachinePrecision], If[LessEqual[a, 4.2e+56], N[(y * b + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, t, a\right)\\
\mathbf{if}\;a \leq -2.15 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{-159}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{-57}:\\
\;\;\;\;\left(-z\right) \cdot y\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.14999999999999999e145 or 4.20000000000000034e56 < a Initial program 91.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6468.7
Applied rewrites68.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lift-neg.f6468.7
Applied rewrites68.7%
if -2.14999999999999999e145 < a < 8.4999999999999998e-159 or 1.6e-57 < a < 4.20000000000000034e56Initial program 95.8%
Taylor expanded in x around inf
Applied rewrites62.2%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6462.2
Applied rewrites62.2%
Taylor expanded in y around inf
Applied rewrites43.5%
if 8.4999999999999998e-159 < a < 1.6e-57Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6445.4
Applied rewrites45.4%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6444.9
Applied rewrites44.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ t y) 2.0)))
(if (<= b -1.15e+53)
(fma t_1 b (* (- 1.0 t) a))
(if (<= b 4e+19)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(+ (+ x z) (* t_1 b))))))
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 <= -1.15e+53) {
tmp = fma(t_1, b, ((1.0 - t) * a));
} else if (b <= 4e+19) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = (x + z) + (t_1 * b);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) tmp = 0.0 if (b <= -1.15e+53) tmp = fma(t_1, b, Float64(Float64(1.0 - t) * a)); elseif (b <= 4e+19) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = Float64(Float64(x + z) + Float64(t_1 * b)); 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, -1.15e+53], N[(t$95$1 * b + N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4e+19], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + z), $MachinePrecision] + N[(t$95$1 * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
\mathbf{if}\;b \leq -1.15 \cdot 10^{+53}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, \left(1 - t\right) \cdot a\right)\\
\mathbf{elif}\;b \leq 4 \cdot 10^{+19}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z\right) + t\_1 \cdot b\\
\end{array}
\end{array}
if b < -1.1500000000000001e53Initial program 85.5%
Taylor expanded in x around inf
Applied rewrites70.6%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6470.6
Applied rewrites70.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6486.7
Applied rewrites86.7%
if -1.1500000000000001e53 < b < 4e19Initial program 98.5%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6490.9
Applied rewrites90.9%
if 4e19 < b Initial program 96.3%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.3
Applied rewrites96.3%
Taylor expanded in a around 0
associate-+r+N/A
lower-+.f64N/A
lower-+.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6498.1
Applied rewrites98.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-+.f6483.5
Applied rewrites83.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ t y) 2.0)))
(if (<= b -9e+143)
(fma t_1 b a)
(if (<= b 4e+19)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(+ (+ x z) (* t_1 b))))))
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 <= -9e+143) {
tmp = fma(t_1, b, a);
} else if (b <= 4e+19) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = (x + z) + (t_1 * b);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) tmp = 0.0 if (b <= -9e+143) tmp = fma(t_1, b, a); elseif (b <= 4e+19) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = Float64(Float64(x + z) + Float64(t_1 * b)); 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, -9e+143], N[(t$95$1 * b + a), $MachinePrecision], If[LessEqual[b, 4e+19], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + z), $MachinePrecision] + N[(t$95$1 * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
\mathbf{if}\;b \leq -9 \cdot 10^{+143}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, a\right)\\
\mathbf{elif}\;b \leq 4 \cdot 10^{+19}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z\right) + t\_1 \cdot b\\
\end{array}
\end{array}
if b < -8.9999999999999993e143Initial program 89.2%
Taylor expanded in x around inf
Applied rewrites85.7%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6485.7
Applied rewrites85.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6490.9
Applied rewrites90.9%
Taylor expanded in t around 0
Applied rewrites88.5%
if -8.9999999999999993e143 < b < 4e19Initial program 95.7%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6488.2
Applied rewrites88.2%
if 4e19 < b Initial program 96.3%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.3
Applied rewrites96.3%
Taylor expanded in a around 0
associate-+r+N/A
lower-+.f64N/A
lower-+.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6498.1
Applied rewrites98.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-+.f6483.5
Applied rewrites83.5%
(FPCore (x y z t a b) :precision binary64 (+ (+ x z) (fma (- 1.0 t) a (fma (- t 2.0) b (* (- b z) y)))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + z) + fma((1.0 - t), a, fma((t - 2.0), b, ((b - z) * y)));
}
function code(x, y, z, t, a, b) return Float64(Float64(x + z) + fma(Float64(1.0 - t), a, fma(Float64(t - 2.0), b, Float64(Float64(b - z) * y)))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + z), $MachinePrecision] + N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(t - 2.0), $MachinePrecision] * b + N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + z\right) + \mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(t - 2, b, \left(b - z\right) \cdot y\right)\right)
\end{array}
Initial program 94.9%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.5
Applied rewrites96.5%
Taylor expanded in a around 0
associate-+r+N/A
lower-+.f64N/A
lower-+.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6496.8
Applied rewrites96.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.6e+39) (not (<= a 8.5e+56))) (fma y b (* (- 1.0 t) a)) (+ (+ x z) (* (- (+ t y) 2.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.6e+39) || !(a <= 8.5e+56)) {
tmp = fma(y, b, ((1.0 - t) * a));
} else {
tmp = (x + z) + (((t + y) - 2.0) * b);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.6e+39) || !(a <= 8.5e+56)) tmp = fma(y, b, Float64(Float64(1.0 - t) * a)); else tmp = Float64(Float64(x + z) + Float64(Float64(Float64(t + y) - 2.0) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.6e+39], N[Not[LessEqual[a, 8.5e+56]], $MachinePrecision]], N[(y * b + N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(N[(x + z), $MachinePrecision] + N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+39} \lor \neg \left(a \leq 8.5 \cdot 10^{+56}\right):\\
\;\;\;\;\mathsf{fma}\left(y, b, \left(1 - t\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z\right) + \left(\left(t + y\right) - 2\right) \cdot b\\
\end{array}
\end{array}
if a < -1.59999999999999996e39 or 8.4999999999999998e56 < a Initial program 93.8%
Taylor expanded in x around inf
Applied rewrites31.9%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6432.0
Applied rewrites32.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6480.2
Applied rewrites80.2%
Taylor expanded in y around inf
Applied rewrites75.9%
if -1.59999999999999996e39 < a < 8.4999999999999998e56Initial program 95.8%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6497.9
Applied rewrites97.9%
Taylor expanded in a around 0
associate-+r+N/A
lower-+.f64N/A
lower-+.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6499.3
Applied rewrites99.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-+.f6475.0
Applied rewrites75.0%
Final simplification75.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -3e+142) (not (<= b 1.6e-20))) (fma (- (+ t y) 2.0) b a) (- x (fma (- t 1.0) a (- z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3e+142) || !(b <= 1.6e-20)) {
tmp = fma(((t + y) - 2.0), b, a);
} else {
tmp = x - fma((t - 1.0), a, -z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -3e+142) || !(b <= 1.6e-20)) tmp = fma(Float64(Float64(t + y) - 2.0), b, a); else tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(-z))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -3e+142], N[Not[LessEqual[b, 1.6e-20]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + a), $MachinePrecision], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{+142} \lor \neg \left(b \leq 1.6 \cdot 10^{-20}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, a\right)\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, -z\right)\\
\end{array}
\end{array}
if b < -2.99999999999999975e142 or 1.59999999999999985e-20 < b Initial program 94.1%
Taylor expanded in x around inf
Applied rewrites77.7%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6477.7
Applied rewrites77.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6483.8
Applied rewrites83.8%
Taylor expanded in t around 0
Applied rewrites78.9%
if -2.99999999999999975e142 < b < 1.59999999999999985e-20Initial program 95.4%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6497.4
Applied rewrites97.4%
Taylor expanded in x around inf
Applied rewrites67.4%
Final simplification72.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -3.6e+22)
t_1
(if (<= y 6.5e-255)
(fma (- t 2.0) b x)
(if (<= y 11.2) (- x (- (- a) z)) 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.6e+22) {
tmp = t_1;
} else if (y <= 6.5e-255) {
tmp = fma((t - 2.0), b, x);
} else if (y <= 11.2) {
tmp = x - (-a - z);
} 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.6e+22) tmp = t_1; elseif (y <= 6.5e-255) tmp = fma(Float64(t - 2.0), b, x); elseif (y <= 11.2) tmp = Float64(x - Float64(Float64(-a) - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -3.6e+22], t$95$1, If[LessEqual[y, 6.5e-255], N[(N[(t - 2.0), $MachinePrecision] * b + x), $MachinePrecision], If[LessEqual[y, 11.2], N[(x - N[((-a) - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-255}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, x\right)\\
\mathbf{elif}\;y \leq 11.2:\\
\;\;\;\;x - \left(\left(-a\right) - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.6e22 or 11.199999999999999 < y Initial program 93.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6464.2
Applied rewrites64.2%
if -3.6e22 < y < 6.5e-255Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites55.0%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6455.0
Applied rewrites55.0%
Taylor expanded in y around 0
Applied rewrites54.3%
if 6.5e-255 < y < 11.199999999999999Initial program 95.5%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6495.5
Applied rewrites95.5%
Taylor expanded in x around inf
Applied rewrites81.3%
Taylor expanded in t around 0
lower--.f64N/A
mul-1-negN/A
lift-neg.f6459.9
Applied rewrites59.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -8e+56)
t_1
(if (<= t -6e-92)
(* (- b z) y)
(if (<= t 54000.0) (- x (- (- a) 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 <= -8e+56) {
tmp = t_1;
} else if (t <= -6e-92) {
tmp = (b - z) * y;
} else if (t <= 54000.0) {
tmp = x - (-a - 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 <= (-8d+56)) then
tmp = t_1
else if (t <= (-6d-92)) then
tmp = (b - z) * y
else if (t <= 54000.0d0) then
tmp = x - (-a - 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 <= -8e+56) {
tmp = t_1;
} else if (t <= -6e-92) {
tmp = (b - z) * y;
} else if (t <= 54000.0) {
tmp = x - (-a - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -8e+56: tmp = t_1 elif t <= -6e-92: tmp = (b - z) * y elif t <= 54000.0: tmp = x - (-a - 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 <= -8e+56) tmp = t_1; elseif (t <= -6e-92) tmp = Float64(Float64(b - z) * y); elseif (t <= 54000.0) tmp = Float64(x - Float64(Float64(-a) - 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 <= -8e+56) tmp = t_1; elseif (t <= -6e-92) tmp = (b - z) * y; elseif (t <= 54000.0) tmp = x - (-a - 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, -8e+56], t$95$1, If[LessEqual[t, -6e-92], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 54000.0], N[(x - N[((-a) - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -8 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -6 \cdot 10^{-92}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{elif}\;t \leq 54000:\\
\;\;\;\;x - \left(\left(-a\right) - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.00000000000000074e56 or 54000 < t Initial program 90.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6468.7
Applied rewrites68.7%
if -8.00000000000000074e56 < t < -6.00000000000000027e-92Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6459.4
Applied rewrites59.4%
if -6.00000000000000027e-92 < t < 54000Initial program 98.2%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites51.0%
Taylor expanded in t around 0
lower--.f64N/A
mul-1-negN/A
lift-neg.f6450.4
Applied rewrites50.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.6e+56) (not (<= b 1.6e-20))) (fma (- (+ t y) 2.0) b a) (+ (+ x z) (* (- y) z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.6e+56) || !(b <= 1.6e-20)) {
tmp = fma(((t + y) - 2.0), b, a);
} else {
tmp = (x + z) + (-y * z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.6e+56) || !(b <= 1.6e-20)) tmp = fma(Float64(Float64(t + y) - 2.0), b, a); else tmp = Float64(Float64(x + z) + Float64(Float64(-y) * z)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.6e+56], N[Not[LessEqual[b, 1.6e-20]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + a), $MachinePrecision], N[(N[(x + z), $MachinePrecision] + N[((-y) * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.6 \cdot 10^{+56} \lor \neg \left(b \leq 1.6 \cdot 10^{-20}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z\right) + \left(-y\right) \cdot z\\
\end{array}
\end{array}
if b < -2.60000000000000011e56 or 1.59999999999999985e-20 < b Initial program 91.9%
Taylor expanded in x around inf
Applied rewrites72.6%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6472.6
Applied rewrites72.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6482.6
Applied rewrites82.6%
Taylor expanded in t around 0
Applied rewrites75.3%
if -2.60000000000000011e56 < b < 1.59999999999999985e-20Initial program 97.7%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6498.5
Applied rewrites98.5%
Taylor expanded in a around 0
associate-+r+N/A
lower-+.f64N/A
lower-+.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6499.2
Applied rewrites99.2%
Taylor expanded in z around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
lift-neg.f6457.7
Applied rewrites57.7%
Final simplification66.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.4e+145) (not (<= a 3.7e+124))) (fma (- a) t a) (fma (- (+ t y) 2.0) b x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.4e+145) || !(a <= 3.7e+124)) {
tmp = fma(-a, t, a);
} else {
tmp = fma(((t + y) - 2.0), b, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.4e+145) || !(a <= 3.7e+124)) tmp = fma(Float64(-a), t, a); else tmp = fma(Float64(Float64(t + y) - 2.0), b, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.4e+145], N[Not[LessEqual[a, 3.7e+124]], $MachinePrecision]], N[((-a) * t + a), $MachinePrecision], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{+145} \lor \neg \left(a \leq 3.7 \cdot 10^{+124}\right):\\
\;\;\;\;\mathsf{fma}\left(-a, t, a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\\
\end{array}
\end{array}
if a < -2.39999999999999992e145 or 3.70000000000000008e124 < a Initial program 91.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.5
Applied rewrites71.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lift-neg.f6471.6
Applied rewrites71.6%
if -2.39999999999999992e145 < a < 3.70000000000000008e124Initial program 96.6%
Taylor expanded in x around inf
Applied rewrites58.6%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6458.6
Applied rewrites58.6%
Final simplification62.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -8e+56) (not (<= t 57000.0))) (* (- b a) t) (* (- b z) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -8e+56) || !(t <= 57000.0)) {
tmp = (b - a) * t;
} else {
tmp = (b - z) * y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 ((t <= (-8d+56)) .or. (.not. (t <= 57000.0d0))) then
tmp = (b - a) * t
else
tmp = (b - z) * y
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 ((t <= -8e+56) || !(t <= 57000.0)) {
tmp = (b - a) * t;
} else {
tmp = (b - z) * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -8e+56) or not (t <= 57000.0): tmp = (b - a) * t else: tmp = (b - z) * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -8e+56) || !(t <= 57000.0)) tmp = Float64(Float64(b - a) * t); else tmp = Float64(Float64(b - z) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -8e+56) || ~((t <= 57000.0))) tmp = (b - a) * t; else tmp = (b - z) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -8e+56], N[Not[LessEqual[t, 57000.0]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+56} \lor \neg \left(t \leq 57000\right):\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\end{array}
\end{array}
if t < -8.00000000000000074e56 or 57000 < t Initial program 90.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6468.7
Applied rewrites68.7%
if -8.00000000000000074e56 < t < 57000Initial program 98.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6444.8
Applied rewrites44.8%
Final simplification55.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.45e+31) (not (<= t 57000.0))) (* (- b a) t) (fma y b x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.45e+31) || !(t <= 57000.0)) {
tmp = (b - a) * t;
} else {
tmp = fma(y, b, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.45e+31) || !(t <= 57000.0)) tmp = Float64(Float64(b - a) * t); else tmp = fma(y, b, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.45e+31], N[Not[LessEqual[t, 57000.0]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], N[(y * b + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+31} \lor \neg \left(t \leq 57000\right):\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\end{array}
\end{array}
if t < -1.45e31 or 57000 < t Initial program 90.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6467.8
Applied rewrites67.8%
if -1.45e31 < t < 57000Initial program 98.5%
Taylor expanded in x around inf
Applied rewrites50.2%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6450.2
Applied rewrites50.2%
Taylor expanded in y around inf
Applied rewrites42.0%
Final simplification53.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.3e+187) (not (<= t 5.6e+92))) (* (- a) t) (fma y b x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.3e+187) || !(t <= 5.6e+92)) {
tmp = -a * t;
} else {
tmp = fma(y, b, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.3e+187) || !(t <= 5.6e+92)) tmp = Float64(Float64(-a) * t); else tmp = fma(y, b, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.3e+187], N[Not[LessEqual[t, 5.6e+92]], $MachinePrecision]], N[((-a) * t), $MachinePrecision], N[(y * b + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+187} \lor \neg \left(t \leq 5.6 \cdot 10^{+92}\right):\\
\;\;\;\;\left(-a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\end{array}
\end{array}
if t < -2.30000000000000004e187 or 5.60000000000000001e92 < t Initial program 88.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.7
Applied rewrites79.7%
Taylor expanded in a around inf
mul-1-negN/A
lift-neg.f6454.3
Applied rewrites54.3%
if -2.30000000000000004e187 < t < 5.60000000000000001e92Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites51.4%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6451.4
Applied rewrites51.4%
Taylor expanded in y around inf
Applied rewrites39.9%
Final simplification44.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.5e+22) (not (<= y 1.15e+16))) (fma y b x) (fma t b x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.5e+22) || !(y <= 1.15e+16)) {
tmp = fma(y, b, x);
} else {
tmp = fma(t, b, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.5e+22) || !(y <= 1.15e+16)) tmp = fma(y, b, x); else tmp = fma(t, b, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.5e+22], N[Not[LessEqual[y, 1.15e+16]], $MachinePrecision]], N[(y * b + x), $MachinePrecision], N[(t * b + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+22} \lor \neg \left(y \leq 1.15 \cdot 10^{+16}\right):\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, b, x\right)\\
\end{array}
\end{array}
if y < -1.5e22 or 1.15e16 < y Initial program 93.2%
Taylor expanded in x around inf
Applied rewrites50.2%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6450.2
Applied rewrites50.2%
Taylor expanded in y around inf
Applied rewrites45.9%
if -1.5e22 < y < 1.15e16Initial program 96.7%
Taylor expanded in x around inf
Applied rewrites47.2%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6447.2
Applied rewrites47.2%
Taylor expanded in t around inf
Applied rewrites37.0%
Final simplification41.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.15e+23) (not (<= y 1.52e+75))) (* b y) (fma t b x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.15e+23) || !(y <= 1.52e+75)) {
tmp = b * y;
} else {
tmp = fma(t, b, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.15e+23) || !(y <= 1.52e+75)) tmp = Float64(b * y); else tmp = fma(t, b, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.15e+23], N[Not[LessEqual[y, 1.52e+75]], $MachinePrecision]], N[(b * y), $MachinePrecision], N[(t * b + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+23} \lor \neg \left(y \leq 1.52 \cdot 10^{+75}\right):\\
\;\;\;\;b \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, b, x\right)\\
\end{array}
\end{array}
if y < -1.15e23 or 1.5199999999999999e75 < y Initial program 92.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6467.0
Applied rewrites67.0%
Taylor expanded in z around 0
Applied rewrites39.7%
if -1.15e23 < y < 1.5199999999999999e75Initial program 97.2%
Taylor expanded in x around inf
Applied rewrites45.0%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6445.0
Applied rewrites45.0%
Taylor expanded in t around inf
Applied rewrites34.4%
Final simplification36.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.5e+25) (not (<= y 850000000.0))) (* b y) (- x (- z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.5e+25) || !(y <= 850000000.0)) {
tmp = b * y;
} else {
tmp = x - -z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 ((y <= (-1.5d+25)) .or. (.not. (y <= 850000000.0d0))) then
tmp = b * y
else
tmp = x - -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.5e+25) || !(y <= 850000000.0)) {
tmp = b * y;
} else {
tmp = x - -z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.5e+25) or not (y <= 850000000.0): tmp = b * y else: tmp = x - -z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.5e+25) || !(y <= 850000000.0)) tmp = Float64(b * y); else tmp = Float64(x - Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.5e+25) || ~((y <= 850000000.0))) tmp = b * y; else tmp = x - -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.5e+25], N[Not[LessEqual[y, 850000000.0]], $MachinePrecision]], N[(b * y), $MachinePrecision], N[(x - (-z)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+25} \lor \neg \left(y \leq 850000000\right):\\
\;\;\;\;b \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - \left(-z\right)\\
\end{array}
\end{array}
if y < -1.50000000000000003e25 or 8.5e8 < y Initial program 93.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6465.6
Applied rewrites65.6%
Taylor expanded in z around 0
Applied rewrites36.3%
if -1.50000000000000003e25 < y < 8.5e8Initial program 96.7%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.7
Applied rewrites96.7%
Taylor expanded in x around inf
Applied rewrites68.4%
Taylor expanded in z around inf
mul-1-negN/A
lift-neg.f6432.9
Applied rewrites32.9%
Final simplification34.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.5e+22) (not (<= y 9.5e+14))) (* b y) (* b t)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.5e+22) || !(y <= 9.5e+14)) {
tmp = b * y;
} else {
tmp = b * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 ((y <= (-1.5d+22)) .or. (.not. (y <= 9.5d+14))) then
tmp = b * y
else
tmp = b * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.5e+22) || !(y <= 9.5e+14)) {
tmp = b * y;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.5e+22) or not (y <= 9.5e+14): tmp = b * y else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.5e+22) || !(y <= 9.5e+14)) tmp = Float64(b * y); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.5e+22) || ~((y <= 9.5e+14))) tmp = b * y; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.5e+22], N[Not[LessEqual[y, 9.5e+14]], $MachinePrecision]], N[(b * y), $MachinePrecision], N[(b * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+22} \lor \neg \left(y \leq 9.5 \cdot 10^{+14}\right):\\
\;\;\;\;b \cdot y\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if y < -1.5e22 or 9.5e14 < y Initial program 93.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6465.1
Applied rewrites65.1%
Taylor expanded in z around 0
Applied rewrites36.3%
if -1.5e22 < y < 9.5e14Initial program 96.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6443.3
Applied rewrites43.3%
Taylor expanded in a around 0
Applied rewrites23.6%
Final simplification30.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.1e+77) (not (<= b 1.95e+20))) (* b t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.1e+77) || !(b <= 1.95e+20)) {
tmp = b * t;
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 ((b <= (-1.1d+77)) .or. (.not. (b <= 1.95d+20))) then
tmp = b * t
else
tmp = x
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 ((b <= -1.1e+77) || !(b <= 1.95e+20)) {
tmp = b * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.1e+77) or not (b <= 1.95e+20): tmp = b * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.1e+77) || !(b <= 1.95e+20)) tmp = Float64(b * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.1e+77) || ~((b <= 1.95e+20))) tmp = b * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.1e+77], N[Not[LessEqual[b, 1.95e+20]], $MachinePrecision]], N[(b * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.1 \cdot 10^{+77} \lor \neg \left(b \leq 1.95 \cdot 10^{+20}\right):\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if b < -1.1e77 or 1.95e20 < b Initial program 92.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6437.2
Applied rewrites37.2%
Taylor expanded in a around 0
Applied rewrites30.1%
if -1.1e77 < b < 1.95e20Initial program 97.2%
Taylor expanded in x around inf
Applied rewrites19.9%
Final simplification24.4%
(FPCore (x y z t a b) :precision binary64 (if (<= a -3.1e+198) a (if (<= a 7.2e+56) x a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.1e+198) {
tmp = a;
} else if (a <= 7.2e+56) {
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 <= (-3.1d+198)) then
tmp = a
else if (a <= 7.2d+56) 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 <= -3.1e+198) {
tmp = a;
} else if (a <= 7.2e+56) {
tmp = x;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -3.1e+198: tmp = a elif a <= 7.2e+56: tmp = x else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3.1e+198) tmp = a; elseif (a <= 7.2e+56) tmp = x; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -3.1e+198) tmp = a; elseif (a <= 7.2e+56) tmp = x; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.1e+198], a, If[LessEqual[a, 7.2e+56], x, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{+198}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{+56}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -3.09999999999999975e198 or 7.19999999999999996e56 < a Initial program 92.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6470.9
Applied rewrites70.9%
Taylor expanded in t around 0
Applied rewrites25.6%
if -3.09999999999999975e198 < a < 7.19999999999999996e56Initial program 96.1%
Taylor expanded in x around inf
Applied rewrites17.6%
(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 94.9%
Taylor expanded in x around inf
Applied rewrites13.6%
herbie shell --seed 2025064
(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)))