
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - 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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - 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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ t (- 1.0 z))))
(if (<= (- (/ y z) t_1) 1e+306)
(* x (- (* (/ y -1.0) (/ -1.0 z)) t_1))
(* y (/ x z)))))
double code(double x, double y, double z, double t) {
double t_1 = t / (1.0 - z);
double tmp;
if (((y / z) - t_1) <= 1e+306) {
tmp = x * (((y / -1.0) * (-1.0 / z)) - t_1);
} else {
tmp = y * (x / z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = t / (1.0d0 - z)
if (((y / z) - t_1) <= 1d+306) then
tmp = x * (((y / (-1.0d0)) * ((-1.0d0) / z)) - t_1)
else
tmp = y * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t / (1.0 - z);
double tmp;
if (((y / z) - t_1) <= 1e+306) {
tmp = x * (((y / -1.0) * (-1.0 / z)) - t_1);
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = t / (1.0 - z) tmp = 0 if ((y / z) - t_1) <= 1e+306: tmp = x * (((y / -1.0) * (-1.0 / z)) - t_1) else: tmp = y * (x / z) return tmp
function code(x, y, z, t) t_1 = Float64(t / Float64(1.0 - z)) tmp = 0.0 if (Float64(Float64(y / z) - t_1) <= 1e+306) tmp = Float64(x * Float64(Float64(Float64(y / -1.0) * Float64(-1.0 / z)) - t_1)); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t / (1.0 - z); tmp = 0.0; if (((y / z) - t_1) <= 1e+306) tmp = x * (((y / -1.0) * (-1.0 / z)) - t_1); else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(y / z), $MachinePrecision] - t$95$1), $MachinePrecision], 1e+306], N[(x * N[(N[(N[(y / -1.0), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{1 - z}\\
\mathbf{if}\;\frac{y}{z} - t\_1 \leq 10^{+306}:\\
\;\;\;\;x \cdot \left(\frac{y}{-1} \cdot \frac{-1}{z} - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 1.00000000000000002e306Initial program 94.4%
lift-/.f64N/A
frac-2negN/A
mul-1-negN/A
*-commutativeN/A
mul-1-negN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.4
Applied rewrites94.4%
if 1.00000000000000002e306 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 94.4%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.4
Applied rewrites60.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6460.1
Applied rewrites60.1%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6460.6
Applied rewrites60.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (/ y z) (/ t (- 1.0 z))))) (if (<= t_1 1e+306) (* x t_1) (* y (/ x z)))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= 1e+306) {
tmp = x * t_1;
} else {
tmp = y * (x / z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = (y / z) - (t / (1.0d0 - z))
if (t_1 <= 1d+306) then
tmp = x * t_1
else
tmp = y * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= 1e+306) {
tmp = x * t_1;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_1 <= 1e+306: tmp = x * t_1 else: tmp = y * (x / z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) tmp = 0.0 if (t_1 <= 1e+306) tmp = Float64(x * t_1); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) - (t / (1.0 - z)); tmp = 0.0; if (t_1 <= 1e+306) tmp = x * t_1; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+306], N[(x * t$95$1), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t\_1 \leq 10^{+306}:\\
\;\;\;\;x \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 1.00000000000000002e306Initial program 94.4%
if 1.00000000000000002e306 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 94.4%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.4
Applied rewrites60.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6460.1
Applied rewrites60.1%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6460.6
Applied rewrites60.6%
(FPCore (x y z t) :precision binary64 (if (<= z -1.0) (* x (- (/ y z) (/ t (- z)))) (if (<= z 1.0) (* x (- (/ y z) t)) (* x (/ (- y (- t)) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.0) {
tmp = x * ((y / z) - (t / -z));
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = x * ((y - -t) / z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: tmp
if (z <= (-1.0d0)) then
tmp = x * ((y / z) - (t / -z))
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
else
tmp = x * ((y - -t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.0) {
tmp = x * ((y / z) - (t / -z));
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = x * ((y - -t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.0: tmp = x * ((y / z) - (t / -z)) elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = x * ((y - -t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.0) tmp = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(-z)))); elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(x * Float64(Float64(y - Float64(-t)) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.0) tmp = x * ((y / z) - (t / -z)); elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = x * ((y - -t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.0], N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y - (-t)), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - \frac{t}{-z}\right)\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - \left(-t\right)}{z}\\
\end{array}
\end{array}
if z < -1Initial program 94.4%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6472.4
Applied rewrites72.4%
if -1 < z < 1Initial program 94.4%
Taylor expanded in z around 0
Applied rewrites64.9%
if 1 < z Initial program 94.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6473.3
Applied rewrites73.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ (- y (- t)) z)))) (if (<= z -1.0) t_1 (if (<= z 1.0) (* x (- (/ y z) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y - -t) / z);
double tmp;
if (z <= -1.0) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = x * ((y - -t) / z)
if (z <= (-1.0d0)) then
tmp = t_1
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y - -t) / z);
double tmp;
if (z <= -1.0) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y - -t) / z) tmp = 0 if z <= -1.0: tmp = t_1 elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y - Float64(-t)) / z)) tmp = 0.0 if (z <= -1.0) tmp = t_1; elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y - -t) / z); tmp = 0.0; if (z <= -1.0) tmp = t_1; elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y - (-t)), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.0], t$95$1, If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y - \left(-t\right)}{z}\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 94.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6473.3
Applied rewrites73.3%
if -1 < z < 1Initial program 94.4%
Taylor expanded in z around 0
Applied rewrites64.9%
(FPCore (x y z t) :precision binary64 (if (<= z -0.98) (* (+ t y) (/ x z)) (if (<= z 1.0) (* x (- (/ y z) t)) (/ (* (+ t y) x) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.98) {
tmp = (t + y) * (x / z);
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = ((t + y) * x) / z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: tmp
if (z <= (-0.98d0)) then
tmp = (t + y) * (x / z)
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
else
tmp = ((t + y) * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.98) {
tmp = (t + y) * (x / z);
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = ((t + y) * x) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -0.98: tmp = (t + y) * (x / z) elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = ((t + y) * x) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -0.98) tmp = Float64(Float64(t + y) * Float64(x / z)); elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(Float64(Float64(t + y) * x) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -0.98) tmp = (t + y) * (x / z); elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = ((t + y) * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.98], N[(N[(t + y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t + y), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.98:\\
\;\;\;\;\left(t + y\right) \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t + y\right) \cdot x}{z}\\
\end{array}
\end{array}
if z < -0.97999999999999998Initial program 94.4%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6471.5
Applied rewrites71.5%
Taylor expanded in y around 0
lower-+.f6471.5
Applied rewrites71.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6471.3
Applied rewrites71.3%
if -0.97999999999999998 < z < 1Initial program 94.4%
Taylor expanded in z around 0
Applied rewrites64.9%
if 1 < z Initial program 94.4%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6471.5
Applied rewrites71.5%
Taylor expanded in y around 0
lower-+.f6471.5
Applied rewrites71.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (+ t y) (/ x z)))) (if (<= z -0.98) t_1 (if (<= z 1.0) (* x (- (/ y z) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (t + y) * (x / z);
double tmp;
if (z <= -0.98) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = (t + y) * (x / z)
if (z <= (-0.98d0)) then
tmp = t_1
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (t + y) * (x / z);
double tmp;
if (z <= -0.98) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t + y) * (x / z) tmp = 0 if z <= -0.98: tmp = t_1 elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t + y) * Float64(x / z)) tmp = 0.0 if (z <= -0.98) tmp = t_1; elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t + y) * (x / z); tmp = 0.0; if (z <= -0.98) tmp = t_1; elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.98], t$95$1, If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -0.98:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.97999999999999998 or 1 < z Initial program 94.4%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6471.5
Applied rewrites71.5%
Taylor expanded in y around 0
lower-+.f6471.5
Applied rewrites71.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6471.3
Applied rewrites71.3%
if -0.97999999999999998 < z < 1Initial program 94.4%
Taylor expanded in z around 0
Applied rewrites64.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ t z)))) (if (<= z -2.2e+202) t_1 (if (<= z 4.8e+16) (* x (- (/ y z) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (z <= -2.2e+202) {
tmp = t_1;
} else if (z <= 4.8e+16) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (z <= (-2.2d+202)) then
tmp = t_1
else if (z <= 4.8d+16) then
tmp = x * ((y / z) - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (z <= -2.2e+202) {
tmp = t_1;
} else if (z <= 4.8e+16) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if z <= -2.2e+202: tmp = t_1 elif z <= 4.8e+16: tmp = x * ((y / z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (z <= -2.2e+202) tmp = t_1; elseif (z <= 4.8e+16) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (z <= -2.2e+202) tmp = t_1; elseif (z <= 4.8e+16) tmp = x * ((y / z) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+202], t$95$1, If[LessEqual[z, 4.8e+16], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+202}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+16}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.19999999999999978e202 or 4.8e16 < z Initial program 94.4%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f6446.2
Applied rewrites46.2%
Taylor expanded in z around inf
lower-/.f6435.6
Applied rewrites35.6%
if -2.19999999999999978e202 < z < 4.8e16Initial program 94.4%
Taylor expanded in z around 0
Applied rewrites64.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -5.6e+33)
t_1
(if (<= t -1.1e-271)
(* x (/ y z))
(if (<= t 8.8e+139) (/ (* y x) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -5.6e+33) {
tmp = t_1;
} else if (t <= -1.1e-271) {
tmp = x * (y / z);
} else if (t <= 8.8e+139) {
tmp = (y * 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)
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) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (t <= (-5.6d+33)) then
tmp = t_1
else if (t <= (-1.1d-271)) then
tmp = x * (y / z)
else if (t <= 8.8d+139) then
tmp = (y * 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 t_1 = x * (t / z);
double tmp;
if (t <= -5.6e+33) {
tmp = t_1;
} else if (t <= -1.1e-271) {
tmp = x * (y / z);
} else if (t <= 8.8e+139) {
tmp = (y * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -5.6e+33: tmp = t_1 elif t <= -1.1e-271: tmp = x * (y / z) elif t <= 8.8e+139: tmp = (y * x) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -5.6e+33) tmp = t_1; elseif (t <= -1.1e-271) tmp = Float64(x * Float64(y / z)); elseif (t <= 8.8e+139) tmp = Float64(Float64(y * x) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -5.6e+33) tmp = t_1; elseif (t <= -1.1e-271) tmp = x * (y / z); elseif (t <= 8.8e+139) tmp = (y * x) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e+33], t$95$1, If[LessEqual[t, -1.1e-271], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.8e+139], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{-271}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{+139}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.6000000000000002e33 or 8.7999999999999998e139 < t Initial program 94.4%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f6446.2
Applied rewrites46.2%
Taylor expanded in z around inf
lower-/.f6435.6
Applied rewrites35.6%
if -5.6000000000000002e33 < t < -1.1e-271Initial program 94.4%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.4
Applied rewrites60.4%
if -1.1e-271 < t < 8.7999999999999998e139Initial program 94.4%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.4
Applied rewrites60.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6460.1
Applied rewrites60.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* t x) z)))
(if (<= t -1.5e+36)
t_1
(if (<= t -1.1e-271)
(* x (/ y z))
(if (<= t 9.5e+139) (/ (* y x) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (t * x) / z;
double tmp;
if (t <= -1.5e+36) {
tmp = t_1;
} else if (t <= -1.1e-271) {
tmp = x * (y / z);
} else if (t <= 9.5e+139) {
tmp = (y * 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)
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) :: t_1
real(8) :: tmp
t_1 = (t * x) / z
if (t <= (-1.5d+36)) then
tmp = t_1
else if (t <= (-1.1d-271)) then
tmp = x * (y / z)
else if (t <= 9.5d+139) then
tmp = (y * 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 t_1 = (t * x) / z;
double tmp;
if (t <= -1.5e+36) {
tmp = t_1;
} else if (t <= -1.1e-271) {
tmp = x * (y / z);
} else if (t <= 9.5e+139) {
tmp = (y * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t * x) / z tmp = 0 if t <= -1.5e+36: tmp = t_1 elif t <= -1.1e-271: tmp = x * (y / z) elif t <= 9.5e+139: tmp = (y * x) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t * x) / z) tmp = 0.0 if (t <= -1.5e+36) tmp = t_1; elseif (t <= -1.1e-271) tmp = Float64(x * Float64(y / z)); elseif (t <= 9.5e+139) tmp = Float64(Float64(y * x) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t * x) / z; tmp = 0.0; if (t <= -1.5e+36) tmp = t_1; elseif (t <= -1.1e-271) tmp = x * (y / z); elseif (t <= 9.5e+139) tmp = (y * x) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[t, -1.5e+36], t$95$1, If[LessEqual[t, -1.1e-271], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e+139], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot x}{z}\\
\mathbf{if}\;t \leq -1.5 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{-271}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+139}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.5e36 or 9.5000000000000002e139 < t Initial program 94.4%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6471.5
Applied rewrites71.5%
Taylor expanded in y around 0
Applied rewrites33.7%
if -1.5e36 < t < -1.1e-271Initial program 94.4%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.4
Applied rewrites60.4%
if -1.1e-271 < t < 9.5000000000000002e139Initial program 94.4%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.4
Applied rewrites60.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6460.1
Applied rewrites60.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.2e-219) (* y (/ x z)) (if (<= y 2.9e-174) (* x (- t)) (/ (* y x) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.2e-219) {
tmp = y * (x / z);
} else if (y <= 2.9e-174) {
tmp = x * -t;
} else {
tmp = (y * x) / z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: tmp
if (y <= (-1.2d-219)) then
tmp = y * (x / z)
else if (y <= 2.9d-174) then
tmp = x * -t
else
tmp = (y * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.2e-219) {
tmp = y * (x / z);
} else if (y <= 2.9e-174) {
tmp = x * -t;
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.2e-219: tmp = y * (x / z) elif y <= 2.9e-174: tmp = x * -t else: tmp = (y * x) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.2e-219) tmp = Float64(y * Float64(x / z)); elseif (y <= 2.9e-174) tmp = Float64(x * Float64(-t)); else tmp = Float64(Float64(y * x) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.2e-219) tmp = y * (x / z); elseif (y <= 2.9e-174) tmp = x * -t; else tmp = (y * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.2e-219], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e-174], N[(x * (-t)), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{-219}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-174}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if y < -1.20000000000000007e-219Initial program 94.4%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.4
Applied rewrites60.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6460.1
Applied rewrites60.1%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6460.6
Applied rewrites60.6%
if -1.20000000000000007e-219 < y < 2.9000000000000001e-174Initial program 94.4%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f6446.2
Applied rewrites46.2%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6423.7
Applied rewrites23.7%
if 2.9000000000000001e-174 < y Initial program 94.4%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.4
Applied rewrites60.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6460.1
Applied rewrites60.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (/ x z)))) (if (<= y -1.2e-219) t_1 (if (<= y 3e-174) (* x (- t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * (x / z);
double tmp;
if (y <= -1.2e-219) {
tmp = t_1;
} else if (y <= 3e-174) {
tmp = x * -t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = y * (x / z)
if (y <= (-1.2d-219)) then
tmp = t_1
else if (y <= 3d-174) then
tmp = x * -t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (x / z);
double tmp;
if (y <= -1.2e-219) {
tmp = t_1;
} else if (y <= 3e-174) {
tmp = x * -t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (x / z) tmp = 0 if y <= -1.2e-219: tmp = t_1 elif y <= 3e-174: tmp = x * -t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(x / z)) tmp = 0.0 if (y <= -1.2e-219) tmp = t_1; elseif (y <= 3e-174) tmp = Float64(x * Float64(-t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (x / z); tmp = 0.0; if (y <= -1.2e-219) tmp = t_1; elseif (y <= 3e-174) tmp = x * -t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.2e-219], t$95$1, If[LessEqual[y, 3e-174], N[(x * (-t)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{x}{z}\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{-219}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-174}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.20000000000000007e-219 or 3.00000000000000021e-174 < y Initial program 94.4%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.4
Applied rewrites60.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6460.1
Applied rewrites60.1%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6460.6
Applied rewrites60.6%
if -1.20000000000000007e-219 < y < 3.00000000000000021e-174Initial program 94.4%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f6446.2
Applied rewrites46.2%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6423.7
Applied rewrites23.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- t)))) (if (<= t -3e+108) t_1 (if (<= t 2.6e+141) (* x (/ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * -t;
double tmp;
if (t <= -3e+108) {
tmp = t_1;
} else if (t <= 2.6e+141) {
tmp = x * (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)
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) :: t_1
real(8) :: tmp
t_1 = x * -t
if (t <= (-3d+108)) then
tmp = t_1
else if (t <= 2.6d+141) then
tmp = x * (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 t_1 = x * -t;
double tmp;
if (t <= -3e+108) {
tmp = t_1;
} else if (t <= 2.6e+141) {
tmp = x * (y / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * -t tmp = 0 if t <= -3e+108: tmp = t_1 elif t <= 2.6e+141: tmp = x * (y / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(-t)) tmp = 0.0 if (t <= -3e+108) tmp = t_1; elseif (t <= 2.6e+141) tmp = Float64(x * Float64(y / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * -t; tmp = 0.0; if (t <= -3e+108) tmp = t_1; elseif (t <= 2.6e+141) tmp = x * (y / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-t)), $MachinePrecision]}, If[LessEqual[t, -3e+108], t$95$1, If[LessEqual[t, 2.6e+141], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(-t\right)\\
\mathbf{if}\;t \leq -3 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+141}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.99999999999999984e108 or 2.5999999999999999e141 < t Initial program 94.4%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f6446.2
Applied rewrites46.2%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6423.7
Applied rewrites23.7%
if -2.99999999999999984e108 < t < 2.5999999999999999e141Initial program 94.4%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.4
Applied rewrites60.4%
(FPCore (x y z t) :precision binary64 (* x (- t)))
double code(double x, double y, double z, double t) {
return x * -t;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * -t
end function
public static double code(double x, double y, double z, double t) {
return x * -t;
}
def code(x, y, z, t): return x * -t
function code(x, y, z, t) return Float64(x * Float64(-t)) end
function tmp = code(x, y, z, t) tmp = x * -t; end
code[x_, y_, z_, t_] := N[(x * (-t)), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(-t\right)
\end{array}
Initial program 94.4%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f6446.2
Applied rewrites46.2%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6423.7
Applied rewrites23.7%
herbie shell --seed 2025131
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
(* x (- (/ y z) (/ t (- 1.0 z)))))