
(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 14 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 (- (/ y z) (/ t (- 1.0 z))))) (if (<= t_1 4e-323) (/ (* (fma (/ z (- z 1.0)) t y) x) z) (* x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= 4e-323) {
tmp = (fma((z / (z - 1.0)), t, y) * x) / z;
} else {
tmp = x * t_1;
}
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 <= 4e-323) tmp = Float64(Float64(fma(Float64(z / Float64(z - 1.0)), t, y) * x) / z); else tmp = Float64(x * t_1); end return 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, 4e-323], N[(N[(N[(N[(z / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * t + y), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision], N[(x * t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{-323}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{z}{z - 1}, t, y\right) \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\_1\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 3.95253e-323Initial program 94.7%
Applied rewrites91.4%
if 3.95253e-323 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 94.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (/ y z) (/ t (- 1.0 z))))) (if (<= t_1 (- INFINITY)) (/ (* x y) z) (* x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x * y) / z;
} else {
tmp = x * t_1;
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) {
tmp = (x * y) / z;
} else {
tmp = x * t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_1 <= -math.inf: tmp = (x * y) / z else: tmp = x * t_1 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 <= Float64(-Inf)) tmp = Float64(Float64(x * y) / z); else tmp = Float64(x * t_1); 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 <= -Inf) tmp = (x * y) / z; else tmp = x * t_1; 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, (-Infinity)], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], N[(x * t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\_1\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0Initial program 94.7%
Taylor expanded in y around inf
Applied rewrites61.1%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 94.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -19000000000.0)
(* x (/ (+ t y) z))
(if (<= z 1.0)
(/ (* (fma (* -1.0 z) t y) x) z)
(/ (* x (- y (* -1.0 t))) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -19000000000.0) {
tmp = x * ((t + y) / z);
} else if (z <= 1.0) {
tmp = (fma((-1.0 * z), t, y) * x) / z;
} else {
tmp = (x * (y - (-1.0 * t))) / z;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -19000000000.0) tmp = Float64(x * Float64(Float64(t + y) / z)); elseif (z <= 1.0) tmp = Float64(Float64(fma(Float64(-1.0 * z), t, y) * x) / z); else tmp = Float64(Float64(x * Float64(y - Float64(-1.0 * t))) / z); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -19000000000.0], N[(x * N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(N[(N[(-1.0 * z), $MachinePrecision] * t + y), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision], N[(N[(x * N[(y - N[(-1.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -19000000000:\\
\;\;\;\;x \cdot \frac{t + y}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1 \cdot z, t, y\right) \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - -1 \cdot t\right)}{z}\\
\end{array}
\end{array}
if z < -1.9e10Initial program 94.7%
Applied rewrites94.7%
Taylor expanded in z around inf
Applied rewrites73.6%
if -1.9e10 < z < 1Initial program 94.7%
Applied rewrites91.4%
Taylor expanded in z around 0
Applied rewrites64.4%
if 1 < z Initial program 94.7%
Taylor expanded in z around inf
Applied rewrites71.6%
(FPCore (x y z t) :precision binary64 (if (<= z -19000000000.0) (* x (/ (+ t y) z)) (if (<= z 480.0) (* (fma (- z) t y) (/ x z)) (/ (* x (- y (* -1.0 t))) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -19000000000.0) {
tmp = x * ((t + y) / z);
} else if (z <= 480.0) {
tmp = fma(-z, t, y) * (x / z);
} else {
tmp = (x * (y - (-1.0 * t))) / z;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -19000000000.0) tmp = Float64(x * Float64(Float64(t + y) / z)); elseif (z <= 480.0) tmp = Float64(fma(Float64(-z), t, y) * Float64(x / z)); else tmp = Float64(Float64(x * Float64(y - Float64(-1.0 * t))) / z); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -19000000000.0], N[(x * N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 480.0], N[(N[((-z) * t + y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y - N[(-1.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -19000000000:\\
\;\;\;\;x \cdot \frac{t + y}{z}\\
\mathbf{elif}\;z \leq 480:\\
\;\;\;\;\mathsf{fma}\left(-z, t, y\right) \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - -1 \cdot t\right)}{z}\\
\end{array}
\end{array}
if z < -1.9e10Initial program 94.7%
Applied rewrites94.7%
Taylor expanded in z around inf
Applied rewrites73.6%
if -1.9e10 < z < 480Initial program 94.7%
Applied rewrites90.6%
Taylor expanded in z around 0
Applied rewrites65.5%
Applied rewrites65.5%
if 480 < z Initial program 94.7%
Taylor expanded in z around inf
Applied rewrites71.6%
(FPCore (x y z t) :precision binary64 (if (<= z -19000000000.0) (* x (/ (+ t y) z)) (if (<= z 480.0) (* x (- (/ y z) t)) (/ (* x (- y (* -1.0 t))) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -19000000000.0) {
tmp = x * ((t + y) / z);
} else if (z <= 480.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (x * (y - (-1.0 * 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 <= (-19000000000.0d0)) then
tmp = x * ((t + y) / z)
else if (z <= 480.0d0) then
tmp = x * ((y / z) - t)
else
tmp = (x * (y - ((-1.0d0) * t))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -19000000000.0) {
tmp = x * ((t + y) / z);
} else if (z <= 480.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (x * (y - (-1.0 * t))) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -19000000000.0: tmp = x * ((t + y) / z) elif z <= 480.0: tmp = x * ((y / z) - t) else: tmp = (x * (y - (-1.0 * t))) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -19000000000.0) tmp = Float64(x * Float64(Float64(t + y) / z)); elseif (z <= 480.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(Float64(x * Float64(y - Float64(-1.0 * t))) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -19000000000.0) tmp = x * ((t + y) / z); elseif (z <= 480.0) tmp = x * ((y / z) - t); else tmp = (x * (y - (-1.0 * t))) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -19000000000.0], N[(x * N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 480.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y - N[(-1.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -19000000000:\\
\;\;\;\;x \cdot \frac{t + y}{z}\\
\mathbf{elif}\;z \leq 480:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - -1 \cdot t\right)}{z}\\
\end{array}
\end{array}
if z < -1.9e10Initial program 94.7%
Applied rewrites94.7%
Taylor expanded in z around inf
Applied rewrites73.6%
if -1.9e10 < z < 480Initial program 94.7%
Taylor expanded in z around 0
Applied rewrites64.9%
if 480 < z Initial program 94.7%
Taylor expanded in z around inf
Applied rewrites71.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ (+ t y) z)))) (if (<= z -19000000000.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 * ((t + y) / z);
double tmp;
if (z <= -19000000000.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 * ((t + y) / z)
if (z <= (-19000000000.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 * ((t + y) / z);
double tmp;
if (z <= -19000000000.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 * ((t + y) / z) tmp = 0 if z <= -19000000000.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(t + y) / z)) tmp = 0.0 if (z <= -19000000000.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 * ((t + y) / z); tmp = 0.0; if (z <= -19000000000.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[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -19000000000.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{t + y}{z}\\
\mathbf{if}\;z \leq -19000000000:\\
\;\;\;\;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.9e10 or 1 < z Initial program 94.7%
Applied rewrites94.7%
Taylor expanded in z around inf
Applied rewrites73.6%
if -1.9e10 < z < 1Initial program 94.7%
Taylor expanded in z around 0
Applied rewrites64.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ t (- z 1.0))))) (if (<= t -14800000000000.0) t_1 (if (<= t 3.7e+65) (/ (* x y) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / (z - 1.0));
double tmp;
if (t <= -14800000000000.0) {
tmp = t_1;
} else if (t <= 3.7e+65) {
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 / (z - 1.0d0))
if (t <= (-14800000000000.0d0)) then
tmp = t_1
else if (t <= 3.7d+65) 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 / (z - 1.0));
double tmp;
if (t <= -14800000000000.0) {
tmp = t_1;
} else if (t <= 3.7e+65) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / (z - 1.0)) tmp = 0 if t <= -14800000000000.0: tmp = t_1 elif t <= 3.7e+65: tmp = (x * y) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / Float64(z - 1.0))) tmp = 0.0 if (t <= -14800000000000.0) tmp = t_1; elseif (t <= 3.7e+65) tmp = Float64(Float64(x * y) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / (z - 1.0)); tmp = 0.0; if (t <= -14800000000000.0) tmp = t_1; elseif (t <= 3.7e+65) tmp = (x * y) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -14800000000000.0], t$95$1, If[LessEqual[t, 3.7e+65], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z - 1}\\
\mathbf{if}\;t \leq -14800000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+65}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.48e13 or 3.69999999999999995e65 < t Initial program 94.7%
Taylor expanded in y around 0
Applied rewrites45.7%
Applied rewrites45.7%
if -1.48e13 < t < 3.69999999999999995e65Initial program 94.7%
Taylor expanded in y around inf
Applied rewrites61.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* t x) (- z 1.0)))) (if (<= t -14800000000000.0) t_1 (if (<= t 3.7e+65) (/ (* x y) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (t * x) / (z - 1.0);
double tmp;
if (t <= -14800000000000.0) {
tmp = t_1;
} else if (t <= 3.7e+65) {
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 = (t * x) / (z - 1.0d0)
if (t <= (-14800000000000.0d0)) then
tmp = t_1
else if (t <= 3.7d+65) 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 = (t * x) / (z - 1.0);
double tmp;
if (t <= -14800000000000.0) {
tmp = t_1;
} else if (t <= 3.7e+65) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t * x) / (z - 1.0) tmp = 0 if t <= -14800000000000.0: tmp = t_1 elif t <= 3.7e+65: tmp = (x * y) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t * x) / Float64(z - 1.0)) tmp = 0.0 if (t <= -14800000000000.0) tmp = t_1; elseif (t <= 3.7e+65) tmp = Float64(Float64(x * y) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t * x) / (z - 1.0); tmp = 0.0; if (t <= -14800000000000.0) tmp = t_1; elseif (t <= 3.7e+65) tmp = (x * y) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t * x), $MachinePrecision] / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -14800000000000.0], t$95$1, If[LessEqual[t, 3.7e+65], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot x}{z - 1}\\
\mathbf{if}\;t \leq -14800000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+65}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.48e13 or 3.69999999999999995e65 < t Initial program 94.7%
Applied rewrites94.7%
Taylor expanded in y around 0
Applied rewrites43.4%
if -1.48e13 < t < 3.69999999999999995e65Initial program 94.7%
Taylor expanded in y around inf
Applied rewrites61.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -1.92e+282)
(* x (* -1.0 t))
(if (<= t -1.12e+46) t_1 (if (<= t 4.5e+136) (/ (* x y) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -1.92e+282) {
tmp = x * (-1.0 * t);
} else if (t <= -1.12e+46) {
tmp = t_1;
} else if (t <= 4.5e+136) {
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 / z)
if (t <= (-1.92d+282)) then
tmp = x * ((-1.0d0) * t)
else if (t <= (-1.12d+46)) then
tmp = t_1
else if (t <= 4.5d+136) 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 / z);
double tmp;
if (t <= -1.92e+282) {
tmp = x * (-1.0 * t);
} else if (t <= -1.12e+46) {
tmp = t_1;
} else if (t <= 4.5e+136) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -1.92e+282: tmp = x * (-1.0 * t) elif t <= -1.12e+46: tmp = t_1 elif t <= 4.5e+136: tmp = (x * y) / 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 <= -1.92e+282) tmp = Float64(x * Float64(-1.0 * t)); elseif (t <= -1.12e+46) tmp = t_1; elseif (t <= 4.5e+136) tmp = Float64(Float64(x * y) / 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 <= -1.92e+282) tmp = x * (-1.0 * t); elseif (t <= -1.12e+46) tmp = t_1; elseif (t <= 4.5e+136) tmp = (x * y) / 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, -1.92e+282], N[(x * N[(-1.0 * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.12e+46], t$95$1, If[LessEqual[t, 4.5e+136], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -1.92 \cdot 10^{+282}:\\
\;\;\;\;x \cdot \left(-1 \cdot t\right)\\
\mathbf{elif}\;t \leq -1.12 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+136}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.9200000000000001e282Initial program 94.7%
Taylor expanded in y around 0
Applied rewrites45.7%
Taylor expanded in z around 0
Applied rewrites23.2%
if -1.9200000000000001e282 < t < -1.12e46 or 4.4999999999999999e136 < t Initial program 94.7%
Taylor expanded in y around 0
Applied rewrites45.7%
Taylor expanded in z around inf
Applied rewrites35.2%
if -1.12e46 < t < 4.4999999999999999e136Initial program 94.7%
Taylor expanded in y around inf
Applied rewrites61.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (* -1.0 t))))
(if (<= t -5.2e+194)
t_1
(if (<= t 4.1e+65)
(* (/ y z) x)
(if (<= t 3.7e+113) t_1 (/ (* t x) z))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (-1.0 * t);
double tmp;
if (t <= -5.2e+194) {
tmp = t_1;
} else if (t <= 4.1e+65) {
tmp = (y / z) * x;
} else if (t <= 3.7e+113) {
tmp = t_1;
} else {
tmp = (t * 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 = x * ((-1.0d0) * t)
if (t <= (-5.2d+194)) then
tmp = t_1
else if (t <= 4.1d+65) then
tmp = (y / z) * x
else if (t <= 3.7d+113) then
tmp = t_1
else
tmp = (t * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (-1.0 * t);
double tmp;
if (t <= -5.2e+194) {
tmp = t_1;
} else if (t <= 4.1e+65) {
tmp = (y / z) * x;
} else if (t <= 3.7e+113) {
tmp = t_1;
} else {
tmp = (t * x) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (-1.0 * t) tmp = 0 if t <= -5.2e+194: tmp = t_1 elif t <= 4.1e+65: tmp = (y / z) * x elif t <= 3.7e+113: tmp = t_1 else: tmp = (t * x) / z return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(-1.0 * t)) tmp = 0.0 if (t <= -5.2e+194) tmp = t_1; elseif (t <= 4.1e+65) tmp = Float64(Float64(y / z) * x); elseif (t <= 3.7e+113) tmp = t_1; else tmp = Float64(Float64(t * x) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (-1.0 * t); tmp = 0.0; if (t <= -5.2e+194) tmp = t_1; elseif (t <= 4.1e+65) tmp = (y / z) * x; elseif (t <= 3.7e+113) tmp = t_1; else tmp = (t * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(-1.0 * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.2e+194], t$95$1, If[LessEqual[t, 4.1e+65], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 3.7e+113], t$95$1, N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(-1 \cdot t\right)\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+194}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+65}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\end{array}
\end{array}
if t < -5.1999999999999998e194 or 4.1000000000000001e65 < t < 3.6999999999999998e113Initial program 94.7%
Taylor expanded in y around 0
Applied rewrites45.7%
Taylor expanded in z around 0
Applied rewrites23.2%
if -5.1999999999999998e194 < t < 4.1000000000000001e65Initial program 94.7%
Taylor expanded in y around inf
Applied rewrites61.1%
Applied rewrites61.0%
if 3.6999999999999998e113 < t Initial program 94.7%
Applied rewrites94.7%
Taylor expanded in y around 0
Applied rewrites43.4%
Taylor expanded in z around inf
Applied rewrites33.1%
(FPCore (x y z t) :precision binary64 (if (<= t -2e+217) (* x (* -1.0 t)) (if (<= t 1.1e+115) (/ (* x y) z) (/ (* t x) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2e+217) {
tmp = x * (-1.0 * t);
} else if (t <= 1.1e+115) {
tmp = (x * y) / z;
} else {
tmp = (t * 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 (t <= (-2d+217)) then
tmp = x * ((-1.0d0) * t)
else if (t <= 1.1d+115) then
tmp = (x * y) / z
else
tmp = (t * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2e+217) {
tmp = x * (-1.0 * t);
} else if (t <= 1.1e+115) {
tmp = (x * y) / z;
} else {
tmp = (t * x) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2e+217: tmp = x * (-1.0 * t) elif t <= 1.1e+115: tmp = (x * y) / z else: tmp = (t * x) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2e+217) tmp = Float64(x * Float64(-1.0 * t)); elseif (t <= 1.1e+115) tmp = Float64(Float64(x * y) / z); else tmp = Float64(Float64(t * x) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2e+217) tmp = x * (-1.0 * t); elseif (t <= 1.1e+115) tmp = (x * y) / z; else tmp = (t * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2e+217], N[(x * N[(-1.0 * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.1e+115], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+217}:\\
\;\;\;\;x \cdot \left(-1 \cdot t\right)\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+115}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\end{array}
\end{array}
if t < -1.99999999999999992e217Initial program 94.7%
Taylor expanded in y around 0
Applied rewrites45.7%
Taylor expanded in z around 0
Applied rewrites23.2%
if -1.99999999999999992e217 < t < 1.1e115Initial program 94.7%
Taylor expanded in y around inf
Applied rewrites61.1%
if 1.1e115 < t Initial program 94.7%
Applied rewrites94.7%
Taylor expanded in y around 0
Applied rewrites43.4%
Taylor expanded in z around inf
Applied rewrites33.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (* -1.0 t))))
(if (<= t -2e+217)
t_1
(if (<= t 4.1e+65)
(* (/ x z) y)
(if (<= t 3.7e+113) t_1 (/ (* t x) z))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (-1.0 * t);
double tmp;
if (t <= -2e+217) {
tmp = t_1;
} else if (t <= 4.1e+65) {
tmp = (x / z) * y;
} else if (t <= 3.7e+113) {
tmp = t_1;
} else {
tmp = (t * 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 = x * ((-1.0d0) * t)
if (t <= (-2d+217)) then
tmp = t_1
else if (t <= 4.1d+65) then
tmp = (x / z) * y
else if (t <= 3.7d+113) then
tmp = t_1
else
tmp = (t * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (-1.0 * t);
double tmp;
if (t <= -2e+217) {
tmp = t_1;
} else if (t <= 4.1e+65) {
tmp = (x / z) * y;
} else if (t <= 3.7e+113) {
tmp = t_1;
} else {
tmp = (t * x) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (-1.0 * t) tmp = 0 if t <= -2e+217: tmp = t_1 elif t <= 4.1e+65: tmp = (x / z) * y elif t <= 3.7e+113: tmp = t_1 else: tmp = (t * x) / z return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(-1.0 * t)) tmp = 0.0 if (t <= -2e+217) tmp = t_1; elseif (t <= 4.1e+65) tmp = Float64(Float64(x / z) * y); elseif (t <= 3.7e+113) tmp = t_1; else tmp = Float64(Float64(t * x) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (-1.0 * t); tmp = 0.0; if (t <= -2e+217) tmp = t_1; elseif (t <= 4.1e+65) tmp = (x / z) * y; elseif (t <= 3.7e+113) tmp = t_1; else tmp = (t * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(-1.0 * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e+217], t$95$1, If[LessEqual[t, 4.1e+65], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 3.7e+113], t$95$1, N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(-1 \cdot t\right)\\
\mathbf{if}\;t \leq -2 \cdot 10^{+217}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+65}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\end{array}
\end{array}
if t < -1.99999999999999992e217 or 4.1000000000000001e65 < t < 3.6999999999999998e113Initial program 94.7%
Taylor expanded in y around 0
Applied rewrites45.7%
Taylor expanded in z around 0
Applied rewrites23.2%
if -1.99999999999999992e217 < t < 4.1000000000000001e65Initial program 94.7%
Taylor expanded in y around inf
Applied rewrites61.1%
Applied rewrites60.8%
if 3.6999999999999998e113 < t Initial program 94.7%
Applied rewrites94.7%
Taylor expanded in y around 0
Applied rewrites43.4%
Taylor expanded in z around inf
Applied rewrites33.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* t x) z))) (if (<= z -19000000000.0) t_1 (if (<= z 1.2e+20) (* x (* -1.0 t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (t * x) / z;
double tmp;
if (z <= -19000000000.0) {
tmp = t_1;
} else if (z <= 1.2e+20) {
tmp = x * (-1.0 * 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 * x) / z
if (z <= (-19000000000.0d0)) then
tmp = t_1
else if (z <= 1.2d+20) then
tmp = x * ((-1.0d0) * 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 * x) / z;
double tmp;
if (z <= -19000000000.0) {
tmp = t_1;
} else if (z <= 1.2e+20) {
tmp = x * (-1.0 * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t * x) / z tmp = 0 if z <= -19000000000.0: tmp = t_1 elif z <= 1.2e+20: tmp = x * (-1.0 * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t * x) / z) tmp = 0.0 if (z <= -19000000000.0) tmp = t_1; elseif (z <= 1.2e+20) tmp = Float64(x * Float64(-1.0 * t)); 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 (z <= -19000000000.0) tmp = t_1; elseif (z <= 1.2e+20) tmp = x * (-1.0 * t); 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[z, -19000000000.0], t$95$1, If[LessEqual[z, 1.2e+20], N[(x * N[(-1.0 * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot x}{z}\\
\mathbf{if}\;z \leq -19000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+20}:\\
\;\;\;\;x \cdot \left(-1 \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.9e10 or 1.2e20 < z Initial program 94.7%
Applied rewrites94.7%
Taylor expanded in y around 0
Applied rewrites43.4%
Taylor expanded in z around inf
Applied rewrites33.1%
if -1.9e10 < z < 1.2e20Initial program 94.7%
Taylor expanded in y around 0
Applied rewrites45.7%
Taylor expanded in z around 0
Applied rewrites23.2%
(FPCore (x y z t) :precision binary64 (* x (* -1.0 t)))
double code(double x, double y, double z, double t) {
return x * (-1.0 * 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 * ((-1.0d0) * t)
end function
public static double code(double x, double y, double z, double t) {
return x * (-1.0 * t);
}
def code(x, y, z, t): return x * (-1.0 * t)
function code(x, y, z, t) return Float64(x * Float64(-1.0 * t)) end
function tmp = code(x, y, z, t) tmp = x * (-1.0 * t); end
code[x_, y_, z_, t_] := N[(x * N[(-1.0 * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(-1 \cdot t\right)
\end{array}
Initial program 94.7%
Taylor expanded in y around 0
Applied rewrites45.7%
Taylor expanded in z around 0
Applied rewrites23.2%
herbie shell --seed 2025153
(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)))))