
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
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)
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
code = x + (((y - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
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)
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
code = x + (((y - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) (- a z)) x)))
(if (<= a -1.65e+41)
t_1
(if (<= a 1.25e-23) (+ (- (* (- t x) (/ (- y a) z))) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / (a - z)), x);
double tmp;
if (a <= -1.65e+41) {
tmp = t_1;
} else if (a <= 1.25e-23) {
tmp = -((t - x) * ((y - a) / z)) + t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / Float64(a - z)), x) tmp = 0.0 if (a <= -1.65e+41) tmp = t_1; elseif (a <= 1.25e-23) tmp = Float64(Float64(-Float64(Float64(t - x) * Float64(Float64(y - a) / z))) + t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.65e+41], t$95$1, If[LessEqual[a, 1.25e-23], N[((-N[(N[(t - x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]) + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\
\mathbf{if}\;a \leq -1.65 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-23}:\\
\;\;\;\;\left(-\left(t - x\right) \cdot \frac{y - a}{z}\right) + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.65e41 or 1.2500000000000001e-23 < a Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.2
Applied rewrites79.2%
if -1.65e41 < a < 1.2500000000000001e-23Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
associate-/l*N/A
sub-divN/A
lower-*.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- (* (- x) (/ (- y a) z))) t)))
(if (<= z -1.1e+22)
t_1
(if (<= z -2.2e-155)
(+ x (/ (* (- y z) t) (- a z)))
(if (<= z 2.4e-111)
(fma (- t x) (/ (- y z) a) x)
(if (<= z 3.4e+44) (+ x (/ (* (- t x) y) (- a z))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -(-x * ((y - a) / z)) + t;
double tmp;
if (z <= -1.1e+22) {
tmp = t_1;
} else if (z <= -2.2e-155) {
tmp = x + (((y - z) * t) / (a - z));
} else if (z <= 2.4e-111) {
tmp = fma((t - x), ((y - z) / a), x);
} else if (z <= 3.4e+44) {
tmp = x + (((t - x) * y) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(-Float64(Float64(-x) * Float64(Float64(y - a) / z))) + t) tmp = 0.0 if (z <= -1.1e+22) tmp = t_1; elseif (z <= -2.2e-155) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); elseif (z <= 2.4e-111) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); elseif (z <= 3.4e+44) tmp = Float64(x + Float64(Float64(Float64(t - x) * y) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-N[((-x) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]) + t), $MachinePrecision]}, If[LessEqual[z, -1.1e+22], t$95$1, If[LessEqual[z, -2.2e-155], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-111], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 3.4e+44], N[(x + N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\left(-x\right) \cdot \frac{y - a}{z}\right) + t\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-155}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-111}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+44}:\\
\;\;\;\;x + \frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.1e22 or 3.4e44 < z Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
associate-/l*N/A
sub-divN/A
lower-*.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6445.9
Applied rewrites45.9%
if -1.1e22 < z < -2.1999999999999999e-155Initial program 68.3%
Taylor expanded in x around 0
Applied rewrites55.7%
if -2.1999999999999999e-155 < z < 2.4000000000000001e-111Initial program 68.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.3
Applied rewrites53.3%
if 2.4000000000000001e-111 < z < 3.4e44Initial program 68.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6454.8
Applied rewrites54.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- y z) a) x)))
(if (<= a -2.1e+111)
t_1
(if (<= a 5.6e-15) (+ (- (* (- t x) (/ (- y a) z))) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((y - z) / a), x);
double tmp;
if (a <= -2.1e+111) {
tmp = t_1;
} else if (a <= 5.6e-15) {
tmp = -((t - x) * ((y - a) / z)) + t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(y - z) / a), x) tmp = 0.0 if (a <= -2.1e+111) tmp = t_1; elseif (a <= 5.6e-15) tmp = Float64(Float64(-Float64(Float64(t - x) * Float64(Float64(y - a) / z))) + t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.1e+111], t$95$1, If[LessEqual[a, 5.6e-15], N[((-N[(N[(t - x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]) + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{if}\;a \leq -2.1 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.6 \cdot 10^{-15}:\\
\;\;\;\;\left(-\left(t - x\right) \cdot \frac{y - a}{z}\right) + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.09999999999999995e111 or 5.60000000000000028e-15 < a Initial program 68.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.3
Applied rewrites53.3%
if -2.09999999999999995e111 < a < 5.60000000000000028e-15Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
associate-/l*N/A
sub-divN/A
lower-*.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- y z) a) x)))
(if (<= a -2.1e+111)
t_1
(if (<= a -3e-51)
(+ (- (* (- x) (/ (- y a) z))) t)
(if (<= a 2e-15) (+ (- (* (- t x) (/ y z))) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((y - z) / a), x);
double tmp;
if (a <= -2.1e+111) {
tmp = t_1;
} else if (a <= -3e-51) {
tmp = -(-x * ((y - a) / z)) + t;
} else if (a <= 2e-15) {
tmp = -((t - x) * (y / z)) + t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(y - z) / a), x) tmp = 0.0 if (a <= -2.1e+111) tmp = t_1; elseif (a <= -3e-51) tmp = Float64(Float64(-Float64(Float64(-x) * Float64(Float64(y - a) / z))) + t); elseif (a <= 2e-15) tmp = Float64(Float64(-Float64(Float64(t - x) * Float64(y / z))) + t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.1e+111], t$95$1, If[LessEqual[a, -3e-51], N[((-N[((-x) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]) + t), $MachinePrecision], If[LessEqual[a, 2e-15], N[((-N[(N[(t - x), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]) + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{if}\;a \leq -2.1 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3 \cdot 10^{-51}:\\
\;\;\;\;\left(-\left(-x\right) \cdot \frac{y - a}{z}\right) + t\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-15}:\\
\;\;\;\;\left(-\left(t - x\right) \cdot \frac{y}{z}\right) + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.09999999999999995e111 or 2.0000000000000002e-15 < a Initial program 68.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.3
Applied rewrites53.3%
if -2.09999999999999995e111 < a < -3.00000000000000002e-51Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
associate-/l*N/A
sub-divN/A
lower-*.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6445.9
Applied rewrites45.9%
if -3.00000000000000002e-51 < a < 2.0000000000000002e-15Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
associate-/l*N/A
sub-divN/A
lower-*.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
Taylor expanded in y around inf
lower-/.f6448.7
Applied rewrites48.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- y z) a) x)))
(if (<= a -7.6e+58)
t_1
(if (<= a -2.95e-46)
(- t (- (* a (/ (- t x) z))))
(if (<= a 2e-15) (+ (- (* (- t x) (/ y z))) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((y - z) / a), x);
double tmp;
if (a <= -7.6e+58) {
tmp = t_1;
} else if (a <= -2.95e-46) {
tmp = t - -(a * ((t - x) / z));
} else if (a <= 2e-15) {
tmp = -((t - x) * (y / z)) + t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(y - z) / a), x) tmp = 0.0 if (a <= -7.6e+58) tmp = t_1; elseif (a <= -2.95e-46) tmp = Float64(t - Float64(-Float64(a * Float64(Float64(t - x) / z)))); elseif (a <= 2e-15) tmp = Float64(Float64(-Float64(Float64(t - x) * Float64(y / z))) + t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -7.6e+58], t$95$1, If[LessEqual[a, -2.95e-46], N[(t - (-N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[a, 2e-15], N[((-N[(N[(t - x), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]) + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{if}\;a \leq -7.6 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.95 \cdot 10^{-46}:\\
\;\;\;\;t - \left(-a \cdot \frac{t - x}{z}\right)\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-15}:\\
\;\;\;\;\left(-\left(t - x\right) \cdot \frac{y}{z}\right) + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.5999999999999997e58 or 2.0000000000000002e-15 < a Initial program 68.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.3
Applied rewrites53.3%
if -7.5999999999999997e58 < a < -2.95e-46Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6447.4
Applied rewrites47.4%
Taylor expanded in y around 0
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6432.8
Applied rewrites32.8%
if -2.95e-46 < a < 2.0000000000000002e-15Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
associate-/l*N/A
sub-divN/A
lower-*.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
Taylor expanded in y around inf
lower-/.f6448.7
Applied rewrites48.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.1e+111) (fma t (/ (- y z) a) x) (if (<= a 2e-15) (+ (- (* (- t x) (/ y z))) t) (fma y (/ (- t x) a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.1e+111) {
tmp = fma(t, ((y - z) / a), x);
} else if (a <= 2e-15) {
tmp = -((t - x) * (y / z)) + t;
} else {
tmp = fma(y, ((t - x) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.1e+111) tmp = fma(t, Float64(Float64(y - z) / a), x); elseif (a <= 2e-15) tmp = Float64(Float64(-Float64(Float64(t - x) * Float64(y / z))) + t); else tmp = fma(y, Float64(Float64(t - x) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.1e+111], N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 2e-15], N[((-N[(N[(t - x), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]) + t), $MachinePrecision], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{+111}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y - z}{a}, x\right)\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-15}:\\
\;\;\;\;\left(-\left(t - x\right) \cdot \frac{y}{z}\right) + t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\end{array}
\end{array}
if a < -2.09999999999999995e111Initial program 68.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.3
Applied rewrites53.3%
Taylor expanded in x around 0
Applied rewrites45.3%
if -2.09999999999999995e111 < a < 2.0000000000000002e-15Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
associate-/l*N/A
sub-divN/A
lower-*.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
Taylor expanded in y around inf
lower-/.f6448.7
Applied rewrites48.7%
if 2.0000000000000002e-15 < a Initial program 68.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.5
Applied rewrites47.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.1e+111) (fma t (/ (- y z) a) x) (if (<= a 1.6e-15) (- t (* (/ (- t x) z) y)) (fma y (/ (- t x) a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.1e+111) {
tmp = fma(t, ((y - z) / a), x);
} else if (a <= 1.6e-15) {
tmp = t - (((t - x) / z) * y);
} else {
tmp = fma(y, ((t - x) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.1e+111) tmp = fma(t, Float64(Float64(y - z) / a), x); elseif (a <= 1.6e-15) tmp = Float64(t - Float64(Float64(Float64(t - x) / z) * y)); else tmp = fma(y, Float64(Float64(t - x) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.1e+111], N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.6e-15], N[(t - N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{+111}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y - z}{a}, x\right)\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{-15}:\\
\;\;\;\;t - \frac{t - x}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\end{array}
\end{array}
if a < -2.09999999999999995e111Initial program 68.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.3
Applied rewrites53.3%
Taylor expanded in x around 0
Applied rewrites45.3%
if -2.09999999999999995e111 < a < 1.6e-15Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6447.4
Applied rewrites47.4%
if 1.6e-15 < a Initial program 68.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.5
Applied rewrites47.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- t (/ (* (- x) y) z)))) (if (<= z -2.9e+18) t_1 (if (<= z 1.15e+28) (fma (- t x) (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((-x * y) / z);
double tmp;
if (z <= -2.9e+18) {
tmp = t_1;
} else if (z <= 1.15e+28) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(Float64(-x) * y) / z)) tmp = 0.0 if (z <= -2.9e+18) tmp = t_1; elseif (z <= 1.15e+28) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[((-x) * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+18], t$95$1, If[LessEqual[z, 1.15e+28], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{\left(-x\right) \cdot y}{z}\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.9e18 or 1.14999999999999992e28 < z Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6447.4
Applied rewrites47.4%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6438.5
Applied rewrites38.5%
if -2.9e18 < z < 1.14999999999999992e28Initial program 68.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.3
Applied rewrites53.3%
Taylor expanded in y around inf
lower-/.f6448.8
Applied rewrites48.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- t (/ (* (- x) y) z)))) (if (<= z -2.9e+18) t_1 (if (<= z 1.15e+28) (fma y (/ (- t x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((-x * y) / z);
double tmp;
if (z <= -2.9e+18) {
tmp = t_1;
} else if (z <= 1.15e+28) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(Float64(-x) * y) / z)) tmp = 0.0 if (z <= -2.9e+18) tmp = t_1; elseif (z <= 1.15e+28) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[((-x) * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+18], t$95$1, If[LessEqual[z, 1.15e+28], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{\left(-x\right) \cdot y}{z}\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.9e18 or 1.14999999999999992e28 < z Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6447.4
Applied rewrites47.4%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6438.5
Applied rewrites38.5%
if -2.9e18 < z < 1.14999999999999992e28Initial program 68.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.5
Applied rewrites47.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (/ (* (- x) y) z))))
(if (<= z -8.5e+19)
t_1
(if (<= z -1.15e-163)
(* t (/ y (- a z)))
(if (<= z 5e-45) (* (- t x) (/ y a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((-x * y) / z);
double tmp;
if (z <= -8.5e+19) {
tmp = t_1;
} else if (z <= -1.15e-163) {
tmp = t * (y / (a - z));
} else if (z <= 5e-45) {
tmp = (t - x) * (y / a);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = t - ((-x * y) / z)
if (z <= (-8.5d+19)) then
tmp = t_1
else if (z <= (-1.15d-163)) then
tmp = t * (y / (a - z))
else if (z <= 5d-45) then
tmp = (t - x) * (y / a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((-x * y) / z);
double tmp;
if (z <= -8.5e+19) {
tmp = t_1;
} else if (z <= -1.15e-163) {
tmp = t * (y / (a - z));
} else if (z <= 5e-45) {
tmp = (t - x) * (y / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - ((-x * y) / z) tmp = 0 if z <= -8.5e+19: tmp = t_1 elif z <= -1.15e-163: tmp = t * (y / (a - z)) elif z <= 5e-45: tmp = (t - x) * (y / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(Float64(-x) * y) / z)) tmp = 0.0 if (z <= -8.5e+19) tmp = t_1; elseif (z <= -1.15e-163) tmp = Float64(t * Float64(y / Float64(a - z))); elseif (z <= 5e-45) tmp = Float64(Float64(t - x) * Float64(y / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - ((-x * y) / z); tmp = 0.0; if (z <= -8.5e+19) tmp = t_1; elseif (z <= -1.15e-163) tmp = t * (y / (a - z)); elseif (z <= 5e-45) tmp = (t - x) * (y / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[((-x) * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+19], t$95$1, If[LessEqual[z, -1.15e-163], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-45], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{\left(-x\right) \cdot y}{z}\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-163}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-45}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.5e19 or 4.99999999999999976e-45 < z Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6447.4
Applied rewrites47.4%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6438.5
Applied rewrites38.5%
if -8.5e19 < z < -1.15e-163Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.3
Applied rewrites39.3%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6424.3
Applied rewrites24.3%
if -1.15e-163 < z < 4.99999999999999976e-45Initial program 68.3%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6438.4
Applied rewrites38.4%
Taylor expanded in z around 0
Applied rewrites24.1%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f6426.7
Applied rewrites26.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- 1.0 (/ y z)) t)))
(if (<= z -1.75e+55)
t_1
(if (<= z -7.5e-112)
(* (/ (- x t) z) y)
(if (<= z 6e-45)
(* (/ (- t x) a) y)
(if (<= z 4.5e+31) (/ (* (- y a) x) z) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (1.0 - (y / z)) * t;
double tmp;
if (z <= -1.75e+55) {
tmp = t_1;
} else if (z <= -7.5e-112) {
tmp = ((x - t) / z) * y;
} else if (z <= 6e-45) {
tmp = ((t - x) / a) * y;
} else if (z <= 4.5e+31) {
tmp = ((y - a) * 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)
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) :: t_1
real(8) :: tmp
t_1 = (1.0d0 - (y / z)) * t
if (z <= (-1.75d+55)) then
tmp = t_1
else if (z <= (-7.5d-112)) then
tmp = ((x - t) / z) * y
else if (z <= 6d-45) then
tmp = ((t - x) / a) * y
else if (z <= 4.5d+31) then
tmp = ((y - a) * 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 t_1 = (1.0 - (y / z)) * t;
double tmp;
if (z <= -1.75e+55) {
tmp = t_1;
} else if (z <= -7.5e-112) {
tmp = ((x - t) / z) * y;
} else if (z <= 6e-45) {
tmp = ((t - x) / a) * y;
} else if (z <= 4.5e+31) {
tmp = ((y - a) * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (1.0 - (y / z)) * t tmp = 0 if z <= -1.75e+55: tmp = t_1 elif z <= -7.5e-112: tmp = ((x - t) / z) * y elif z <= 6e-45: tmp = ((t - x) / a) * y elif z <= 4.5e+31: tmp = ((y - a) * x) / z else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(1.0 - Float64(y / z)) * t) tmp = 0.0 if (z <= -1.75e+55) tmp = t_1; elseif (z <= -7.5e-112) tmp = Float64(Float64(Float64(x - t) / z) * y); elseif (z <= 6e-45) tmp = Float64(Float64(Float64(t - x) / a) * y); elseif (z <= 4.5e+31) tmp = Float64(Float64(Float64(y - a) * x) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (1.0 - (y / z)) * t; tmp = 0.0; if (z <= -1.75e+55) tmp = t_1; elseif (z <= -7.5e-112) tmp = ((x - t) / z) * y; elseif (z <= 6e-45) tmp = ((t - x) / a) * y; elseif (z <= 4.5e+31) tmp = ((y - a) * x) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[z, -1.75e+55], t$95$1, If[LessEqual[z, -7.5e-112], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 6e-45], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 4.5e+31], N[(N[(N[(y - a), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - \frac{y}{z}\right) \cdot t\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-112}:\\
\;\;\;\;\frac{x - t}{z} \cdot y\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-45}:\\
\;\;\;\;\frac{t - x}{a} \cdot y\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+31}:\\
\;\;\;\;\frac{\left(y - a\right) \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.75000000000000005e55 or 4.4999999999999996e31 < z Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.3
Applied rewrites39.3%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6426.8
Applied rewrites26.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f6436.2
Applied rewrites36.2%
if -1.75000000000000005e55 < z < -7.5000000000000002e-112Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6425.7
Applied rewrites25.7%
if -7.5000000000000002e-112 < z < 6.00000000000000022e-45Initial program 68.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.3
Applied rewrites53.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6426.0
Applied rewrites26.0%
if 6.00000000000000022e-45 < z < 4.4999999999999996e31Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in x around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6420.5
Applied rewrites20.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- 1.0 (/ y z)) t)))
(if (<= z -1.75e+55)
t_1
(if (<= z -7.5e-112)
(* (/ (- x t) z) y)
(if (<= z 2.6e+31) (* (- t x) (/ y a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (1.0 - (y / z)) * t;
double tmp;
if (z <= -1.75e+55) {
tmp = t_1;
} else if (z <= -7.5e-112) {
tmp = ((x - t) / z) * y;
} else if (z <= 2.6e+31) {
tmp = (t - x) * (y / a);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = (1.0d0 - (y / z)) * t
if (z <= (-1.75d+55)) then
tmp = t_1
else if (z <= (-7.5d-112)) then
tmp = ((x - t) / z) * y
else if (z <= 2.6d+31) then
tmp = (t - x) * (y / a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (1.0 - (y / z)) * t;
double tmp;
if (z <= -1.75e+55) {
tmp = t_1;
} else if (z <= -7.5e-112) {
tmp = ((x - t) / z) * y;
} else if (z <= 2.6e+31) {
tmp = (t - x) * (y / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (1.0 - (y / z)) * t tmp = 0 if z <= -1.75e+55: tmp = t_1 elif z <= -7.5e-112: tmp = ((x - t) / z) * y elif z <= 2.6e+31: tmp = (t - x) * (y / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(1.0 - Float64(y / z)) * t) tmp = 0.0 if (z <= -1.75e+55) tmp = t_1; elseif (z <= -7.5e-112) tmp = Float64(Float64(Float64(x - t) / z) * y); elseif (z <= 2.6e+31) tmp = Float64(Float64(t - x) * Float64(y / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (1.0 - (y / z)) * t; tmp = 0.0; if (z <= -1.75e+55) tmp = t_1; elseif (z <= -7.5e-112) tmp = ((x - t) / z) * y; elseif (z <= 2.6e+31) tmp = (t - x) * (y / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[z, -1.75e+55], t$95$1, If[LessEqual[z, -7.5e-112], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 2.6e+31], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - \frac{y}{z}\right) \cdot t\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-112}:\\
\;\;\;\;\frac{x - t}{z} \cdot y\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+31}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.75000000000000005e55 or 2.6e31 < z Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.3
Applied rewrites39.3%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6426.8
Applied rewrites26.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f6436.2
Applied rewrites36.2%
if -1.75000000000000005e55 < z < -7.5000000000000002e-112Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6425.7
Applied rewrites25.7%
if -7.5000000000000002e-112 < z < 2.6e31Initial program 68.3%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6438.4
Applied rewrites38.4%
Taylor expanded in z around 0
Applied rewrites24.1%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f6426.7
Applied rewrites26.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (- t))))
(if (<= z -1.75e+55)
t_1
(if (<= z -7.5e-112)
(* (/ (- x t) z) y)
(if (<= z 6e-45)
(* (/ (- t x) a) y)
(if (<= z 7.4e+31) (/ (* (- y a) x) z) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -(-t);
double tmp;
if (z <= -1.75e+55) {
tmp = t_1;
} else if (z <= -7.5e-112) {
tmp = ((x - t) / z) * y;
} else if (z <= 6e-45) {
tmp = ((t - x) / a) * y;
} else if (z <= 7.4e+31) {
tmp = ((y - a) * 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)
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) :: t_1
real(8) :: tmp
t_1 = -(-t)
if (z <= (-1.75d+55)) then
tmp = t_1
else if (z <= (-7.5d-112)) then
tmp = ((x - t) / z) * y
else if (z <= 6d-45) then
tmp = ((t - x) / a) * y
else if (z <= 7.4d+31) then
tmp = ((y - a) * 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 t_1 = -(-t);
double tmp;
if (z <= -1.75e+55) {
tmp = t_1;
} else if (z <= -7.5e-112) {
tmp = ((x - t) / z) * y;
} else if (z <= 6e-45) {
tmp = ((t - x) / a) * y;
} else if (z <= 7.4e+31) {
tmp = ((y - a) * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -(-t) tmp = 0 if z <= -1.75e+55: tmp = t_1 elif z <= -7.5e-112: tmp = ((x - t) / z) * y elif z <= 6e-45: tmp = ((t - x) / a) * y elif z <= 7.4e+31: tmp = ((y - a) * x) / z else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-Float64(-t)) tmp = 0.0 if (z <= -1.75e+55) tmp = t_1; elseif (z <= -7.5e-112) tmp = Float64(Float64(Float64(x - t) / z) * y); elseif (z <= 6e-45) tmp = Float64(Float64(Float64(t - x) / a) * y); elseif (z <= 7.4e+31) tmp = Float64(Float64(Float64(y - a) * x) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -(-t); tmp = 0.0; if (z <= -1.75e+55) tmp = t_1; elseif (z <= -7.5e-112) tmp = ((x - t) / z) * y; elseif (z <= 6e-45) tmp = ((t - x) / a) * y; elseif (z <= 7.4e+31) tmp = ((y - a) * x) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = (-(-t))}, If[LessEqual[z, -1.75e+55], t$95$1, If[LessEqual[z, -7.5e-112], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 6e-45], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 7.4e+31], N[(N[(N[(y - a), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\left(-t\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-112}:\\
\;\;\;\;\frac{x - t}{z} \cdot y\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-45}:\\
\;\;\;\;\frac{t - x}{a} \cdot y\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{+31}:\\
\;\;\;\;\frac{\left(y - a\right) \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.75000000000000005e55 or 7.3999999999999996e31 < z Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.3
Applied rewrites39.3%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6426.8
Applied rewrites26.8%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6425.1
Applied rewrites25.1%
if -1.75000000000000005e55 < z < -7.5000000000000002e-112Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6425.7
Applied rewrites25.7%
if -7.5000000000000002e-112 < z < 6.00000000000000022e-45Initial program 68.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.3
Applied rewrites53.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6426.0
Applied rewrites26.0%
if 6.00000000000000022e-45 < z < 7.3999999999999996e31Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in x around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6420.5
Applied rewrites20.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (- t))))
(if (<= z -1.75e+55)
t_1
(if (<= z -7.5e-113)
(* (/ (- x t) z) y)
(if (<= z 2.4e-45)
(* t (/ y a))
(if (<= z 7.4e+31) (/ (* (- y a) x) z) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -(-t);
double tmp;
if (z <= -1.75e+55) {
tmp = t_1;
} else if (z <= -7.5e-113) {
tmp = ((x - t) / z) * y;
} else if (z <= 2.4e-45) {
tmp = t * (y / a);
} else if (z <= 7.4e+31) {
tmp = ((y - a) * 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)
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) :: t_1
real(8) :: tmp
t_1 = -(-t)
if (z <= (-1.75d+55)) then
tmp = t_1
else if (z <= (-7.5d-113)) then
tmp = ((x - t) / z) * y
else if (z <= 2.4d-45) then
tmp = t * (y / a)
else if (z <= 7.4d+31) then
tmp = ((y - a) * 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 t_1 = -(-t);
double tmp;
if (z <= -1.75e+55) {
tmp = t_1;
} else if (z <= -7.5e-113) {
tmp = ((x - t) / z) * y;
} else if (z <= 2.4e-45) {
tmp = t * (y / a);
} else if (z <= 7.4e+31) {
tmp = ((y - a) * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -(-t) tmp = 0 if z <= -1.75e+55: tmp = t_1 elif z <= -7.5e-113: tmp = ((x - t) / z) * y elif z <= 2.4e-45: tmp = t * (y / a) elif z <= 7.4e+31: tmp = ((y - a) * x) / z else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-Float64(-t)) tmp = 0.0 if (z <= -1.75e+55) tmp = t_1; elseif (z <= -7.5e-113) tmp = Float64(Float64(Float64(x - t) / z) * y); elseif (z <= 2.4e-45) tmp = Float64(t * Float64(y / a)); elseif (z <= 7.4e+31) tmp = Float64(Float64(Float64(y - a) * x) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -(-t); tmp = 0.0; if (z <= -1.75e+55) tmp = t_1; elseif (z <= -7.5e-113) tmp = ((x - t) / z) * y; elseif (z <= 2.4e-45) tmp = t * (y / a); elseif (z <= 7.4e+31) tmp = ((y - a) * x) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = (-(-t))}, If[LessEqual[z, -1.75e+55], t$95$1, If[LessEqual[z, -7.5e-113], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 2.4e-45], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.4e+31], N[(N[(N[(y - a), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\left(-t\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-113}:\\
\;\;\;\;\frac{x - t}{z} \cdot y\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-45}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{+31}:\\
\;\;\;\;\frac{\left(y - a\right) \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.75000000000000005e55 or 7.3999999999999996e31 < z Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.3
Applied rewrites39.3%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6426.8
Applied rewrites26.8%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6425.1
Applied rewrites25.1%
if -1.75000000000000005e55 < z < -7.5000000000000002e-113Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6425.7
Applied rewrites25.7%
if -7.5000000000000002e-113 < z < 2.3999999999999999e-45Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.3
Applied rewrites39.3%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6424.3
Applied rewrites24.3%
Taylor expanded in z around 0
Applied rewrites18.9%
if 2.3999999999999999e-45 < z < 7.3999999999999996e31Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in x around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6420.5
Applied rewrites20.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (- t))))
(if (<= z -1.75e+55)
t_1
(if (<= z -7.5e-113)
(* (/ (- x t) z) y)
(if (<= z 2.4e-45)
(* t (/ y a))
(if (<= z 7.4e+31) (* x (/ (- y a) z)) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -(-t);
double tmp;
if (z <= -1.75e+55) {
tmp = t_1;
} else if (z <= -7.5e-113) {
tmp = ((x - t) / z) * y;
} else if (z <= 2.4e-45) {
tmp = t * (y / a);
} else if (z <= 7.4e+31) {
tmp = x * ((y - 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)
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) :: t_1
real(8) :: tmp
t_1 = -(-t)
if (z <= (-1.75d+55)) then
tmp = t_1
else if (z <= (-7.5d-113)) then
tmp = ((x - t) / z) * y
else if (z <= 2.4d-45) then
tmp = t * (y / a)
else if (z <= 7.4d+31) then
tmp = x * ((y - 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 t_1 = -(-t);
double tmp;
if (z <= -1.75e+55) {
tmp = t_1;
} else if (z <= -7.5e-113) {
tmp = ((x - t) / z) * y;
} else if (z <= 2.4e-45) {
tmp = t * (y / a);
} else if (z <= 7.4e+31) {
tmp = x * ((y - a) / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -(-t) tmp = 0 if z <= -1.75e+55: tmp = t_1 elif z <= -7.5e-113: tmp = ((x - t) / z) * y elif z <= 2.4e-45: tmp = t * (y / a) elif z <= 7.4e+31: tmp = x * ((y - a) / z) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-Float64(-t)) tmp = 0.0 if (z <= -1.75e+55) tmp = t_1; elseif (z <= -7.5e-113) tmp = Float64(Float64(Float64(x - t) / z) * y); elseif (z <= 2.4e-45) tmp = Float64(t * Float64(y / a)); elseif (z <= 7.4e+31) tmp = Float64(x * Float64(Float64(y - a) / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -(-t); tmp = 0.0; if (z <= -1.75e+55) tmp = t_1; elseif (z <= -7.5e-113) tmp = ((x - t) / z) * y; elseif (z <= 2.4e-45) tmp = t * (y / a); elseif (z <= 7.4e+31) tmp = x * ((y - a) / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = (-(-t))}, If[LessEqual[z, -1.75e+55], t$95$1, If[LessEqual[z, -7.5e-113], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 2.4e-45], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.4e+31], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\left(-t\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-113}:\\
\;\;\;\;\frac{x - t}{z} \cdot y\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-45}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{+31}:\\
\;\;\;\;x \cdot \frac{y - a}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.75000000000000005e55 or 7.3999999999999996e31 < z Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.3
Applied rewrites39.3%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6426.8
Applied rewrites26.8%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6425.1
Applied rewrites25.1%
if -1.75000000000000005e55 < z < -7.5000000000000002e-113Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6425.7
Applied rewrites25.7%
if -7.5000000000000002e-113 < z < 2.3999999999999999e-45Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.3
Applied rewrites39.3%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6424.3
Applied rewrites24.3%
Taylor expanded in z around 0
Applied rewrites18.9%
if 2.3999999999999999e-45 < z < 7.3999999999999996e31Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
associate-/l*N/A
sub-divN/A
lower-*.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6423.7
Applied rewrites23.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (- t))) (t_2 (* x (/ (- y a) z))))
(if (<= z -4.8e+104)
t_1
(if (<= z -1.02e+15)
t_2
(if (<= z 2.4e-45) (* t (/ y a)) (if (<= z 7.4e+31) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -(-t);
double t_2 = x * ((y - a) / z);
double tmp;
if (z <= -4.8e+104) {
tmp = t_1;
} else if (z <= -1.02e+15) {
tmp = t_2;
} else if (z <= 2.4e-45) {
tmp = t * (y / a);
} else if (z <= 7.4e+31) {
tmp = t_2;
} 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)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -(-t)
t_2 = x * ((y - a) / z)
if (z <= (-4.8d+104)) then
tmp = t_1
else if (z <= (-1.02d+15)) then
tmp = t_2
else if (z <= 2.4d-45) then
tmp = t * (y / a)
else if (z <= 7.4d+31) then
tmp = t_2
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 t_1 = -(-t);
double t_2 = x * ((y - a) / z);
double tmp;
if (z <= -4.8e+104) {
tmp = t_1;
} else if (z <= -1.02e+15) {
tmp = t_2;
} else if (z <= 2.4e-45) {
tmp = t * (y / a);
} else if (z <= 7.4e+31) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -(-t) t_2 = x * ((y - a) / z) tmp = 0 if z <= -4.8e+104: tmp = t_1 elif z <= -1.02e+15: tmp = t_2 elif z <= 2.4e-45: tmp = t * (y / a) elif z <= 7.4e+31: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-Float64(-t)) t_2 = Float64(x * Float64(Float64(y - a) / z)) tmp = 0.0 if (z <= -4.8e+104) tmp = t_1; elseif (z <= -1.02e+15) tmp = t_2; elseif (z <= 2.4e-45) tmp = Float64(t * Float64(y / a)); elseif (z <= 7.4e+31) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -(-t); t_2 = x * ((y - a) / z); tmp = 0.0; if (z <= -4.8e+104) tmp = t_1; elseif (z <= -1.02e+15) tmp = t_2; elseif (z <= 2.4e-45) tmp = t * (y / a); elseif (z <= 7.4e+31) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = (-(-t))}, Block[{t$95$2 = N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+104], t$95$1, If[LessEqual[z, -1.02e+15], t$95$2, If[LessEqual[z, 2.4e-45], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.4e+31], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\left(-t\right)\\
t_2 := x \cdot \frac{y - a}{z}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{+15}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-45}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{+31}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.8e104 or 7.3999999999999996e31 < z Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.3
Applied rewrites39.3%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6426.8
Applied rewrites26.8%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6425.1
Applied rewrites25.1%
if -4.8e104 < z < -1.02e15 or 2.3999999999999999e-45 < z < 7.3999999999999996e31Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
associate-/l*N/A
sub-divN/A
lower-*.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6423.7
Applied rewrites23.7%
if -1.02e15 < z < 2.3999999999999999e-45Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.3
Applied rewrites39.3%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6424.3
Applied rewrites24.3%
Taylor expanded in z around 0
Applied rewrites18.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* t (/ y a)))) (if (<= y -3.3e+57) t_1 (if (<= y 5.6e+178) (+ x t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / a);
double tmp;
if (y <= -3.3e+57) {
tmp = t_1;
} else if (y <= 5.6e+178) {
tmp = x + t;
} 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)
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) :: t_1
real(8) :: tmp
t_1 = t * (y / a)
if (y <= (-3.3d+57)) then
tmp = t_1
else if (y <= 5.6d+178) then
tmp = x + t
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 t_1 = t * (y / a);
double tmp;
if (y <= -3.3e+57) {
tmp = t_1;
} else if (y <= 5.6e+178) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / a) tmp = 0 if y <= -3.3e+57: tmp = t_1 elif y <= 5.6e+178: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / a)) tmp = 0.0 if (y <= -3.3e+57) tmp = t_1; elseif (y <= 5.6e+178) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y / a); tmp = 0.0; if (y <= -3.3e+57) tmp = t_1; elseif (y <= 5.6e+178) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.3e+57], t$95$1, If[LessEqual[y, 5.6e+178], N[(x + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a}\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+178}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.3000000000000001e57 or 5.59999999999999986e178 < y Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.3
Applied rewrites39.3%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6424.3
Applied rewrites24.3%
Taylor expanded in z around 0
Applied rewrites18.9%
if -3.3000000000000001e57 < y < 5.59999999999999986e178Initial program 68.3%
Taylor expanded in z around inf
lift--.f6419.1
Applied rewrites19.1%
Taylor expanded in x around 0
Applied rewrites33.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -9e-35) (+ x t) (if (<= a 1.35e-6) (- (- t)) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9e-35) {
tmp = x + t;
} else if (a <= 1.35e-6) {
tmp = -(-t);
} else {
tmp = x + t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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) :: tmp
if (a <= (-9d-35)) then
tmp = x + t
else if (a <= 1.35d-6) then
tmp = -(-t)
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9e-35) {
tmp = x + t;
} else if (a <= 1.35e-6) {
tmp = -(-t);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9e-35: tmp = x + t elif a <= 1.35e-6: tmp = -(-t) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9e-35) tmp = Float64(x + t); elseif (a <= 1.35e-6) tmp = Float64(-Float64(-t)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9e-35) tmp = x + t; elseif (a <= 1.35e-6) tmp = -(-t); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9e-35], N[(x + t), $MachinePrecision], If[LessEqual[a, 1.35e-6], (-(-t)), N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{-35}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-6}:\\
\;\;\;\;-\left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if a < -9.0000000000000002e-35 or 1.34999999999999999e-6 < a Initial program 68.3%
Taylor expanded in z around inf
lift--.f6419.1
Applied rewrites19.1%
Taylor expanded in x around 0
Applied rewrites33.9%
if -9.0000000000000002e-35 < a < 1.34999999999999999e-6Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.3
Applied rewrites39.3%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6426.8
Applied rewrites26.8%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6425.1
Applied rewrites25.1%
(FPCore (x y z t a) :precision binary64 (- (- t)))
double code(double x, double y, double z, double t, double a) {
return -(-t);
}
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)
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
code = -(-t)
end function
public static double code(double x, double y, double z, double t, double a) {
return -(-t);
}
def code(x, y, z, t, a): return -(-t)
function code(x, y, z, t, a) return Float64(-Float64(-t)) end
function tmp = code(x, y, z, t, a) tmp = -(-t); end
code[x_, y_, z_, t_, a_] := (-(-t))
\begin{array}{l}
\\
-\left(-t\right)
\end{array}
Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.3
Applied rewrites39.3%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6426.8
Applied rewrites26.8%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6425.1
Applied rewrites25.1%
herbie shell --seed 2025142
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
(+ x (/ (* (- y z) (- t x)) (- a z))))