
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -9.5e+48)
(fma
(/ (- (- (* x (/ y (- b y)))) (- (/ (* (- t a) y) (pow (- b y) 2.0)))) z)
-1.0
t_1)
(if (<= z 2.5e+110)
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -9.5e+48) {
tmp = fma(((-(x * (y / (b - y))) - -(((t - a) * y) / pow((b - y), 2.0))) / z), -1.0, t_1);
} else if (z <= 2.5e+110) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -9.5e+48) tmp = fma(Float64(Float64(Float64(-Float64(x * Float64(y / Float64(b - y)))) - Float64(-Float64(Float64(Float64(t - a) * y) / (Float64(b - y) ^ 2.0)))) / z), -1.0, t_1); elseif (z <= 2.5e+110) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.5e+48], N[(N[(N[((-N[(x * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) - (-N[(N[(N[(t - a), $MachinePrecision] * y), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[z, 2.5e+110], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+48}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(-x \cdot \frac{y}{b - y}\right) - \left(-\frac{\left(t - a\right) \cdot y}{{\left(b - y\right)}^{2}}\right)}{z}, -1, t\_1\right)\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+110}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.4999999999999997e48Initial program 38.1%
Taylor expanded in z around -inf
associate--l+N/A
*-commutativeN/A
div-subN/A
lower-fma.f64N/A
Applied rewrites72.0%
if -9.4999999999999997e48 < z < 2.49999999999999989e110Initial program 84.4%
if 2.49999999999999989e110 < z Initial program 34.6%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6485.6
Applied rewrites85.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.9e+74)
t_1
(if (<= z 2.5e+110)
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1.9e+74) {
tmp = t_1;
} else if (z <= 2.5e+110) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
} 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 - a) / (b - y)
if (z <= (-1.9d+74)) then
tmp = t_1
else if (z <= 2.5d+110) then
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
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 - a) / (b - y);
double tmp;
if (z <= -1.9e+74) {
tmp = t_1;
} else if (z <= 2.5e+110) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -1.9e+74: tmp = t_1 elif z <= 2.5e+110: tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.9e+74) tmp = t_1; elseif (z <= 2.5e+110) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -1.9e+74) tmp = t_1; elseif (z <= 2.5e+110) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+74], t$95$1, If[LessEqual[z, 2.5e+110], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+110}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.8999999999999999e74 or 2.49999999999999989e110 < z Initial program 35.0%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6485.0
Applied rewrites85.0%
if -1.8999999999999999e74 < z < 2.49999999999999989e110Initial program 83.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -95000000.0)
t_1
(if (<= z 2.5e+110) (/ (fma (- a) z (* y x)) (fma (- b y) z y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -95000000.0) {
tmp = t_1;
} else if (z <= 2.5e+110) {
tmp = fma(-a, z, (y * x)) / fma((b - y), z, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -95000000.0) tmp = t_1; elseif (z <= 2.5e+110) tmp = Float64(fma(Float64(-a), z, Float64(y * x)) / fma(Float64(b - y), z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -95000000.0], t$95$1, If[LessEqual[z, 2.5e+110], N[(N[((-a) * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -95000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+110}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-a, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.5e7 or 2.49999999999999989e110 < z Initial program 40.1%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6482.8
Applied rewrites82.8%
if -9.5e7 < z < 2.49999999999999989e110Initial program 84.6%
Taylor expanded in t around 0
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6463.2
Applied rewrites63.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -0.00102)
t_1
(if (<= z 2.7e-19) (/ (fma (- a) z (* y x)) (fma b z y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -0.00102) {
tmp = t_1;
} else if (z <= 2.7e-19) {
tmp = fma(-a, z, (y * x)) / fma(b, z, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -0.00102) tmp = t_1; elseif (z <= 2.7e-19) tmp = Float64(fma(Float64(-a), z, Float64(y * x)) / fma(b, z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.00102], t$95$1, If[LessEqual[z, 2.7e-19], N[(N[((-a) * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(b * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -0.00102:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-19}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-a, z, y \cdot x\right)}{\mathsf{fma}\left(b, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.00102 or 2.7000000000000001e-19 < z Initial program 47.1%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6478.1
Applied rewrites78.1%
if -0.00102 < z < 2.7000000000000001e-19Initial program 87.3%
Taylor expanded in t around 0
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6466.9
Applied rewrites66.9%
Taylor expanded in y around 0
Applied rewrites66.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -5.8e-7)
t_1
(if (<= z 1.12e-212)
(/ (+ (* x y) (* z (- t a))) y)
(if (<= z 2.65e-73) (* x (/ y (fma (- b y) z y))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -5.8e-7) {
tmp = t_1;
} else if (z <= 1.12e-212) {
tmp = ((x * y) + (z * (t - a))) / y;
} else if (z <= 2.65e-73) {
tmp = x * (y / fma((b - y), z, y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -5.8e-7) tmp = t_1; elseif (z <= 1.12e-212) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / y); elseif (z <= 2.65e-73) tmp = Float64(x * Float64(y / fma(Float64(b - y), z, y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e-7], t$95$1, If[LessEqual[z, 1.12e-212], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 2.65e-73], N[(x * N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-212}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y}\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{-73}:\\
\;\;\;\;x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.7999999999999995e-7 or 2.64999999999999986e-73 < z Initial program 50.7%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6474.1
Applied rewrites74.1%
if -5.7999999999999995e-7 < z < 1.12e-212Initial program 87.4%
Taylor expanded in z around 0
Applied rewrites63.8%
if 1.12e-212 < z < 2.64999999999999986e-73Initial program 86.5%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6458.4
Applied rewrites58.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -35000000.0)
t_1
(if (<= z 2.65e-73) (* x (/ y (fma (- b y) z y))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -35000000.0) {
tmp = t_1;
} else if (z <= 2.65e-73) {
tmp = x * (y / fma((b - y), z, y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -35000000.0) tmp = t_1; elseif (z <= 2.65e-73) tmp = Float64(x * Float64(y / fma(Float64(b - y), z, y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -35000000.0], t$95$1, If[LessEqual[z, 2.65e-73], N[(x * N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -35000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{-73}:\\
\;\;\;\;x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.5e7 or 2.64999999999999986e-73 < z Initial program 49.9%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6474.9
Applied rewrites74.9%
if -3.5e7 < z < 2.64999999999999986e-73Initial program 87.1%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6459.6
Applied rewrites59.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -4.8e-8)
t_1
(if (<= z -5.5e-296)
(/ (fma (- a) z (* y x)) y)
(if (<= z 2.25e-73) (/ (* x y) (fma b z y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -4.8e-8) {
tmp = t_1;
} else if (z <= -5.5e-296) {
tmp = fma(-a, z, (y * x)) / y;
} else if (z <= 2.25e-73) {
tmp = (x * y) / fma(b, z, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4.8e-8) tmp = t_1; elseif (z <= -5.5e-296) tmp = Float64(fma(Float64(-a), z, Float64(y * x)) / y); elseif (z <= 2.25e-73) tmp = Float64(Float64(x * y) / fma(b, z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-8], t$95$1, If[LessEqual[z, -5.5e-296], N[(N[((-a) * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 2.25e-73], N[(N[(x * y), $MachinePrecision] / N[(b * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-296}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-a, z, y \cdot x\right)}{y}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-73}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(b, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.79999999999999997e-8 or 2.25e-73 < z Initial program 50.8%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6474.1
Applied rewrites74.1%
if -4.79999999999999997e-8 < z < -5.5000000000000004e-296Initial program 87.6%
Taylor expanded in t around 0
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6466.4
Applied rewrites66.4%
Taylor expanded in z around 0
Applied rewrites49.0%
if -5.5000000000000004e-296 < z < 2.25e-73Initial program 86.6%
Taylor expanded in t around 0
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6468.4
Applied rewrites68.4%
Taylor expanded in y around 0
Applied rewrites68.4%
Taylor expanded in x around inf
lift-*.f6452.0
Applied rewrites52.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -5e-28) t_1 (if (<= z 2.25e-73) (/ (* x y) (fma b z y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -5e-28) {
tmp = t_1;
} else if (z <= 2.25e-73) {
tmp = (x * y) / fma(b, z, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -5e-28) tmp = t_1; elseif (z <= 2.25e-73) tmp = Float64(Float64(x * y) / fma(b, z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e-28], t$95$1, If[LessEqual[z, 2.25e-73], N[(N[(x * y), $MachinePrecision] / N[(b * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -5 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-73}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(b, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.0000000000000002e-28 or 2.25e-73 < z Initial program 51.9%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6472.9
Applied rewrites72.9%
if -5.0000000000000002e-28 < z < 2.25e-73Initial program 87.1%
Taylor expanded in t around 0
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6467.7
Applied rewrites67.7%
Taylor expanded in y around 0
Applied rewrites67.7%
Taylor expanded in x around inf
lift-*.f6449.0
Applied rewrites49.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -31000000.0)
t_1
(if (<= z 2.6e-73) (* x (/ -1.0 (- z 1.0))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -31000000.0) {
tmp = t_1;
} else if (z <= 2.6e-73) {
tmp = x * (-1.0 / (z - 1.0));
} 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 - a) / (b - y)
if (z <= (-31000000.0d0)) then
tmp = t_1
else if (z <= 2.6d-73) then
tmp = x * ((-1.0d0) / (z - 1.0d0))
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 - a) / (b - y);
double tmp;
if (z <= -31000000.0) {
tmp = t_1;
} else if (z <= 2.6e-73) {
tmp = x * (-1.0 / (z - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -31000000.0: tmp = t_1 elif z <= 2.6e-73: tmp = x * (-1.0 / (z - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -31000000.0) tmp = t_1; elseif (z <= 2.6e-73) tmp = Float64(x * Float64(-1.0 / Float64(z - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -31000000.0) tmp = t_1; elseif (z <= 2.6e-73) tmp = x * (-1.0 / (z - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -31000000.0], t$95$1, If[LessEqual[z, 2.6e-73], N[(x * N[(-1.0 / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -31000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-73}:\\
\;\;\;\;x \cdot \frac{-1}{z - 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.1e7 or 2.6000000000000001e-73 < z Initial program 49.9%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6474.9
Applied rewrites74.9%
if -3.1e7 < z < 2.6000000000000001e-73Initial program 87.1%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6459.6
Applied rewrites59.6%
Taylor expanded in y around -inf
lower-/.f64N/A
lift--.f6450.8
Applied rewrites50.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- x) (- z 1.0))))
(if (<= y -5.9e+66)
t_1
(if (<= y -9.8e-96)
(/ t (- b y))
(if (<= y 1.5e-27) (/ (- t a) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -x / (z - 1.0);
double tmp;
if (y <= -5.9e+66) {
tmp = t_1;
} else if (y <= -9.8e-96) {
tmp = t / (b - y);
} else if (y <= 1.5e-27) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 = -x / (z - 1.0d0)
if (y <= (-5.9d+66)) then
tmp = t_1
else if (y <= (-9.8d-96)) then
tmp = t / (b - y)
else if (y <= 1.5d-27) then
tmp = (t - a) / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -x / (z - 1.0);
double tmp;
if (y <= -5.9e+66) {
tmp = t_1;
} else if (y <= -9.8e-96) {
tmp = t / (b - y);
} else if (y <= 1.5e-27) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -x / (z - 1.0) tmp = 0 if y <= -5.9e+66: tmp = t_1 elif y <= -9.8e-96: tmp = t / (b - y) elif y <= 1.5e-27: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-x) / Float64(z - 1.0)) tmp = 0.0 if (y <= -5.9e+66) tmp = t_1; elseif (y <= -9.8e-96) tmp = Float64(t / Float64(b - y)); elseif (y <= 1.5e-27) tmp = Float64(Float64(t - a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -x / (z - 1.0); tmp = 0.0; if (y <= -5.9e+66) tmp = t_1; elseif (y <= -9.8e-96) tmp = t / (b - y); elseif (y <= 1.5e-27) tmp = (t - a) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-x) / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.9e+66], t$95$1, If[LessEqual[y, -9.8e-96], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-27], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{z - 1}\\
\mathbf{if}\;y \leq -5.9 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9.8 \cdot 10^{-96}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-27}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.89999999999999988e66 or 1.5000000000000001e-27 < y Initial program 51.6%
Taylor expanded in y around -inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f6454.0
Applied rewrites54.0%
if -5.89999999999999988e66 < y < -9.80000000000000033e-96Initial program 76.3%
Taylor expanded in t around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6427.2
Applied rewrites27.2%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f6426.8
Applied rewrites26.8%
if -9.80000000000000033e-96 < y < 1.5000000000000001e-27Initial program 80.6%
Taylor expanded in y around 0
lower-/.f64N/A
lift--.f6462.0
Applied rewrites62.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.52e+165) (+ x (* x z)) (if (<= y -9.8e-96) (/ t (- b y)) (if (<= y 9e+78) (/ (- t a) b) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.52e+165) {
tmp = x + (x * z);
} else if (y <= -9.8e-96) {
tmp = t / (b - y);
} else if (y <= 9e+78) {
tmp = (t - a) / b;
} 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 (y <= (-1.52d+165)) then
tmp = x + (x * z)
else if (y <= (-9.8d-96)) then
tmp = t / (b - y)
else if (y <= 9d+78) then
tmp = (t - a) / b
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 (y <= -1.52e+165) {
tmp = x + (x * z);
} else if (y <= -9.8e-96) {
tmp = t / (b - y);
} else if (y <= 9e+78) {
tmp = (t - a) / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.52e+165: tmp = x + (x * z) elif y <= -9.8e-96: tmp = t / (b - y) elif y <= 9e+78: tmp = (t - a) / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.52e+165) tmp = Float64(x + Float64(x * z)); elseif (y <= -9.8e-96) tmp = Float64(t / Float64(b - y)); elseif (y <= 9e+78) tmp = Float64(Float64(t - a) / b); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.52e+165) tmp = x + (x * z); elseif (y <= -9.8e-96) tmp = t / (b - y); elseif (y <= 9e+78) tmp = (t - a) / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.52e+165], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9.8e-96], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+78], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.52 \cdot 10^{+165}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{elif}\;y \leq -9.8 \cdot 10^{-96}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+78}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.52000000000000008e165Initial program 39.6%
Taylor expanded in y around -inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f6463.9
Applied rewrites63.9%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f6442.5
Applied rewrites42.5%
if -1.52000000000000008e165 < y < -9.80000000000000033e-96Initial program 69.1%
Taylor expanded in t around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6422.7
Applied rewrites22.7%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f6425.1
Applied rewrites25.1%
if -9.80000000000000033e-96 < y < 8.9999999999999999e78Initial program 78.9%
Taylor expanded in y around 0
lower-/.f64N/A
lift--.f6456.2
Applied rewrites56.2%
if 8.9999999999999999e78 < y Initial program 47.9%
Taylor expanded in z around 0
Applied rewrites41.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ t (- b y)))) (if (<= z -185000.0) t_1 (if (<= z 2.1e-27) (+ x (* x z)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -185000.0) {
tmp = t_1;
} else if (z <= 2.1e-27) {
tmp = x + (x * 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 = t / (b - y)
if (z <= (-185000.0d0)) then
tmp = t_1
else if (z <= 2.1d-27) then
tmp = x + (x * 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 = t / (b - y);
double tmp;
if (z <= -185000.0) {
tmp = t_1;
} else if (z <= 2.1e-27) {
tmp = x + (x * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -185000.0: tmp = t_1 elif z <= 2.1e-27: tmp = x + (x * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -185000.0) tmp = t_1; elseif (z <= 2.1e-27) tmp = Float64(x + Float64(x * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -185000.0) tmp = t_1; elseif (z <= 2.1e-27) tmp = x + (x * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -185000.0], t$95$1, If[LessEqual[z, 2.1e-27], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -185000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-27}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -185000 or 2.10000000000000015e-27 < z Initial program 46.9%
Taylor expanded in t around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6428.6
Applied rewrites28.6%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f6441.8
Applied rewrites41.8%
if -185000 < z < 2.10000000000000015e-27Initial program 87.3%
Taylor expanded in y around -inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f6449.7
Applied rewrites49.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f6449.2
Applied rewrites49.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ t (- b y)))) (if (<= z -31000000.0) t_1 (if (<= z 2.1e-27) x t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -31000000.0) {
tmp = t_1;
} else if (z <= 2.1e-27) {
tmp = 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 = t / (b - y)
if (z <= (-31000000.0d0)) then
tmp = t_1
else if (z <= 2.1d-27) then
tmp = 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 = t / (b - y);
double tmp;
if (z <= -31000000.0) {
tmp = t_1;
} else if (z <= 2.1e-27) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -31000000.0: tmp = t_1 elif z <= 2.1e-27: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -31000000.0) tmp = t_1; elseif (z <= 2.1e-27) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -31000000.0) tmp = t_1; elseif (z <= 2.1e-27) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -31000000.0], t$95$1, If[LessEqual[z, 2.1e-27], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -31000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.1e7 or 2.10000000000000015e-27 < z Initial program 46.8%
Taylor expanded in t around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6428.5
Applied rewrites28.5%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f6441.8
Applied rewrites41.8%
if -3.1e7 < z < 2.10000000000000015e-27Initial program 87.3%
Taylor expanded in z around 0
Applied rewrites48.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.32e+165) x (if (<= y -7.8e-103) (/ t b) (if (<= y 1.5e-27) (/ (- a) b) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.32e+165) {
tmp = x;
} else if (y <= -7.8e-103) {
tmp = t / b;
} else if (y <= 1.5e-27) {
tmp = -a / b;
} 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 (y <= (-1.32d+165)) then
tmp = x
else if (y <= (-7.8d-103)) then
tmp = t / b
else if (y <= 1.5d-27) then
tmp = -a / b
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 (y <= -1.32e+165) {
tmp = x;
} else if (y <= -7.8e-103) {
tmp = t / b;
} else if (y <= 1.5e-27) {
tmp = -a / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.32e+165: tmp = x elif y <= -7.8e-103: tmp = t / b elif y <= 1.5e-27: tmp = -a / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.32e+165) tmp = x; elseif (y <= -7.8e-103) tmp = Float64(t / b); elseif (y <= 1.5e-27) tmp = Float64(Float64(-a) / b); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.32e+165) tmp = x; elseif (y <= -7.8e-103) tmp = t / b; elseif (y <= 1.5e-27) tmp = -a / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.32e+165], x, If[LessEqual[y, -7.8e-103], N[(t / b), $MachinePrecision], If[LessEqual[y, 1.5e-27], N[((-a) / b), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.32 \cdot 10^{+165}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -7.8 \cdot 10^{-103}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-27}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.31999999999999998e165 or 1.5000000000000001e-27 < y Initial program 50.4%
Taylor expanded in z around 0
Applied rewrites38.9%
if -1.31999999999999998e165 < y < -7.8000000000000004e-103Initial program 69.4%
Taylor expanded in t around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6423.1
Applied rewrites23.1%
Taylor expanded in y around 0
lower-/.f6415.3
Applied rewrites15.3%
if -7.8000000000000004e-103 < y < 1.5000000000000001e-27Initial program 80.7%
Taylor expanded in t around 0
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6451.4
Applied rewrites51.4%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lift-neg.f6435.2
Applied rewrites35.2%
(FPCore (x y z t a b) :precision binary64 (if (<= z -35000000.0) (/ t b) (if (<= z 2.1e-27) x (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -35000000.0) {
tmp = t / b;
} else if (z <= 2.1e-27) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 (z <= (-35000000.0d0)) then
tmp = t / b
else if (z <= 2.1d-27) then
tmp = x
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -35000000.0) {
tmp = t / b;
} else if (z <= 2.1e-27) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -35000000.0: tmp = t / b elif z <= 2.1e-27: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -35000000.0) tmp = Float64(t / b); elseif (z <= 2.1e-27) tmp = x; else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -35000000.0) tmp = t / b; elseif (z <= 2.1e-27) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -35000000.0], N[(t / b), $MachinePrecision], If[LessEqual[z, 2.1e-27], x, N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -35000000:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -3.5e7 or 2.10000000000000015e-27 < z Initial program 46.8%
Taylor expanded in t around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6428.5
Applied rewrites28.5%
Taylor expanded in y around 0
lower-/.f6426.7
Applied rewrites26.7%
if -3.5e7 < z < 2.10000000000000015e-27Initial program 87.3%
Taylor expanded in z around 0
Applied rewrites48.9%
(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 66.5%
Taylor expanded in z around 0
Applied rewrites26.0%
herbie shell --seed 2025101
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))