
(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(y - z) * Float64(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[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
Herbie found 23 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(y - z) * Float64(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[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 -1e-290)
t_1
(if (<= t_1 0.0)
(*
(fma -1.0 (/ (- (+ a (/ (* t y) x)) (+ y (/ (* a t) x))) z) (/ t x))
x)
(if (<= t_1 5e+37)
(fma
x
(- (+ 1.0 (/ z (- a z))) (/ y (- a z)))
(/ (* t (- y z)) (- a z)))
t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -1e-290) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = fma(-1.0, (((a + ((t * y) / x)) - (y + ((a * t) / x))) / z), (t / x)) * x;
} else if (t_1 <= 5e+37) {
tmp = fma(x, ((1.0 + (z / (a - z))) - (y / (a - z))), ((t * (y - z)) / (a - z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= -1e-290) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(fma(-1.0, Float64(Float64(Float64(a + Float64(Float64(t * y) / x)) - Float64(y + Float64(Float64(a * t) / x))) / z), Float64(t / x)) * x); elseif (t_1 <= 5e+37) tmp = fma(x, Float64(Float64(1.0 + Float64(z / Float64(a - z))) - Float64(y / Float64(a - z))), Float64(Float64(t * Float64(y - z)) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-290], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(-1.0 * N[(N[(N[(a + N[(N[(t * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - N[(y + N[(N[(a * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(t / x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 5e+37], N[(x * N[(N[(1.0 + N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-290}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{\left(a + \frac{t \cdot y}{x}\right) - \left(y + \frac{a \cdot t}{x}\right)}{z}, \frac{t}{x}\right) \cdot x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(x, \left(1 + \frac{z}{a - z}\right) - \frac{y}{a - z}, \frac{t \cdot \left(y - z\right)}{a - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.0000000000000001e-290 or 4.99999999999999989e37 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.1%
if -1.0000000000000001e-290 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in z around -inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6441.2
Applied rewrites41.2%
if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999989e37Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in x around 0
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6478.9
Applied rewrites78.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) (- a z))))
(if (<= t -5.2e+37)
(fma t_1 (- y z) x)
(if (<= t 6.1e+18)
(fma
x
(- (+ 1.0 (/ z (- a z))) (/ y (- a z)))
(/ (* t (- y z)) (- a z)))
(+ x (* (- y z) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / (a - z);
double tmp;
if (t <= -5.2e+37) {
tmp = fma(t_1, (y - z), x);
} else if (t <= 6.1e+18) {
tmp = fma(x, ((1.0 + (z / (a - z))) - (y / (a - z))), ((t * (y - z)) / (a - z)));
} else {
tmp = x + ((y - z) * t_1);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / Float64(a - z)) tmp = 0.0 if (t <= -5.2e+37) tmp = fma(t_1, Float64(y - z), x); elseif (t <= 6.1e+18) tmp = fma(x, Float64(Float64(1.0 + Float64(z / Float64(a - z))) - Float64(y / Float64(a - z))), Float64(Float64(t * Float64(y - z)) / Float64(a - z))); else tmp = Float64(x + Float64(Float64(y - z) * t_1)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.2e+37], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 6.1e+18], N[(x * N[(N[(1.0 + N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\
\mathbf{elif}\;t \leq 6.1 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(x, \left(1 + \frac{z}{a - z}\right) - \frac{y}{a - z}, \frac{t \cdot \left(y - z\right)}{a - z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\_1\\
\end{array}
\end{array}
if t < -5.1999999999999998e37Initial program 80.1%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6480.1
Applied rewrites80.1%
if -5.1999999999999998e37 < t < 6.1e18Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in x around 0
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6478.9
Applied rewrites78.9%
if 6.1e18 < t Initial program 80.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 -1e-290)
t_1
(if (<= t_1 5e-140) (+ (- (/ (* (- t x) (- y a)) z)) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -1e-290) {
tmp = t_1;
} else if (t_1 <= 5e-140) {
tmp = -(((t - x) * (y - a)) / z) + 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 = x + ((y - z) * ((t - x) / (a - z)))
if (t_1 <= (-1d-290)) then
tmp = t_1
else if (t_1 <= 5d-140) then
tmp = -(((t - x) * (y - a)) / z) + 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 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -1e-290) {
tmp = t_1;
} else if (t_1 <= 5e-140) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_1 <= -1e-290: tmp = t_1 elif t_1 <= 5e-140: tmp = -(((t - x) * (y - a)) / z) + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= -1e-290) tmp = t_1; elseif (t_1 <= 5e-140) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_1 <= -1e-290) tmp = t_1; elseif (t_1 <= 5e-140) tmp = -(((t - x) * (y - a)) / z) + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-290], t$95$1, If[LessEqual[t$95$1, 5e-140], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-290}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-140}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.0000000000000001e-290 or 5.00000000000000015e-140 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.1%
if -1.0000000000000001e-290 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.00000000000000015e-140Initial program 80.1%
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.2
Applied rewrites46.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) (- a z)))
(t_2 (fma t_1 (- y z) x))
(t_3 (+ x (* (- y z) t_1))))
(if (<= t_3 -1e-290)
t_2
(if (<= t_3 5e-140) (+ (- (/ (* (- t x) (- y a)) z)) t) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / (a - z);
double t_2 = fma(t_1, (y - z), x);
double t_3 = x + ((y - z) * t_1);
double tmp;
if (t_3 <= -1e-290) {
tmp = t_2;
} else if (t_3 <= 5e-140) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / Float64(a - z)) t_2 = fma(t_1, Float64(y - z), x) t_3 = Float64(x + Float64(Float64(y - z) * t_1)) tmp = 0.0 if (t_3 <= -1e-290) tmp = t_2; elseif (t_3 <= 5e-140) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-290], t$95$2, If[LessEqual[t$95$3, 5e-140], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := \mathsf{fma}\left(t\_1, y - z, x\right)\\
t_3 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-290}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-140}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.0000000000000001e-290 or 5.00000000000000015e-140 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.1%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6480.1
Applied rewrites80.1%
if -1.0000000000000001e-290 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.00000000000000015e-140Initial program 80.1%
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.2
Applied rewrites46.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ t (- a z))))
(if (<= a -1.45e-38)
(fma t_1 (- y z) x)
(if (<= a 3.1e-13)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(+ x (* (- y z) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a - z);
double tmp;
if (a <= -1.45e-38) {
tmp = fma(t_1, (y - z), x);
} else if (a <= 3.1e-13) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else {
tmp = x + ((y - z) * t_1);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t / Float64(a - z)) tmp = 0.0 if (a <= -1.45e-38) tmp = fma(t_1, Float64(y - z), x); elseif (a <= 3.1e-13) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); else tmp = Float64(x + Float64(Float64(y - z) * t_1)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.45e-38], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 3.1e-13], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{a - z}\\
\mathbf{if}\;a \leq -1.45 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\
\mathbf{elif}\;a \leq 3.1 \cdot 10^{-13}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\_1\\
\end{array}
\end{array}
if a < -1.44999999999999997e-38Initial program 80.1%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6480.1
Applied rewrites80.1%
Taylor expanded in x around 0
Applied rewrites64.1%
if -1.44999999999999997e-38 < a < 3.0999999999999999e-13Initial program 80.1%
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.2
Applied rewrites46.2%
if 3.0999999999999999e-13 < a Initial program 80.1%
Taylor expanded in x around 0
Applied rewrites64.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= z -2.8e+52)
t_1
(if (<= z 5.5e-104)
(+ x (/ (* (- t x) y) (- a z)))
(if (<= z 1.95e+163) (fma (/ t (- a z)) (- y z) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * ((y - z) / (a - z));
double tmp;
if (z <= -2.8e+52) {
tmp = t_1;
} else if (z <= 5.5e-104) {
tmp = x + (((t - x) * y) / (a - z));
} else if (z <= 1.95e+163) {
tmp = fma((t / (a - z)), (y - z), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z))) tmp = 0.0 if (z <= -2.8e+52) tmp = t_1; elseif (z <= 5.5e-104) tmp = Float64(x + Float64(Float64(Float64(t - x) * y) / Float64(a - z))); elseif (z <= 1.95e+163) tmp = fma(Float64(t / Float64(a - z)), Float64(y - z), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e+52], t$95$1, If[LessEqual[z, 5.5e-104], N[(x + N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95e+163], N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-104}:\\
\;\;\;\;x + \frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+163}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a - z}, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.8e52 or 1.95000000000000012e163 < z Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.5
Applied rewrites51.5%
if -2.8e52 < z < 5.4999999999999998e-104Initial program 80.1%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6455.6
Applied rewrites55.6%
if 5.4999999999999998e-104 < z < 1.95000000000000012e163Initial program 80.1%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6480.1
Applied rewrites80.1%
Taylor expanded in x around 0
Applied rewrites64.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= z -2.3e+39)
t_1
(if (<= z 3.6e-107)
(fma (- t x) (/ (- y z) a) x)
(if (<= z 1.95e+163) (fma (/ t (- a z)) (- y z) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * ((y - z) / (a - z));
double tmp;
if (z <= -2.3e+39) {
tmp = t_1;
} else if (z <= 3.6e-107) {
tmp = fma((t - x), ((y - z) / a), x);
} else if (z <= 1.95e+163) {
tmp = fma((t / (a - z)), (y - z), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z))) tmp = 0.0 if (z <= -2.3e+39) tmp = t_1; elseif (z <= 3.6e-107) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); elseif (z <= 1.95e+163) tmp = fma(Float64(t / Float64(a - z)), Float64(y - z), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e+39], t$95$1, If[LessEqual[z, 3.6e-107], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.95e+163], N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-107}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+163}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a - z}, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.30000000000000012e39 or 1.95000000000000012e163 < z Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.5
Applied rewrites51.5%
if -2.30000000000000012e39 < z < 3.59999999999999976e-107Initial program 80.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.8
Applied rewrites53.8%
if 3.59999999999999976e-107 < z < 1.95000000000000012e163Initial program 80.1%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6480.1
Applied rewrites80.1%
Taylor expanded in x around 0
Applied rewrites64.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= z -2.3e+39)
t_1
(if (<= z 1.5e-69) (fma (- t x) (/ (- y z) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * ((y - z) / (a - z));
double tmp;
if (z <= -2.3e+39) {
tmp = t_1;
} else if (z <= 1.5e-69) {
tmp = fma((t - x), ((y - z) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z))) tmp = 0.0 if (z <= -2.3e+39) tmp = t_1; elseif (z <= 1.5e-69) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e+39], t$95$1, If[LessEqual[z, 1.5e-69], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-69}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.30000000000000012e39 or 1.49999999999999995e-69 < z Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.5
Applied rewrites51.5%
if -2.30000000000000012e39 < z < 1.49999999999999995e-69Initial program 80.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.8
Applied rewrites53.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= z -1.85e+39)
t_1
(if (<= z 1.35e-102) (+ x (* (- t x) (/ y a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * ((y - z) / (a - z));
double tmp;
if (z <= -1.85e+39) {
tmp = t_1;
} else if (z <= 1.35e-102) {
tmp = x + ((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 * ((y - z) / (a - z))
if (z <= (-1.85d+39)) then
tmp = t_1
else if (z <= 1.35d-102) then
tmp = x + ((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 * ((y - z) / (a - z));
double tmp;
if (z <= -1.85e+39) {
tmp = t_1;
} else if (z <= 1.35e-102) {
tmp = x + ((t - x) * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * ((y - z) / (a - z)) tmp = 0 if z <= -1.85e+39: tmp = t_1 elif z <= 1.35e-102: tmp = x + ((t - x) * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z))) tmp = 0.0 if (z <= -1.85e+39) tmp = t_1; elseif (z <= 1.35e-102) tmp = Float64(x + 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 * ((y - z) / (a - z)); tmp = 0.0; if (z <= -1.85e+39) tmp = t_1; elseif (z <= 1.35e-102) tmp = x + ((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[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+39], t$95$1, If[LessEqual[z, 1.35e-102], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-102}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.85000000000000006e39 or 1.35e-102 < z Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.5
Applied rewrites51.5%
if -1.85000000000000006e39 < z < 1.35e-102Initial program 80.1%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6445.1
Applied rewrites45.1%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f6449.5
Applied rewrites49.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= z -1.85e+39)
t_1
(if (<= z 1.35e-102) (fma y (/ (- t x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * ((y - z) / (a - z));
double tmp;
if (z <= -1.85e+39) {
tmp = t_1;
} else if (z <= 1.35e-102) {
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(y - z) / Float64(a - z))) tmp = 0.0 if (z <= -1.85e+39) tmp = t_1; elseif (z <= 1.35e-102) 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[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+39], t$95$1, If[LessEqual[z, 1.35e-102], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-102}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.85000000000000006e39 or 1.35e-102 < z Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.5
Applied rewrites51.5%
if -1.85000000000000006e39 < z < 1.35e-102Initial program 80.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.1
Applied rewrites48.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* t (* x (/ 1.0 x))))) (if (<= z -8e+45) t_1 (if (<= z 4.8e+43) (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 * (1.0 / x));
double tmp;
if (z <= -8e+45) {
tmp = t_1;
} else if (z <= 4.8e+43) {
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(x * Float64(1.0 / x))) tmp = 0.0 if (z <= -8e+45) tmp = t_1; elseif (z <= 4.8e+43) 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[(x * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+45], t$95$1, If[LessEqual[z, 4.8e+43], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(x \cdot \frac{1}{x}\right)\\
\mathbf{if}\;z \leq -8 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+43}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.9999999999999994e45 or 4.80000000000000046e43 < z Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f64N/A
lift--.f6442.4
Applied rewrites42.4%
Taylor expanded in z around inf
lower-/.f6425.1
Applied rewrites25.1%
if -7.9999999999999994e45 < z < 4.80000000000000046e43Initial program 80.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.1
Applied rewrites48.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* t (* x (/ 1.0 x))))) (if (<= z -7.8e+45) t_1 (if (<= z 3.2e+43) (+ x (/ (* t y) a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (x * (1.0 / x));
double tmp;
if (z <= -7.8e+45) {
tmp = t_1;
} else if (z <= 3.2e+43) {
tmp = x + ((t * 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 * (1.0d0 / x))
if (z <= (-7.8d+45)) then
tmp = t_1
else if (z <= 3.2d+43) then
tmp = x + ((t * 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 * (1.0 / x));
double tmp;
if (z <= -7.8e+45) {
tmp = t_1;
} else if (z <= 3.2e+43) {
tmp = x + ((t * y) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (x * (1.0 / x)) tmp = 0 if z <= -7.8e+45: tmp = t_1 elif z <= 3.2e+43: tmp = x + ((t * y) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(x * Float64(1.0 / x))) tmp = 0.0 if (z <= -7.8e+45) tmp = t_1; elseif (z <= 3.2e+43) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (x * (1.0 / x)); tmp = 0.0; if (z <= -7.8e+45) tmp = t_1; elseif (z <= 3.2e+43) tmp = x + ((t * y) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(x * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e+45], t$95$1, If[LessEqual[z, 3.2e+43], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(x \cdot \frac{1}{x}\right)\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+43}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.7999999999999999e45 or 3.20000000000000014e43 < z Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f64N/A
lift--.f6442.4
Applied rewrites42.4%
Taylor expanded in z around inf
lower-/.f6425.1
Applied rewrites25.1%
if -7.7999999999999999e45 < z < 3.20000000000000014e43Initial program 80.1%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6445.1
Applied rewrites45.1%
Taylor expanded in x around 0
Applied rewrites38.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.5e+77) (* (/ t x) x) (if (<= z 2.1e+57) (+ x (/ (* t y) a)) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+77) {
tmp = (t / x) * x;
} else if (z <= 2.1e+57) {
tmp = x + ((t * y) / a);
} 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 (z <= (-5.5d+77)) then
tmp = (t / x) * x
else if (z <= 2.1d+57) then
tmp = x + ((t * y) / a)
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 (z <= -5.5e+77) {
tmp = (t / x) * x;
} else if (z <= 2.1e+57) {
tmp = x + ((t * y) / a);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e+77: tmp = (t / x) * x elif z <= 2.1e+57: tmp = x + ((t * y) / a) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e+77) tmp = Float64(Float64(t / x) * x); elseif (z <= 2.1e+57) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e+77) tmp = (t / x) * x; elseif (z <= 2.1e+57) tmp = x + ((t * y) / a); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+77], N[(N[(t / x), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 2.1e+57], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+77}:\\
\;\;\;\;\frac{t}{x} \cdot x\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+57}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -5.50000000000000036e77Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in z around inf
lower-/.f6422.0
Applied rewrites22.0%
if -5.50000000000000036e77 < z < 2.09999999999999991e57Initial program 80.1%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6445.1
Applied rewrites45.1%
Taylor expanded in x around 0
Applied rewrites38.5%
if 2.09999999999999991e57 < z Initial program 80.1%
Taylor expanded in z around inf
lift--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites34.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.5e+37)
(* (/ t x) x)
(if (<= z 1.35e-69)
(* (- 1.0 (/ y a)) x)
(if (<= z 3e+31) (/ (* (- y z) t) a) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.5e+37) {
tmp = (t / x) * x;
} else if (z <= 1.35e-69) {
tmp = (1.0 - (y / a)) * x;
} else if (z <= 3e+31) {
tmp = ((y - z) * t) / a;
} 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 (z <= (-2.5d+37)) then
tmp = (t / x) * x
else if (z <= 1.35d-69) then
tmp = (1.0d0 - (y / a)) * x
else if (z <= 3d+31) then
tmp = ((y - z) * t) / a
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 (z <= -2.5e+37) {
tmp = (t / x) * x;
} else if (z <= 1.35e-69) {
tmp = (1.0 - (y / a)) * x;
} else if (z <= 3e+31) {
tmp = ((y - z) * t) / a;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.5e+37: tmp = (t / x) * x elif z <= 1.35e-69: tmp = (1.0 - (y / a)) * x elif z <= 3e+31: tmp = ((y - z) * t) / a else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.5e+37) tmp = Float64(Float64(t / x) * x); elseif (z <= 1.35e-69) tmp = Float64(Float64(1.0 - Float64(y / a)) * x); elseif (z <= 3e+31) tmp = Float64(Float64(Float64(y - z) * t) / a); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.5e+37) tmp = (t / x) * x; elseif (z <= 1.35e-69) tmp = (1.0 - (y / a)) * x; elseif (z <= 3e+31) tmp = ((y - z) * t) / a; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.5e+37], N[(N[(t / x), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.35e-69], N[(N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 3e+31], N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / a), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+37}:\\
\;\;\;\;\frac{t}{x} \cdot x\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-69}:\\
\;\;\;\;\left(1 - \frac{y}{a}\right) \cdot x\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+31}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.49999999999999994e37Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in z around inf
lower-/.f6422.0
Applied rewrites22.0%
if -2.49999999999999994e37 < z < 1.3499999999999999e-69Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.3
Applied rewrites43.3%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f6436.9
Applied rewrites36.9%
if 1.3499999999999999e-69 < z < 2.99999999999999989e31Initial program 80.1%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6480.1
Applied rewrites80.1%
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 z around 0
Applied rewrites19.8%
if 2.99999999999999989e31 < z Initial program 80.1%
Taylor expanded in z around inf
lift--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites34.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.5e+37) (* (/ t x) x) (if (<= z 4.3e-41) (* (- 1.0 (/ y a)) x) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.5e+37) {
tmp = (t / x) * x;
} else if (z <= 4.3e-41) {
tmp = (1.0 - (y / a)) * x;
} 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 (z <= (-2.5d+37)) then
tmp = (t / x) * x
else if (z <= 4.3d-41) then
tmp = (1.0d0 - (y / a)) * x
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 (z <= -2.5e+37) {
tmp = (t / x) * x;
} else if (z <= 4.3e-41) {
tmp = (1.0 - (y / a)) * x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.5e+37: tmp = (t / x) * x elif z <= 4.3e-41: tmp = (1.0 - (y / a)) * x else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.5e+37) tmp = Float64(Float64(t / x) * x); elseif (z <= 4.3e-41) tmp = Float64(Float64(1.0 - Float64(y / a)) * x); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.5e+37) tmp = (t / x) * x; elseif (z <= 4.3e-41) tmp = (1.0 - (y / a)) * x; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.5e+37], N[(N[(t / x), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 4.3e-41], N[(N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+37}:\\
\;\;\;\;\frac{t}{x} \cdot x\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-41}:\\
\;\;\;\;\left(1 - \frac{y}{a}\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.49999999999999994e37Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in z around inf
lower-/.f6422.0
Applied rewrites22.0%
if -2.49999999999999994e37 < z < 4.2999999999999999e-41Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.3
Applied rewrites43.3%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f6436.9
Applied rewrites36.9%
if 4.2999999999999999e-41 < z Initial program 80.1%
Taylor expanded in z around inf
lift--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites34.1%
(FPCore (x y z t a)
:precision binary64
(if (<= y -2.3e+206)
(* y (/ (- t x) a))
(if (<= y -1.15e+139)
(* x (/ y z))
(if (<= y 1.5e+122) (+ x t) (* y (/ t (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.3e+206) {
tmp = y * ((t - x) / a);
} else if (y <= -1.15e+139) {
tmp = x * (y / z);
} else if (y <= 1.5e+122) {
tmp = x + t;
} else {
tmp = y * (t / (a - z));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 (y <= (-2.3d+206)) then
tmp = y * ((t - x) / a)
else if (y <= (-1.15d+139)) then
tmp = x * (y / z)
else if (y <= 1.5d+122) then
tmp = x + t
else
tmp = y * (t / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.3e+206) {
tmp = y * ((t - x) / a);
} else if (y <= -1.15e+139) {
tmp = x * (y / z);
} else if (y <= 1.5e+122) {
tmp = x + t;
} else {
tmp = y * (t / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.3e+206: tmp = y * ((t - x) / a) elif y <= -1.15e+139: tmp = x * (y / z) elif y <= 1.5e+122: tmp = x + t else: tmp = y * (t / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.3e+206) tmp = Float64(y * Float64(Float64(t - x) / a)); elseif (y <= -1.15e+139) tmp = Float64(x * Float64(y / z)); elseif (y <= 1.5e+122) tmp = Float64(x + t); else tmp = Float64(y * Float64(t / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.3e+206) tmp = y * ((t - x) / a); elseif (y <= -1.15e+139) tmp = x * (y / z); elseif (y <= 1.5e+122) tmp = x + t; else tmp = y * (t / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.3e+206], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.15e+139], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e+122], N[(x + t), $MachinePrecision], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+206}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{+139}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+122}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if y < -2.30000000000000016e206Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6442.4
Applied rewrites42.4%
Taylor expanded in z around 0
lower-/.f64N/A
lift--.f6426.1
Applied rewrites26.1%
if -2.30000000000000016e206 < y < -1.15e139Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.3
Applied rewrites43.3%
Taylor expanded in a around 0
associate-/l*N/A
lower-*.f64N/A
lift-/.f6419.2
Applied rewrites19.2%
if -1.15e139 < y < 1.49999999999999993e122Initial program 80.1%
Taylor expanded in z around inf
lift--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites34.1%
if 1.49999999999999993e122 < y Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6442.4
Applied rewrites42.4%
Taylor expanded in x around 0
lower-/.f64N/A
lift--.f6423.2
Applied rewrites23.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 (- INFINITY))
(* t (/ (- y z) a))
(if (<= t_1 -1e-266)
(+ x t)
(if (<= t_1 5e-145)
(* (/ t x) x)
(if (<= t_1 5e+307) (+ x t) (/ (* t y) a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t * ((y - z) / a);
} else if (t_1 <= -1e-266) {
tmp = x + t;
} else if (t_1 <= 5e-145) {
tmp = (t / x) * x;
} else if (t_1 <= 5e+307) {
tmp = x + t;
} else {
tmp = (t * y) / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t * ((y - z) / a);
} else if (t_1 <= -1e-266) {
tmp = x + t;
} else if (t_1 <= 5e-145) {
tmp = (t / x) * x;
} else if (t_1 <= 5e+307) {
tmp = x + t;
} else {
tmp = (t * y) / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_1 <= -math.inf: tmp = t * ((y - z) / a) elif t_1 <= -1e-266: tmp = x + t elif t_1 <= 5e-145: tmp = (t / x) * x elif t_1 <= 5e+307: tmp = x + t else: tmp = (t * y) / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(t * Float64(Float64(y - z) / a)); elseif (t_1 <= -1e-266) tmp = Float64(x + t); elseif (t_1 <= 5e-145) tmp = Float64(Float64(t / x) * x); elseif (t_1 <= 5e+307) tmp = Float64(x + t); else tmp = Float64(Float64(t * y) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_1 <= -Inf) tmp = t * ((y - z) / a); elseif (t_1 <= -1e-266) tmp = x + t; elseif (t_1 <= 5e-145) tmp = (t / x) * x; elseif (t_1 <= 5e+307) tmp = x + t; else tmp = (t * y) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-266], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 5e-145], N[(N[(t / x), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 5e+307], N[(x + t), $MachinePrecision], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t \cdot \frac{y - z}{a}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-266}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-145}:\\
\;\;\;\;\frac{t}{x} \cdot x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f64N/A
lift--.f6442.4
Applied rewrites42.4%
Taylor expanded in a around inf
lower-/.f64N/A
lift--.f6423.1
Applied rewrites23.1%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999998e-267 or 4.9999999999999998e-145 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5e307Initial program 80.1%
Taylor expanded in z around inf
lift--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites34.1%
if -9.9999999999999998e-267 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.9999999999999998e-145Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in z around inf
lower-/.f6422.0
Applied rewrites22.0%
if 5e307 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.1%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6480.1
Applied rewrites80.1%
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 z around 0
lower-/.f64N/A
lower-*.f6416.7
Applied rewrites16.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 (- INFINITY))
(/ (* x y) z)
(if (<= t_1 -1e-266)
(+ x t)
(if (<= t_1 5e-145)
(* (/ t x) x)
(if (<= t_1 5e+307) (+ x t) (/ (* t y) a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x * y) / z;
} else if (t_1 <= -1e-266) {
tmp = x + t;
} else if (t_1 <= 5e-145) {
tmp = (t / x) * x;
} else if (t_1 <= 5e+307) {
tmp = x + t;
} else {
tmp = (t * y) / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x * y) / z;
} else if (t_1 <= -1e-266) {
tmp = x + t;
} else if (t_1 <= 5e-145) {
tmp = (t / x) * x;
} else if (t_1 <= 5e+307) {
tmp = x + t;
} else {
tmp = (t * y) / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_1 <= -math.inf: tmp = (x * y) / z elif t_1 <= -1e-266: tmp = x + t elif t_1 <= 5e-145: tmp = (t / x) * x elif t_1 <= 5e+307: tmp = x + t else: tmp = (t * y) / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x * y) / z); elseif (t_1 <= -1e-266) tmp = Float64(x + t); elseif (t_1 <= 5e-145) tmp = Float64(Float64(t / x) * x); elseif (t_1 <= 5e+307) tmp = Float64(x + t); else tmp = Float64(Float64(t * y) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_1 <= -Inf) tmp = (x * y) / z; elseif (t_1 <= -1e-266) tmp = x + t; elseif (t_1 <= 5e-145) tmp = (t / x) * x; elseif (t_1 <= 5e+307) tmp = x + t; else tmp = (t * y) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, -1e-266], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 5e-145], N[(N[(t / x), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 5e+307], N[(x + t), $MachinePrecision], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-266}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-145}:\\
\;\;\;\;\frac{t}{x} \cdot x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.3
Applied rewrites43.3%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lift--.f6421.6
Applied rewrites21.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f6416.6
Applied rewrites16.6%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999998e-267 or 4.9999999999999998e-145 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5e307Initial program 80.1%
Taylor expanded in z around inf
lift--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites34.1%
if -9.9999999999999998e-267 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.9999999999999998e-145Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in z around inf
lower-/.f6422.0
Applied rewrites22.0%
if 5e307 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.1%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6480.1
Applied rewrites80.1%
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 z around 0
lower-/.f64N/A
lower-*.f6416.7
Applied rewrites16.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 (- INFINITY))
(/ (* x y) z)
(if (<= t_1 -1e-266)
(+ x t)
(if (<= t_1 5e-145)
(* (/ t x) x)
(if (<= t_1 5e+307) (+ x t) (* x (/ y z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x * y) / z;
} else if (t_1 <= -1e-266) {
tmp = x + t;
} else if (t_1 <= 5e-145) {
tmp = (t / x) * x;
} else if (t_1 <= 5e+307) {
tmp = x + t;
} else {
tmp = x * (y / z);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x * y) / z;
} else if (t_1 <= -1e-266) {
tmp = x + t;
} else if (t_1 <= 5e-145) {
tmp = (t / x) * x;
} else if (t_1 <= 5e+307) {
tmp = x + t;
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_1 <= -math.inf: tmp = (x * y) / z elif t_1 <= -1e-266: tmp = x + t elif t_1 <= 5e-145: tmp = (t / x) * x elif t_1 <= 5e+307: tmp = x + t else: tmp = x * (y / z) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x * y) / z); elseif (t_1 <= -1e-266) tmp = Float64(x + t); elseif (t_1 <= 5e-145) tmp = Float64(Float64(t / x) * x); elseif (t_1 <= 5e+307) tmp = Float64(x + t); else tmp = Float64(x * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_1 <= -Inf) tmp = (x * y) / z; elseif (t_1 <= -1e-266) tmp = x + t; elseif (t_1 <= 5e-145) tmp = (t / x) * x; elseif (t_1 <= 5e+307) tmp = x + t; else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, -1e-266], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 5e-145], N[(N[(t / x), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 5e+307], N[(x + t), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-266}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-145}:\\
\;\;\;\;\frac{t}{x} \cdot x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.3
Applied rewrites43.3%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lift--.f6421.6
Applied rewrites21.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f6416.6
Applied rewrites16.6%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999998e-267 or 4.9999999999999998e-145 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5e307Initial program 80.1%
Taylor expanded in z around inf
lift--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites34.1%
if -9.9999999999999998e-267 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.9999999999999998e-145Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in z around inf
lower-/.f6422.0
Applied rewrites22.0%
if 5e307 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.3
Applied rewrites43.3%
Taylor expanded in a around 0
associate-/l*N/A
lower-*.f64N/A
lift-/.f6419.2
Applied rewrites19.2%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.15e+139) (* x (/ y z)) (if (<= y 1.5e+122) (+ x t) (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.15e+139) {
tmp = x * (y / z);
} else if (y <= 1.5e+122) {
tmp = x + t;
} else {
tmp = y * (t / (a - z));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 (y <= (-1.15d+139)) then
tmp = x * (y / z)
else if (y <= 1.5d+122) then
tmp = x + t
else
tmp = y * (t / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.15e+139) {
tmp = x * (y / z);
} else if (y <= 1.5e+122) {
tmp = x + t;
} else {
tmp = y * (t / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.15e+139: tmp = x * (y / z) elif y <= 1.5e+122: tmp = x + t else: tmp = y * (t / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.15e+139) tmp = Float64(x * Float64(y / z)); elseif (y <= 1.5e+122) tmp = Float64(x + t); else tmp = Float64(y * Float64(t / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.15e+139) tmp = x * (y / z); elseif (y <= 1.5e+122) tmp = x + t; else tmp = y * (t / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.15e+139], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e+122], N[(x + t), $MachinePrecision], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+139}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+122}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if y < -1.15e139Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.3
Applied rewrites43.3%
Taylor expanded in a around 0
associate-/l*N/A
lower-*.f64N/A
lift-/.f6419.2
Applied rewrites19.2%
if -1.15e139 < y < 1.49999999999999993e122Initial program 80.1%
Taylor expanded in z around inf
lift--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites34.1%
if 1.49999999999999993e122 < y Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.1%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6442.4
Applied rewrites42.4%
Taylor expanded in x around 0
lower-/.f64N/A
lift--.f6423.2
Applied rewrites23.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* x (/ y z)))) (if (<= y -1.15e+139) t_1 (if (<= y 2.5e+128) (+ x t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x * (y / z);
double tmp;
if (y <= -1.15e+139) {
tmp = t_1;
} else if (y <= 2.5e+128) {
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 = x * (y / z)
if (y <= (-1.15d+139)) then
tmp = t_1
else if (y <= 2.5d+128) 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 = x * (y / z);
double tmp;
if (y <= -1.15e+139) {
tmp = t_1;
} else if (y <= 2.5e+128) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x * (y / z) tmp = 0 if y <= -1.15e+139: tmp = t_1 elif y <= 2.5e+128: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x * Float64(y / z)) tmp = 0.0 if (y <= -1.15e+139) tmp = t_1; elseif (y <= 2.5e+128) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x * (y / z); tmp = 0.0; if (y <= -1.15e+139) tmp = t_1; elseif (y <= 2.5e+128) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.15e+139], t$95$1, If[LessEqual[y, 2.5e+128], N[(x + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -1.15 \cdot 10^{+139}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+128}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.15e139 or 2.5e128 < y Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.3
Applied rewrites43.3%
Taylor expanded in a around 0
associate-/l*N/A
lower-*.f64N/A
lift-/.f6419.2
Applied rewrites19.2%
if -1.15e139 < y < 2.5e128Initial program 80.1%
Taylor expanded in z around inf
lift--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites34.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* x y) z))) (if (<= y -4.4e+186) t_1 (if (<= y 2.5e+128) (+ x t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / z;
double tmp;
if (y <= -4.4e+186) {
tmp = t_1;
} else if (y <= 2.5e+128) {
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 = (x * y) / z
if (y <= (-4.4d+186)) then
tmp = t_1
else if (y <= 2.5d+128) 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 = (x * y) / z;
double tmp;
if (y <= -4.4e+186) {
tmp = t_1;
} else if (y <= 2.5e+128) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * y) / z tmp = 0 if y <= -4.4e+186: tmp = t_1 elif y <= 2.5e+128: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / z) tmp = 0.0 if (y <= -4.4e+186) tmp = t_1; elseif (y <= 2.5e+128) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x * y) / z; tmp = 0.0; if (y <= -4.4e+186) tmp = t_1; elseif (y <= 2.5e+128) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -4.4e+186], t$95$1, If[LessEqual[y, 2.5e+128], N[(x + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{z}\\
\mathbf{if}\;y \leq -4.4 \cdot 10^{+186}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+128}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.3999999999999997e186 or 2.5e128 < y Initial program 80.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.3
Applied rewrites43.3%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lift--.f6421.6
Applied rewrites21.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f6416.6
Applied rewrites16.6%
if -4.3999999999999997e186 < y < 2.5e128Initial program 80.1%
Taylor expanded in z around inf
lift--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites34.1%
(FPCore (x y z t a) :precision binary64 (+ x t))
double code(double x, double y, double z, double t, double a) {
return x + 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 = x + t
end function
public static double code(double x, double y, double z, double t, double a) {
return x + t;
}
def code(x, y, z, t, a): return x + t
function code(x, y, z, t, a) return Float64(x + t) end
function tmp = code(x, y, z, t, a) tmp = x + t; end
code[x_, y_, z_, t_, a_] := N[(x + t), $MachinePrecision]
\begin{array}{l}
\\
x + t
\end{array}
Initial program 80.1%
Taylor expanded in z around inf
lift--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites34.1%
herbie shell --seed 2025139
(FPCore (x y z t a)
:name "Numeric.Signal:interpolate from hsignal-0.2.7.1"
:precision binary64
(+ x (* (- y z) (/ (- t x) (- a z)))))