
(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]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
Herbie found 25 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]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- x t) (/ (- z y) (- a z))))))
(if (<= t -4.2e+96)
t_1
(if (<= t 7.5e-11)
(+
(* -1.0 (/ (* t (- z y)) (- a z)))
(* x (- (+ 1.0 (/ z (- a z))) (/ y (- a z)))))
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((x - t) * ((z - y) / (a - z)));
double tmp;
if (t <= -4.2e+96) {
tmp = t_1;
} else if (t <= 7.5e-11) {
tmp = (-1.0 * ((t * (z - y)) / (a - z))) + (x * ((1.0 + (z / (a - z))) - (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 = x + ((x - t) * ((z - y) / (a - z)))
if (t <= (-4.2d+96)) then
tmp = t_1
else if (t <= 7.5d-11) then
tmp = ((-1.0d0) * ((t * (z - y)) / (a - z))) + (x * ((1.0d0 + (z / (a - z))) - (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 = x + ((x - t) * ((z - y) / (a - z)));
double tmp;
if (t <= -4.2e+96) {
tmp = t_1;
} else if (t <= 7.5e-11) {
tmp = (-1.0 * ((t * (z - y)) / (a - z))) + (x * ((1.0 + (z / (a - z))) - (y / (a - z))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((x - t) * ((z - y) / (a - z))) tmp = 0 if t <= -4.2e+96: tmp = t_1 elif t <= 7.5e-11: tmp = (-1.0 * ((t * (z - y)) / (a - z))) + (x * ((1.0 + (z / (a - z))) - (y / (a - z)))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(x - t) * Float64(Float64(z - y) / Float64(a - z)))) tmp = 0.0 if (t <= -4.2e+96) tmp = t_1; elseif (t <= 7.5e-11) tmp = Float64(Float64(-1.0 * Float64(Float64(t * Float64(z - y)) / Float64(a - z))) + Float64(x * Float64(Float64(1.0 + Float64(z / Float64(a - z))) - Float64(y / Float64(a - z))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((x - t) * ((z - y) / (a - z))); tmp = 0.0; if (t <= -4.2e+96) tmp = t_1; elseif (t <= 7.5e-11) tmp = (-1.0 * ((t * (z - y)) / (a - z))) + (x * ((1.0 + (z / (a - z))) - (y / (a - z)))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.2e+96], t$95$1, If[LessEqual[t, 7.5e-11], N[(N[(-1.0 * N[(N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(1.0 + N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \left(x - t\right) \cdot \frac{z - y}{a - z}\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-11}:\\
\;\;\;\;-1 \cdot \frac{t \cdot \left(z - y\right)}{a - z} + x \cdot \left(\left(1 + \frac{z}{a - z}\right) - \frac{y}{a - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -4.2000000000000002e96 or 7.5e-11 < t Initial program 79.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
if -4.2000000000000002e96 < t < 7.5e-11Initial program 79.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
Taylor expanded in x around 0
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-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6478.8%
Applied rewrites78.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- x t) (/ (- z y) (- a z)))))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 -4e-303)
t_1
(if (<= t_2 0.0)
(+ t (* -1.0 (/ (- (* y (- t x)) (* a (- t x))) z)))
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((x - t) * ((z - y) / (a - z)));
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -4e-303) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t + (-1.0 * (((y * (t - x)) - (a * (t - 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) :: t_2
real(8) :: tmp
t_1 = x + ((x - t) * ((z - y) / (a - z)))
t_2 = x + ((y - z) * ((t - x) / (a - z)))
if (t_2 <= (-4d-303)) then
tmp = t_1
else if (t_2 <= 0.0d0) then
tmp = t + ((-1.0d0) * (((y * (t - x)) - (a * (t - 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 = x + ((x - t) * ((z - y) / (a - z)));
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -4e-303) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t + (-1.0 * (((y * (t - x)) - (a * (t - x))) / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((x - t) * ((z - y) / (a - z))) t_2 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_2 <= -4e-303: tmp = t_1 elif t_2 <= 0.0: tmp = t + (-1.0 * (((y * (t - x)) - (a * (t - x))) / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(x - t) * Float64(Float64(z - y) / Float64(a - z)))) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -4e-303) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(t + Float64(-1.0 * Float64(Float64(Float64(y * Float64(t - x)) - Float64(a * Float64(t - x))) / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((x - t) * ((z - y) / (a - z))); t_2 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_2 <= -4e-303) tmp = t_1; elseif (t_2 <= 0.0) tmp = t + (-1.0 * (((y * (t - x)) - (a * (t - x))) / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-303], t$95$1, If[LessEqual[t$95$2, 0.0], N[(t + N[(-1.0 * N[(N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := x + \left(x - t\right) \cdot \frac{z - y}{a - z}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -3.9999999999999997e-303 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
if -3.9999999999999997e-303 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 79.6%
Taylor expanded in z around inf
lower--.f6419.7%
Applied rewrites19.7%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.9%
Applied rewrites46.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- x t) (/ (- z y) (- a z)))))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 -4e-303)
t_1
(if (<= t_2 0.0) (* t (- 1.0 (/ y z))) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((x - t) * ((z - y) / (a - z)));
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -4e-303) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t * (1.0 - (y / z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 = x + ((x - t) * ((z - y) / (a - z)))
t_2 = x + ((y - z) * ((t - x) / (a - z)))
if (t_2 <= (-4d-303)) then
tmp = t_1
else if (t_2 <= 0.0d0) then
tmp = t * (1.0d0 - (y / z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((x - t) * ((z - y) / (a - z)));
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -4e-303) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t * (1.0 - (y / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((x - t) * ((z - y) / (a - z))) t_2 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_2 <= -4e-303: tmp = t_1 elif t_2 <= 0.0: tmp = t * (1.0 - (y / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(x - t) * Float64(Float64(z - y) / Float64(a - z)))) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -4e-303) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(t * Float64(1.0 - Float64(y / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((x - t) * ((z - y) / (a - z))); t_2 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_2 <= -4e-303) tmp = t_1; elseif (t_2 <= 0.0) tmp = t * (1.0 - (y / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-303], t$95$1, If[LessEqual[t$95$2, 0.0], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := x + \left(x - t\right) \cdot \frac{z - y}{a - z}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -3.9999999999999997e-303 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
if -3.9999999999999997e-303 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f6436.6%
Applied rewrites36.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- x t) (/ (- z y) (- a z)))))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 -4e-303)
t_1
(if (<= t_2 0.0) (* t (- (/ y (- a z)) (/ z (- a z)))) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((x - t) * ((z - y) / (a - z)));
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -4e-303) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t * ((y / (a - z)) - (z / (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) :: t_2
real(8) :: tmp
t_1 = x + ((x - t) * ((z - y) / (a - z)))
t_2 = x + ((y - z) * ((t - x) / (a - z)))
if (t_2 <= (-4d-303)) then
tmp = t_1
else if (t_2 <= 0.0d0) then
tmp = t * ((y / (a - z)) - (z / (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 = x + ((x - t) * ((z - y) / (a - z)));
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -4e-303) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t * ((y / (a - z)) - (z / (a - z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((x - t) * ((z - y) / (a - z))) t_2 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_2 <= -4e-303: tmp = t_1 elif t_2 <= 0.0: tmp = t * ((y / (a - z)) - (z / (a - z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(x - t) * Float64(Float64(z - y) / Float64(a - z)))) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -4e-303) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(t * Float64(Float64(y / Float64(a - z)) - Float64(z / Float64(a - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((x - t) * ((z - y) / (a - z))); t_2 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_2 <= -4e-303) tmp = t_1; elseif (t_2 <= 0.0) tmp = t * ((y / (a - z)) - (z / (a - z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-303], t$95$1, If[LessEqual[t$95$2, 0.0], N[(t * N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := x + \left(x - t\right) \cdot \frac{z - y}{a - z}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t \cdot \left(\frac{y}{a - z} - \frac{z}{a - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -3.9999999999999997e-303 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
if -3.9999999999999997e-303 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 79.6%
Taylor expanded in z around inf
lower--.f6419.7%
Applied rewrites19.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z)))))
(t_2 (+ x (* (- y z) (/ t (- a z))))))
(if (<= t_1 (- INFINITY))
(+ x (/ (* y (- t x)) (- a z)))
(if (<= t_1 -4e-303)
t_2
(if (<= t_1 1e-246)
(* t (/ z (- z a)))
(if (<= t_1 5e+305) t_2 (/ (* (- x t) y) (- z a))))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double t_2 = x + ((y - z) * (t / (a - z)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (t_1 <= -4e-303) {
tmp = t_2;
} else if (t_1 <= 1e-246) {
tmp = t * (z / (z - a));
} else if (t_1 <= 5e+305) {
tmp = t_2;
} else {
tmp = ((x - t) * y) / (z - 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 t_2 = x + ((y - z) * (t / (a - z)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (t_1 <= -4e-303) {
tmp = t_2;
} else if (t_1 <= 1e-246) {
tmp = t * (z / (z - a));
} else if (t_1 <= 5e+305) {
tmp = t_2;
} else {
tmp = ((x - t) * y) / (z - a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) t_2 = x + ((y - z) * (t / (a - z))) tmp = 0 if t_1 <= -math.inf: tmp = x + ((y * (t - x)) / (a - z)) elif t_1 <= -4e-303: tmp = t_2 elif t_1 <= 1e-246: tmp = t * (z / (z - a)) elif t_1 <= 5e+305: tmp = t_2 else: tmp = ((x - t) * y) / (z - 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)))) t_2 = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z))); elseif (t_1 <= -4e-303) tmp = t_2; elseif (t_1 <= 1e-246) tmp = Float64(t * Float64(z / Float64(z - a))); elseif (t_1 <= 5e+305) tmp = t_2; else tmp = Float64(Float64(Float64(x - t) * y) / Float64(z - a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); t_2 = x + ((y - z) * (t / (a - z))); tmp = 0.0; if (t_1 <= -Inf) tmp = x + ((y * (t - x)) / (a - z)); elseif (t_1 <= -4e-303) tmp = t_2; elseif (t_1 <= 1e-246) tmp = t * (z / (z - a)); elseif (t_1 <= 5e+305) tmp = t_2; else tmp = ((x - t) * y) / (z - 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]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -4e-303], t$95$2, If[LessEqual[t$95$1, 1e-246], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+305], t$95$2, N[(N[(N[(x - t), $MachinePrecision] * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
t_2 := x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-246}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - t\right) \cdot y}{z - a}\\
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 79.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6454.8%
Applied rewrites54.8%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -3.9999999999999997e-303 or 9.9999999999999996e-247 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000001e305Initial program 79.6%
Taylor expanded in x around 0
Applied rewrites63.8%
if -3.9999999999999997e-303 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.9999999999999996e-247Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6429.9%
Applied rewrites29.9%
if 5.0000000000000001e305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5%
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
frac-2negN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6437.4%
Applied rewrites37.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* t (- y z)) (- a z)))))
(if (<= z -2.1e+93)
(* t (- 1.0 (/ y z)))
(if (<= z -3.6e-29)
t_1
(if (<= z 4.4e-113)
(+ x (* (- x t) (/ (- z y) a)))
(if (<= z 5.4e+81) t_1 (* t (/ z (- z a)))))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((t * (y - z)) / (a - z));
double tmp;
if (z <= -2.1e+93) {
tmp = t * (1.0 - (y / z));
} else if (z <= -3.6e-29) {
tmp = t_1;
} else if (z <= 4.4e-113) {
tmp = x + ((x - t) * ((z - y) / a));
} else if (z <= 5.4e+81) {
tmp = t_1;
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 + ((t * (y - z)) / (a - z))
if (z <= (-2.1d+93)) then
tmp = t * (1.0d0 - (y / z))
else if (z <= (-3.6d-29)) then
tmp = t_1
else if (z <= 4.4d-113) then
tmp = x + ((x - t) * ((z - y) / a))
else if (z <= 5.4d+81) then
tmp = t_1
else
tmp = t * (z / (z - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((t * (y - z)) / (a - z));
double tmp;
if (z <= -2.1e+93) {
tmp = t * (1.0 - (y / z));
} else if (z <= -3.6e-29) {
tmp = t_1;
} else if (z <= 4.4e-113) {
tmp = x + ((x - t) * ((z - y) / a));
} else if (z <= 5.4e+81) {
tmp = t_1;
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((t * (y - z)) / (a - z)) tmp = 0 if z <= -2.1e+93: tmp = t * (1.0 - (y / z)) elif z <= -3.6e-29: tmp = t_1 elif z <= 4.4e-113: tmp = x + ((x - t) * ((z - y) / a)) elif z <= 5.4e+81: tmp = t_1 else: tmp = t * (z / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(t * Float64(y - z)) / Float64(a - z))) tmp = 0.0 if (z <= -2.1e+93) tmp = Float64(t * Float64(1.0 - Float64(y / z))); elseif (z <= -3.6e-29) tmp = t_1; elseif (z <= 4.4e-113) tmp = Float64(x + Float64(Float64(x - t) * Float64(Float64(z - y) / a))); elseif (z <= 5.4e+81) tmp = t_1; else tmp = Float64(t * Float64(z / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((t * (y - z)) / (a - z)); tmp = 0.0; if (z <= -2.1e+93) tmp = t * (1.0 - (y / z)); elseif (z <= -3.6e-29) tmp = t_1; elseif (z <= 4.4e-113) tmp = x + ((x - t) * ((z - y) / a)); elseif (z <= 5.4e+81) tmp = t_1; else tmp = t * (z / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+93], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e-29], t$95$1, If[LessEqual[z, 4.4e-113], N[(x + N[(N[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e+81], t$95$1, N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := x + \frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+93}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-113}:\\
\;\;\;\;x + \left(x - t\right) \cdot \frac{z - y}{a}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\end{array}
if z < -2.0999999999999998e93Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f6436.6%
Applied rewrites36.6%
if -2.0999999999999998e93 < z < -3.5999999999999997e-29 or 4.4000000000000001e-113 < z < 5.3999999999999999e81Initial program 79.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6456.1%
Applied rewrites56.1%
if -3.5999999999999997e-29 < z < 4.4000000000000001e-113Initial program 79.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
Taylor expanded in z around 0
Applied rewrites52.6%
if 5.3999999999999999e81 < z Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6429.9%
Applied rewrites29.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.1e+93)
(* t (- 1.0 (/ y z)))
(if (<= z -7.2e-117)
(+ x (/ (* t (- y z)) (- a z)))
(if (<= z 4.6e+81)
(+ x (/ (* y (- t x)) (- a z)))
(* t (/ z (- z a)))))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e+93) {
tmp = t * (1.0 - (y / z));
} else if (z <= -7.2e-117) {
tmp = x + ((t * (y - z)) / (a - z));
} else if (z <= 4.6e+81) {
tmp = x + ((y * (t - x)) / (a - z));
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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.1d+93)) then
tmp = t * (1.0d0 - (y / z))
else if (z <= (-7.2d-117)) then
tmp = x + ((t * (y - z)) / (a - z))
else if (z <= 4.6d+81) then
tmp = x + ((y * (t - x)) / (a - z))
else
tmp = t * (z / (z - a))
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.1e+93) {
tmp = t * (1.0 - (y / z));
} else if (z <= -7.2e-117) {
tmp = x + ((t * (y - z)) / (a - z));
} else if (z <= 4.6e+81) {
tmp = x + ((y * (t - x)) / (a - z));
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.1e+93: tmp = t * (1.0 - (y / z)) elif z <= -7.2e-117: tmp = x + ((t * (y - z)) / (a - z)) elif z <= 4.6e+81: tmp = x + ((y * (t - x)) / (a - z)) else: tmp = t * (z / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.1e+93) tmp = Float64(t * Float64(1.0 - Float64(y / z))); elseif (z <= -7.2e-117) tmp = Float64(x + Float64(Float64(t * Float64(y - z)) / Float64(a - z))); elseif (z <= 4.6e+81) tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z))); else tmp = Float64(t * Float64(z / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.1e+93) tmp = t * (1.0 - (y / z)); elseif (z <= -7.2e-117) tmp = x + ((t * (y - z)) / (a - z)); elseif (z <= 4.6e+81) tmp = x + ((y * (t - x)) / (a - z)); else tmp = t * (z / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.1e+93], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.2e-117], N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e+81], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+93}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-117}:\\
\;\;\;\;x + \frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+81}:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\end{array}
if z < -2.0999999999999998e93Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f6436.6%
Applied rewrites36.6%
if -2.0999999999999998e93 < z < -7.2000000000000001e-117Initial program 79.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6456.1%
Applied rewrites56.1%
if -7.2000000000000001e-117 < z < 4.5999999999999998e81Initial program 79.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6454.8%
Applied rewrites54.8%
if 4.5999999999999998e81 < z Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6429.9%
Applied rewrites29.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- t x) (/ y (- a z)))))
(if (<= y -3.1e-61)
t_1
(if (<= y -1.52e-139)
(* t (/ z (- z a)))
(if (<= y 2.8e+23) (+ x (/ (* t (- y z)) (- a z))) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) * (y / (a - z));
double tmp;
if (y <= -3.1e-61) {
tmp = t_1;
} else if (y <= -1.52e-139) {
tmp = t * (z / (z - a));
} else if (y <= 2.8e+23) {
tmp = x + ((t * (y - z)) / (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 - x) * (y / (a - z))
if (y <= (-3.1d-61)) then
tmp = t_1
else if (y <= (-1.52d-139)) then
tmp = t * (z / (z - a))
else if (y <= 2.8d+23) then
tmp = x + ((t * (y - z)) / (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 - x) * (y / (a - z));
double tmp;
if (y <= -3.1e-61) {
tmp = t_1;
} else if (y <= -1.52e-139) {
tmp = t * (z / (z - a));
} else if (y <= 2.8e+23) {
tmp = x + ((t * (y - z)) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t - x) * (y / (a - z)) tmp = 0 if y <= -3.1e-61: tmp = t_1 elif y <= -1.52e-139: tmp = t * (z / (z - a)) elif y <= 2.8e+23: tmp = x + ((t * (y - z)) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) * Float64(y / Float64(a - z))) tmp = 0.0 if (y <= -3.1e-61) tmp = t_1; elseif (y <= -1.52e-139) tmp = Float64(t * Float64(z / Float64(z - a))); elseif (y <= 2.8e+23) tmp = Float64(x + Float64(Float64(t * Float64(y - z)) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t - x) * (y / (a - z)); tmp = 0.0; if (y <= -3.1e-61) tmp = t_1; elseif (y <= -1.52e-139) tmp = t * (z / (z - a)); elseif (y <= 2.8e+23) tmp = x + ((t * (y - z)) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e-61], t$95$1, If[LessEqual[y, -1.52e-139], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+23], N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{-61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.52 \cdot 10^{-139}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+23}:\\
\;\;\;\;x + \frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -3.0999999999999999e-61 or 2.8000000000000002e23 < y Initial program 79.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5%
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6441.8%
Applied rewrites41.8%
associate-*r/41.8%
sub-negate-rev41.8%
distribute-rgt-neg-out41.8%
distribute-lft-neg-out41.8%
sub-negate-rev41.8%
frac-2neg-rev41.8%
mul-1-neg41.8%
sub-negate-rev41.8%
lift--.f64N/A
associate-*l/N/A
lift--.f6441.8%
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites43.3%
if -3.0999999999999999e-61 < y < -1.52e-139Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6429.9%
Applied rewrites29.9%
if -1.52e-139 < y < 2.8000000000000002e23Initial program 79.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6456.1%
Applied rewrites56.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ t a)))))
(if (<= a -9.2e+198)
t_1
(if (<= a -1e-81)
(+ x (/ (* y (- t x)) a))
(if (<= a 16000000000.0) (* t (- 1.0 (/ y z))) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * (t / a));
double tmp;
if (a <= -9.2e+198) {
tmp = t_1;
} else if (a <= -1e-81) {
tmp = x + ((y * (t - x)) / a);
} else if (a <= 16000000000.0) {
tmp = t * (1.0 - (y / z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 / a))
if (a <= (-9.2d+198)) then
tmp = t_1
else if (a <= (-1d-81)) then
tmp = x + ((y * (t - x)) / a)
else if (a <= 16000000000.0d0) then
tmp = t * (1.0d0 - (y / z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * (t / a));
double tmp;
if (a <= -9.2e+198) {
tmp = t_1;
} else if (a <= -1e-81) {
tmp = x + ((y * (t - x)) / a);
} else if (a <= 16000000000.0) {
tmp = t * (1.0 - (y / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * (t / a)) tmp = 0 if a <= -9.2e+198: tmp = t_1 elif a <= -1e-81: tmp = x + ((y * (t - x)) / a) elif a <= 16000000000.0: tmp = t * (1.0 - (y / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(t / a))) tmp = 0.0 if (a <= -9.2e+198) tmp = t_1; elseif (a <= -1e-81) tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / a)); elseif (a <= 16000000000.0) tmp = Float64(t * Float64(1.0 - Float64(y / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * (t / a)); tmp = 0.0; if (a <= -9.2e+198) tmp = t_1; elseif (a <= -1e-81) tmp = x + ((y * (t - x)) / a); elseif (a <= 16000000000.0) tmp = t * (1.0 - (y / z)); 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[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9.2e+198], t$95$1, If[LessEqual[a, -1e-81], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 16000000000.0], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t}{a}\\
\mathbf{if}\;a \leq -9.2 \cdot 10^{+198}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1 \cdot 10^{-81}:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a}\\
\mathbf{elif}\;a \leq 16000000000:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -9.2000000000000002e198 or 1.6e10 < a Initial program 79.6%
Taylor expanded in x around 0
Applied rewrites63.8%
Taylor expanded in z around 0
Applied rewrites44.0%
if -9.2000000000000002e198 < a < -9.9999999999999996e-82Initial program 79.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.9%
Applied rewrites43.9%
if -9.9999999999999996e-82 < a < 1.6e10Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f6436.6%
Applied rewrites36.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.5e-14)
(* t (- 1.0 (/ y z)))
(if (<= z 1.05e-110)
(+ x (/ (* y (- t x)) a))
(if (<= z 2.2e+102)
(* (- t x) (/ y (- a z)))
(* t (/ z (- z a)))))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e-14) {
tmp = t * (1.0 - (y / z));
} else if (z <= 1.05e-110) {
tmp = x + ((y * (t - x)) / a);
} else if (z <= 2.2e+102) {
tmp = (t - x) * (y / (a - z));
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 <= (-6.5d-14)) then
tmp = t * (1.0d0 - (y / z))
else if (z <= 1.05d-110) then
tmp = x + ((y * (t - x)) / a)
else if (z <= 2.2d+102) then
tmp = (t - x) * (y / (a - z))
else
tmp = t * (z / (z - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e-14) {
tmp = t * (1.0 - (y / z));
} else if (z <= 1.05e-110) {
tmp = x + ((y * (t - x)) / a);
} else if (z <= 2.2e+102) {
tmp = (t - x) * (y / (a - z));
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.5e-14: tmp = t * (1.0 - (y / z)) elif z <= 1.05e-110: tmp = x + ((y * (t - x)) / a) elif z <= 2.2e+102: tmp = (t - x) * (y / (a - z)) else: tmp = t * (z / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.5e-14) tmp = Float64(t * Float64(1.0 - Float64(y / z))); elseif (z <= 1.05e-110) tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / a)); elseif (z <= 2.2e+102) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); else tmp = Float64(t * Float64(z / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.5e-14) tmp = t * (1.0 - (y / z)); elseif (z <= 1.05e-110) tmp = x + ((y * (t - x)) / a); elseif (z <= 2.2e+102) tmp = (t - x) * (y / (a - z)); else tmp = t * (z / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e-14], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-110], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+102], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-14}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-110}:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+102}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\end{array}
if z < -6.5000000000000001e-14Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f6436.6%
Applied rewrites36.6%
if -6.5000000000000001e-14 < z < 1.05e-110Initial program 79.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.9%
Applied rewrites43.9%
if 1.05e-110 < z < 2.2000000000000001e102Initial program 79.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5%
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6441.8%
Applied rewrites41.8%
associate-*r/41.8%
sub-negate-rev41.8%
distribute-rgt-neg-out41.8%
distribute-lft-neg-out41.8%
sub-negate-rev41.8%
frac-2neg-rev41.8%
mul-1-neg41.8%
sub-negate-rev41.8%
lift--.f64N/A
associate-*l/N/A
lift--.f6441.8%
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites43.3%
if 2.2000000000000001e102 < z Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6429.9%
Applied rewrites29.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- t x) (/ y (- a z)))))
(if (<= y -3.1e-61)
t_1
(if (<= y 4.8e+18) (* t (/ z (- z a))) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) * (y / (a - z));
double tmp;
if (y <= -3.1e-61) {
tmp = t_1;
} else if (y <= 4.8e+18) {
tmp = t * (z / (z - 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 / (a - z))
if (y <= (-3.1d-61)) then
tmp = t_1
else if (y <= 4.8d+18) then
tmp = t * (z / (z - 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 / (a - z));
double tmp;
if (y <= -3.1e-61) {
tmp = t_1;
} else if (y <= 4.8e+18) {
tmp = t * (z / (z - a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t - x) * (y / (a - z)) tmp = 0 if y <= -3.1e-61: tmp = t_1 elif y <= 4.8e+18: tmp = t * (z / (z - a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) * Float64(y / Float64(a - z))) tmp = 0.0 if (y <= -3.1e-61) tmp = t_1; elseif (y <= 4.8e+18) tmp = Float64(t * Float64(z / Float64(z - a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t - x) * (y / (a - z)); tmp = 0.0; if (y <= -3.1e-61) tmp = t_1; elseif (y <= 4.8e+18) tmp = t * (z / (z - a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e-61], t$95$1, If[LessEqual[y, 4.8e+18], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{-61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+18}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -3.0999999999999999e-61 or 4.8e18 < y Initial program 79.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5%
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6441.8%
Applied rewrites41.8%
associate-*r/41.8%
sub-negate-rev41.8%
distribute-rgt-neg-out41.8%
distribute-lft-neg-out41.8%
sub-negate-rev41.8%
frac-2neg-rev41.8%
mul-1-neg41.8%
sub-negate-rev41.8%
lift--.f64N/A
associate-*l/N/A
lift--.f6441.8%
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites43.3%
if -3.0999999999999999e-61 < y < 4.8e18Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6429.9%
Applied rewrites29.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ (- t x) (- a z)) y))) (if (<= y -4e-54) t_1 (if (<= y 4.8e+18) (* t (/ z (- z a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - x) / (a - z)) * y;
double tmp;
if (y <= -4e-54) {
tmp = t_1;
} else if (y <= 4.8e+18) {
tmp = t * (z / (z - 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) / (a - z)) * y
if (y <= (-4d-54)) then
tmp = t_1
else if (y <= 4.8d+18) then
tmp = t * (z / (z - 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) / (a - z)) * y;
double tmp;
if (y <= -4e-54) {
tmp = t_1;
} else if (y <= 4.8e+18) {
tmp = t * (z / (z - a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((t - x) / (a - z)) * y tmp = 0 if y <= -4e-54: tmp = t_1 elif y <= 4.8e+18: tmp = t * (z / (z - a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(t - x) / Float64(a - z)) * y) tmp = 0.0 if (y <= -4e-54) tmp = t_1; elseif (y <= 4.8e+18) tmp = Float64(t * Float64(z / Float64(z - a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((t - x) / (a - z)) * y; tmp = 0.0; if (y <= -4e-54) tmp = t_1; elseif (y <= 4.8e+18) tmp = t * (z / (z - a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -4e-54], t$95$1, If[LessEqual[y, 4.8e+18], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - x}{a - z} \cdot y\\
\mathbf{if}\;y \leq -4 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+18}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -4.0000000000000001e-54 or 4.8e18 < y Initial program 79.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5%
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6441.8%
Applied rewrites41.8%
if -4.0000000000000001e-54 < y < 4.8e18Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6429.9%
Applied rewrites29.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.5e-14)
(* t (- 1.0 (/ y z)))
(if (<= z 1.05e-110)
(* (- (/ (- y) a) -1.0) x)
(* t (/ z (- z a))))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e-14) {
tmp = t * (1.0 - (y / z));
} else if (z <= 1.05e-110) {
tmp = ((-y / a) - -1.0) * x;
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 <= (-6.5d-14)) then
tmp = t * (1.0d0 - (y / z))
else if (z <= 1.05d-110) then
tmp = ((-y / a) - (-1.0d0)) * x
else
tmp = t * (z / (z - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e-14) {
tmp = t * (1.0 - (y / z));
} else if (z <= 1.05e-110) {
tmp = ((-y / a) - -1.0) * x;
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.5e-14: tmp = t * (1.0 - (y / z)) elif z <= 1.05e-110: tmp = ((-y / a) - -1.0) * x else: tmp = t * (z / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.5e-14) tmp = Float64(t * Float64(1.0 - Float64(y / z))); elseif (z <= 1.05e-110) tmp = Float64(Float64(Float64(Float64(-y) / a) - -1.0) * x); else tmp = Float64(t * Float64(z / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.5e-14) tmp = t * (1.0 - (y / z)); elseif (z <= 1.05e-110) tmp = ((-y / a) - -1.0) * x; else tmp = t * (z / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e-14], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-110], N[(N[(N[((-y) / a), $MachinePrecision] - -1.0), $MachinePrecision] * x), $MachinePrecision], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-14}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-110}:\\
\;\;\;\;\left(\frac{-y}{a} - -1\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\end{array}
if z < -6.5000000000000001e-14Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f6436.6%
Applied rewrites36.6%
if -6.5000000000000001e-14 < z < 1.05e-110Initial program 79.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6443.2%
Applied rewrites43.2%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f6436.0%
Applied rewrites36.0%
associate-*r/36.0%
sub-negate-rev36.0%
distribute-rgt-neg-out36.0%
distribute-lft-neg-out36.0%
sub-negate-rev36.0%
frac-2neg-rev36.0%
mul-1-neg36.0%
sub-negate-rev36.0%
lift--.f64N/A
associate-*l/N/A
lift--.f6436.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0%
Applied rewrites36.0%
if 1.05e-110 < z Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6429.9%
Applied rewrites29.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- t x) a) y)))
(if (<= y -8.5e+225)
t_1
(if (<= y -1.8e-61)
(* t (- 1.0 (/ y z)))
(if (<= y 4e+31) (* t (/ z (- z a))) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - x) / a) * y;
double tmp;
if (y <= -8.5e+225) {
tmp = t_1;
} else if (y <= -1.8e-61) {
tmp = t * (1.0 - (y / z));
} else if (y <= 4e+31) {
tmp = t * (z / (z - 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) / a) * y
if (y <= (-8.5d+225)) then
tmp = t_1
else if (y <= (-1.8d-61)) then
tmp = t * (1.0d0 - (y / z))
else if (y <= 4d+31) then
tmp = t * (z / (z - 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) / a) * y;
double tmp;
if (y <= -8.5e+225) {
tmp = t_1;
} else if (y <= -1.8e-61) {
tmp = t * (1.0 - (y / z));
} else if (y <= 4e+31) {
tmp = t * (z / (z - a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((t - x) / a) * y tmp = 0 if y <= -8.5e+225: tmp = t_1 elif y <= -1.8e-61: tmp = t * (1.0 - (y / z)) elif y <= 4e+31: tmp = t * (z / (z - a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(t - x) / a) * y) tmp = 0.0 if (y <= -8.5e+225) tmp = t_1; elseif (y <= -1.8e-61) tmp = Float64(t * Float64(1.0 - Float64(y / z))); elseif (y <= 4e+31) tmp = Float64(t * Float64(z / Float64(z - a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((t - x) / a) * y; tmp = 0.0; if (y <= -8.5e+225) tmp = t_1; elseif (y <= -1.8e-61) tmp = t * (1.0 - (y / z)); elseif (y <= 4e+31) tmp = t * (z / (z - a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -8.5e+225], t$95$1, If[LessEqual[y, -1.8e-61], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+31], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{t - x}{a} \cdot y\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+225}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-61}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+31}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -8.4999999999999995e225 or 3.9999999999999999e31 < y Initial program 79.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5%
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6441.8%
Applied rewrites41.8%
Taylor expanded in z around 0
lower-/.f64N/A
lower--.f6424.9%
Applied rewrites24.9%
if -8.4999999999999995e225 < y < -1.8000000000000001e-61Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f6436.6%
Applied rewrites36.6%
if -1.8000000000000001e-61 < y < 3.9999999999999999e31Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6429.9%
Applied rewrites29.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (- 1.0 (/ y z)))))
(if (<= z -3.2e-28)
t_1
(if (<= z 5.5e-144) (* (/ (- t x) a) y) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = t * (1.0 - (y / z));
double tmp;
if (z <= -3.2e-28) {
tmp = t_1;
} else if (z <= 5.5e-144) {
tmp = ((t - x) / a) * y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 * (1.0d0 - (y / z))
if (z <= (-3.2d-28)) then
tmp = t_1
else if (z <= 5.5d-144) then
tmp = ((t - x) / a) * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (1.0 - (y / z));
double tmp;
if (z <= -3.2e-28) {
tmp = t_1;
} else if (z <= 5.5e-144) {
tmp = ((t - x) / a) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (1.0 - (y / z)) tmp = 0 if z <= -3.2e-28: tmp = t_1 elif z <= 5.5e-144: tmp = ((t - x) / a) * y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -3.2e-28) tmp = t_1; elseif (z <= 5.5e-144) tmp = Float64(Float64(Float64(t - x) / a) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (1.0 - (y / z)); tmp = 0.0; if (z <= -3.2e-28) tmp = t_1; elseif (z <= 5.5e-144) tmp = ((t - x) / a) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e-28], t$95$1, If[LessEqual[z, 5.5e-144], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-144}:\\
\;\;\;\;\frac{t - x}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.1999999999999998e-28 or 5.4999999999999997e-144 < z Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f6436.6%
Applied rewrites36.6%
if -3.1999999999999998e-28 < z < 5.4999999999999997e-144Initial program 79.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5%
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6441.8%
Applied rewrites41.8%
Taylor expanded in z around 0
lower-/.f64N/A
lower--.f6424.9%
Applied rewrites24.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- t x) a) y)))
(if (<= y -2.5e-53)
t_1
(if (<= y -2e-182)
(+ x (- t x))
(if (<= y 4e+31) (/ (* t z) (- z a)) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - x) / a) * y;
double tmp;
if (y <= -2.5e-53) {
tmp = t_1;
} else if (y <= -2e-182) {
tmp = x + (t - x);
} else if (y <= 4e+31) {
tmp = (t * z) / (z - 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) / a) * y
if (y <= (-2.5d-53)) then
tmp = t_1
else if (y <= (-2d-182)) then
tmp = x + (t - x)
else if (y <= 4d+31) then
tmp = (t * z) / (z - 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) / a) * y;
double tmp;
if (y <= -2.5e-53) {
tmp = t_1;
} else if (y <= -2e-182) {
tmp = x + (t - x);
} else if (y <= 4e+31) {
tmp = (t * z) / (z - a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((t - x) / a) * y tmp = 0 if y <= -2.5e-53: tmp = t_1 elif y <= -2e-182: tmp = x + (t - x) elif y <= 4e+31: tmp = (t * z) / (z - a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(t - x) / a) * y) tmp = 0.0 if (y <= -2.5e-53) tmp = t_1; elseif (y <= -2e-182) tmp = Float64(x + Float64(t - x)); elseif (y <= 4e+31) tmp = Float64(Float64(t * z) / Float64(z - a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((t - x) / a) * y; tmp = 0.0; if (y <= -2.5e-53) tmp = t_1; elseif (y <= -2e-182) tmp = x + (t - x); elseif (y <= 4e+31) tmp = (t * z) / (z - a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.5e-53], t$95$1, If[LessEqual[y, -2e-182], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+31], N[(N[(t * z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{t - x}{a} \cdot y\\
\mathbf{if}\;y \leq -2.5 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2 \cdot 10^{-182}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+31}:\\
\;\;\;\;\frac{t \cdot z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.5e-53 or 3.9999999999999999e31 < y Initial program 79.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5%
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6441.8%
Applied rewrites41.8%
Taylor expanded in z around 0
lower-/.f64N/A
lower--.f6424.9%
Applied rewrites24.9%
if -2.5e-53 < y < -2.0000000000000001e-182Initial program 79.6%
Taylor expanded in z around inf
lower--.f6419.7%
Applied rewrites19.7%
if -2.0000000000000001e-182 < y < 3.9999999999999999e31Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.8%
Applied rewrites21.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- t x))))
(if (<= z -3500000000000.0)
t_1
(if (<= z 110000000.0) (* (/ (- t x) a) y) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -3500000000000.0) {
tmp = t_1;
} else if (z <= 110000000.0) {
tmp = ((t - x) / a) * y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 + (t - x)
if (z <= (-3500000000000.0d0)) then
tmp = t_1
else if (z <= 110000000.0d0) then
tmp = ((t - x) / a) * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -3500000000000.0) {
tmp = t_1;
} else if (z <= 110000000.0) {
tmp = ((t - x) / a) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t - x) tmp = 0 if z <= -3500000000000.0: tmp = t_1 elif z <= 110000000.0: tmp = ((t - x) / a) * y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -3500000000000.0) tmp = t_1; elseif (z <= 110000000.0) tmp = Float64(Float64(Float64(t - x) / a) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t - x); tmp = 0.0; if (z <= -3500000000000.0) tmp = t_1; elseif (z <= 110000000.0) tmp = ((t - x) / a) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3500000000000.0], t$95$1, If[LessEqual[z, 110000000.0], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -3500000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 110000000:\\
\;\;\;\;\frac{t - x}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.5e12 or 1.1e8 < z Initial program 79.6%
Taylor expanded in z around inf
lower--.f6419.7%
Applied rewrites19.7%
if -3.5e12 < z < 1.1e8Initial program 79.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5%
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6441.8%
Applied rewrites41.8%
Taylor expanded in z around 0
lower-/.f64N/A
lower--.f6424.9%
Applied rewrites24.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ t (- a z)) y)))
(if (<= y -1.62e+131)
t_1
(if (<= y -5.2e-11)
(* x (/ (- y a) z))
(if (<= y 1.45e+50) (+ x (- t x)) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = (t / (a - z)) * y;
double tmp;
if (y <= -1.62e+131) {
tmp = t_1;
} else if (y <= -5.2e-11) {
tmp = x * ((y - a) / z);
} else if (y <= 1.45e+50) {
tmp = x + (t - x);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 / (a - z)) * y
if (y <= (-1.62d+131)) then
tmp = t_1
else if (y <= (-5.2d-11)) then
tmp = x * ((y - a) / z)
else if (y <= 1.45d+50) then
tmp = x + (t - x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t / (a - z)) * y;
double tmp;
if (y <= -1.62e+131) {
tmp = t_1;
} else if (y <= -5.2e-11) {
tmp = x * ((y - a) / z);
} else if (y <= 1.45e+50) {
tmp = x + (t - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t / (a - z)) * y tmp = 0 if y <= -1.62e+131: tmp = t_1 elif y <= -5.2e-11: tmp = x * ((y - a) / z) elif y <= 1.45e+50: tmp = x + (t - x) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t / Float64(a - z)) * y) tmp = 0.0 if (y <= -1.62e+131) tmp = t_1; elseif (y <= -5.2e-11) tmp = Float64(x * Float64(Float64(y - a) / z)); elseif (y <= 1.45e+50) tmp = Float64(x + Float64(t - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t / (a - z)) * y; tmp = 0.0; if (y <= -1.62e+131) tmp = t_1; elseif (y <= -5.2e-11) tmp = x * ((y - a) / z); elseif (y <= 1.45e+50) tmp = x + (t - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -1.62e+131], t$95$1, If[LessEqual[y, -5.2e-11], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+50], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{t}{a - z} \cdot y\\
\mathbf{if}\;y \leq -1.62 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \frac{y - a}{z}\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+50}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.6199999999999999e131 or 1.45e50 < y Initial program 79.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5%
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6441.8%
Applied rewrites41.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f6423.1%
Applied rewrites23.1%
if -1.6199999999999999e131 < y < -5.2000000000000001e-11Initial program 79.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6443.2%
Applied rewrites43.2%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f6436.0%
Applied rewrites36.0%
Taylor expanded in z around -inf
lower-/.f64N/A
lower--.f6423.6%
Applied rewrites23.6%
if -5.2000000000000001e-11 < y < 1.45e50Initial program 79.6%
Taylor expanded in z around inf
lower--.f6419.7%
Applied rewrites19.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x (- y a)) z)) (t_2 (+ x (- t x))))
(if (<= z -6.8e-15)
t_2
(if (<= z -6e-169)
t_1
(if (<= z 5e-142) (/ (* t y) a) (if (<= z 1.85e+81) t_1 t_2))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (x * (y - a)) / z;
double t_2 = x + (t - x);
double tmp;
if (z <= -6.8e-15) {
tmp = t_2;
} else if (z <= -6e-169) {
tmp = t_1;
} else if (z <= 5e-142) {
tmp = (t * y) / a;
} else if (z <= 1.85e+81) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = (x * (y - a)) / z
t_2 = x + (t - x)
if (z <= (-6.8d-15)) then
tmp = t_2
else if (z <= (-6d-169)) then
tmp = t_1
else if (z <= 5d-142) then
tmp = (t * y) / a
else if (z <= 1.85d+81) then
tmp = t_1
else
tmp = t_2
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 - a)) / z;
double t_2 = x + (t - x);
double tmp;
if (z <= -6.8e-15) {
tmp = t_2;
} else if (z <= -6e-169) {
tmp = t_1;
} else if (z <= 5e-142) {
tmp = (t * y) / a;
} else if (z <= 1.85e+81) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * (y - a)) / z t_2 = x + (t - x) tmp = 0 if z <= -6.8e-15: tmp = t_2 elif z <= -6e-169: tmp = t_1 elif z <= 5e-142: tmp = (t * y) / a elif z <= 1.85e+81: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * Float64(y - a)) / z) t_2 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -6.8e-15) tmp = t_2; elseif (z <= -6e-169) tmp = t_1; elseif (z <= 5e-142) tmp = Float64(Float64(t * y) / a); elseif (z <= 1.85e+81) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x * (y - a)) / z; t_2 = x + (t - x); tmp = 0.0; if (z <= -6.8e-15) tmp = t_2; elseif (z <= -6e-169) tmp = t_1; elseif (z <= 5e-142) tmp = (t * y) / a; elseif (z <= 1.85e+81) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e-15], t$95$2, If[LessEqual[z, -6e-169], t$95$1, If[LessEqual[z, 5e-142], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 1.85e+81], t$95$1, t$95$2]]]]]]
\begin{array}{l}
t_1 := \frac{x \cdot \left(y - a\right)}{z}\\
t_2 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{-15}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-142}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if z < -6.8000000000000001e-15 or 1.85e81 < z Initial program 79.6%
Taylor expanded in z around inf
lower--.f6419.7%
Applied rewrites19.7%
if -6.8000000000000001e-15 < z < -5.9999999999999998e-169 or 5.0000000000000002e-142 < z < 1.85e81Initial program 79.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6443.2%
Applied rewrites43.2%
Taylor expanded in z around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6420.0%
Applied rewrites20.0%
if -5.9999999999999998e-169 < z < 5.0000000000000002e-142Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6416.5%
Applied rewrites16.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- t x))))
(if (<= z -6.8e-15)
t_1
(if (<= z -6e-169)
(/ (* x (- y a)) z)
(if (<= z 0.0024) (/ (* t y) (- a z)) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -6.8e-15) {
tmp = t_1;
} else if (z <= -6e-169) {
tmp = (x * (y - a)) / z;
} else if (z <= 0.0024) {
tmp = (t * 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 = x + (t - x)
if (z <= (-6.8d-15)) then
tmp = t_1
else if (z <= (-6d-169)) then
tmp = (x * (y - a)) / z
else if (z <= 0.0024d0) then
tmp = (t * 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 = x + (t - x);
double tmp;
if (z <= -6.8e-15) {
tmp = t_1;
} else if (z <= -6e-169) {
tmp = (x * (y - a)) / z;
} else if (z <= 0.0024) {
tmp = (t * y) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t - x) tmp = 0 if z <= -6.8e-15: tmp = t_1 elif z <= -6e-169: tmp = (x * (y - a)) / z elif z <= 0.0024: tmp = (t * y) / (a - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -6.8e-15) tmp = t_1; elseif (z <= -6e-169) tmp = Float64(Float64(x * Float64(y - a)) / z); elseif (z <= 0.0024) tmp = Float64(Float64(t * y) / Float64(a - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t - x); tmp = 0.0; if (z <= -6.8e-15) tmp = t_1; elseif (z <= -6e-169) tmp = (x * (y - a)) / z; elseif (z <= 0.0024) tmp = (t * y) / (a - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e-15], t$95$1, If[LessEqual[z, -6e-169], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 0.0024], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-169}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
\mathbf{elif}\;z \leq 0.0024:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -6.8000000000000001e-15 or 0.0023999999999999998 < z Initial program 79.6%
Taylor expanded in z around inf
lower--.f6419.7%
Applied rewrites19.7%
if -6.8000000000000001e-15 < z < -5.9999999999999998e-169Initial program 79.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6443.2%
Applied rewrites43.2%
Taylor expanded in z around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6420.0%
Applied rewrites20.0%
if -5.9999999999999998e-169 < z < 0.0023999999999999998Initial program 79.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5%
Applied rewrites41.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3%
Applied rewrites21.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* x (/ (- y a) z)))) (if (<= x -6e+20) t_1 (if (<= x 2.8e+30) (+ x (- t x)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x * ((y - a) / z);
double tmp;
if (x <= -6e+20) {
tmp = t_1;
} else if (x <= 2.8e+30) {
tmp = x + (t - x);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 - a) / z)
if (x <= (-6d+20)) then
tmp = t_1
else if (x <= 2.8d+30) then
tmp = x + (t - x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * ((y - a) / z);
double tmp;
if (x <= -6e+20) {
tmp = t_1;
} else if (x <= 2.8e+30) {
tmp = x + (t - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x * ((y - a) / z) tmp = 0 if x <= -6e+20: tmp = t_1 elif x <= 2.8e+30: tmp = x + (t - x) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x * Float64(Float64(y - a) / z)) tmp = 0.0 if (x <= -6e+20) tmp = t_1; elseif (x <= 2.8e+30) tmp = Float64(x + Float64(t - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x * ((y - a) / z); tmp = 0.0; if (x <= -6e+20) tmp = t_1; elseif (x <= 2.8e+30) tmp = x + (t - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6e+20], t$95$1, If[LessEqual[x, 2.8e+30], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x \cdot \frac{y - a}{z}\\
\mathbf{if}\;x \leq -6 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+30}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -6e20 or 2.7999999999999998e30 < x Initial program 79.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6443.2%
Applied rewrites43.2%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f6436.0%
Applied rewrites36.0%
Taylor expanded in z around -inf
lower-/.f64N/A
lower--.f6423.6%
Applied rewrites23.6%
if -6e20 < x < 2.7999999999999998e30Initial program 79.6%
Taylor expanded in z around inf
lower--.f6419.7%
Applied rewrites19.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- t x))))
(if (<= z -6.8e-15)
t_1
(if (<= z -9e-170)
(/ (* x y) z)
(if (<= z 0.0024) (/ (* t y) a) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -6.8e-15) {
tmp = t_1;
} else if (z <= -9e-170) {
tmp = (x * y) / z;
} else if (z <= 0.0024) {
tmp = (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 = x + (t - x)
if (z <= (-6.8d-15)) then
tmp = t_1
else if (z <= (-9d-170)) then
tmp = (x * y) / z
else if (z <= 0.0024d0) then
tmp = (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 = x + (t - x);
double tmp;
if (z <= -6.8e-15) {
tmp = t_1;
} else if (z <= -9e-170) {
tmp = (x * y) / z;
} else if (z <= 0.0024) {
tmp = (t * y) / a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t - x) tmp = 0 if z <= -6.8e-15: tmp = t_1 elif z <= -9e-170: tmp = (x * y) / z elif z <= 0.0024: tmp = (t * y) / a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -6.8e-15) tmp = t_1; elseif (z <= -9e-170) tmp = Float64(Float64(x * y) / z); elseif (z <= 0.0024) tmp = Float64(Float64(t * y) / a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t - x); tmp = 0.0; if (z <= -6.8e-15) tmp = t_1; elseif (z <= -9e-170) tmp = (x * y) / z; elseif (z <= 0.0024) tmp = (t * y) / a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e-15], t$95$1, If[LessEqual[z, -9e-170], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 0.0024], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-170}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 0.0024:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -6.8000000000000001e-15 or 0.0023999999999999998 < z Initial program 79.6%
Taylor expanded in z around inf
lower--.f6419.7%
Applied rewrites19.7%
if -6.8000000000000001e-15 < z < -9e-170Initial program 79.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6443.2%
Applied rewrites43.2%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f6436.0%
Applied rewrites36.0%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f6416.7%
Applied rewrites16.7%
if -9e-170 < z < 0.0023999999999999998Initial program 79.6%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.2%
Applied rewrites68.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.7%
Applied rewrites51.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6416.5%
Applied rewrites16.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* x y) z))) (if (<= x -1.05e+83) t_1 (if (<= x 2.8e+30) (+ x (- t x)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / z;
double tmp;
if (x <= -1.05e+83) {
tmp = t_1;
} else if (x <= 2.8e+30) {
tmp = x + (t - x);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 (x <= (-1.05d+83)) then
tmp = t_1
else if (x <= 2.8d+30) then
tmp = x + (t - x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / z;
double tmp;
if (x <= -1.05e+83) {
tmp = t_1;
} else if (x <= 2.8e+30) {
tmp = x + (t - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * y) / z tmp = 0 if x <= -1.05e+83: tmp = t_1 elif x <= 2.8e+30: tmp = x + (t - x) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / z) tmp = 0.0 if (x <= -1.05e+83) tmp = t_1; elseif (x <= 2.8e+30) tmp = Float64(x + Float64(t - x)); 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 (x <= -1.05e+83) tmp = t_1; elseif (x <= 2.8e+30) tmp = x + (t - x); 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[x, -1.05e+83], t$95$1, If[LessEqual[x, 2.8e+30], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x \cdot y}{z}\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+30}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -1.05e83 or 2.7999999999999998e30 < x Initial program 79.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6443.2%
Applied rewrites43.2%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f6436.0%
Applied rewrites36.0%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f6416.7%
Applied rewrites16.7%
if -1.05e83 < x < 2.7999999999999998e30Initial program 79.6%
Taylor expanded in z around inf
lower--.f6419.7%
Applied rewrites19.7%
(FPCore (x y z t a) :precision binary64 (+ x (- t x)))
double code(double x, double y, double z, double t, double a) {
return x + (t - x);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 - x)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t - x);
}
def code(x, y, z, t, a): return x + (t - x)
function code(x, y, z, t, a) return Float64(x + Float64(t - x)) end
function tmp = code(x, y, z, t, a) tmp = x + (t - x); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]
x + \left(t - x\right)
Initial program 79.6%
Taylor expanded in z around inf
lower--.f6419.7%
Applied rewrites19.7%
(FPCore (x y z t a) :precision binary64 (+ (- x) x))
double code(double x, double y, double z, double t, double a) {
return -x + x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 + x
end function
public static double code(double x, double y, double z, double t, double a) {
return -x + x;
}
def code(x, y, z, t, a): return -x + x
function code(x, y, z, t, a) return Float64(Float64(-x) + x) end
function tmp = code(x, y, z, t, a) tmp = -x + x; end
code[x_, y_, z_, t_, a_] := N[((-x) + x), $MachinePrecision]
\left(-x\right) + x
Initial program 79.6%
Taylor expanded in z around inf
lower--.f6419.7%
Applied rewrites19.7%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8%
Applied rewrites2.8%
herbie shell --seed 2025258
(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)))))