
(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 (- (/ y z) (/ t (- 1.0 z))))) (if (<= t_1 (- INFINITY)) (* (/ x z) y) (* 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 / z) * y;
} 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 / z) * y;
} 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 / z) * y 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 / z) * y); 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 / z) * y; 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 / z), $MachinePrecision] * y), $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}{z} \cdot y\\
\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.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.7
Applied rewrites60.7%
lift-/.f64N/A
mult-flip-revN/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6460.6
Applied rewrites60.6%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r*N/A
mult-flipN/A
lower-*.f64N/A
lower-/.f6461.2
Applied rewrites61.2%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 94.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) (/ t (- z))))))
(if (<= z -1.75e+27)
t_1
(if (<= z 1.0) (* x (fma y (/ 1.0 z) (- t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t / -z));
double tmp;
if (z <= -1.75e+27) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = x * fma(y, (1.0 / z), -t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(-z)))) tmp = 0.0 if (z <= -1.75e+27) tmp = t_1; elseif (z <= 1.0) tmp = Float64(x * fma(y, Float64(1.0 / z), Float64(-t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+27], t$95$1, If[LessEqual[z, 1.0], N[(x * N[(y * N[(1.0 / z), $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - \frac{t}{-z}\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \mathsf{fma}\left(y, \frac{1}{z}, -t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.7500000000000001e27 or 1 < z Initial program 94.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6472.6
Applied rewrites72.6%
if -1.7500000000000001e27 < z < 1Initial program 94.0%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-flipN/A
mult-flipN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
associate-*r/N/A
mul-1-negN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6494.0
Applied rewrites94.0%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6464.0
Applied rewrites64.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* (+ y t) x) z))) (if (<= z -1.75e+27) t_1 (if (<= z 6.8e+17) (* x (- (/ y z) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((y + t) * x) / z;
double tmp;
if (z <= -1.75e+27) {
tmp = t_1;
} else if (z <= 6.8e+17) {
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 = ((y + t) * x) / z
if (z <= (-1.75d+27)) then
tmp = t_1
else if (z <= 6.8d+17) 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 = ((y + t) * x) / z;
double tmp;
if (z <= -1.75e+27) {
tmp = t_1;
} else if (z <= 6.8e+17) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((y + t) * x) / z tmp = 0 if z <= -1.75e+27: tmp = t_1 elif z <= 6.8e+17: tmp = x * ((y / z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(y + t) * x) / z) tmp = 0.0 if (z <= -1.75e+27) tmp = t_1; elseif (z <= 6.8e+17) 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 = ((y + t) * x) / z; tmp = 0.0; if (z <= -1.75e+27) tmp = t_1; elseif (z <= 6.8e+17) 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[(N[(y + t), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -1.75e+27], t$95$1, If[LessEqual[z, 6.8e+17], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y + t\right) \cdot x}{z}\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+17}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.7500000000000001e27 or 6.8e17 < z Initial program 94.0%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6471.1
Applied rewrites71.1%
lift--.f64N/A
lift-neg.f64N/A
add-flip-revN/A
lower-+.f6471.1
Applied rewrites71.1%
if -1.7500000000000001e27 < z < 6.8e17Initial program 94.0%
Taylor expanded in z around 0
Applied rewrites64.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* (+ y t) x) z)))
(if (<= z -1.75e+27)
t_1
(if (<= z 28000.0) (* x (fma y (/ 1.0 z) (- t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((y + t) * x) / z;
double tmp;
if (z <= -1.75e+27) {
tmp = t_1;
} else if (z <= 28000.0) {
tmp = x * fma(y, (1.0 / z), -t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(Float64(y + t) * x) / z) tmp = 0.0 if (z <= -1.75e+27) tmp = t_1; elseif (z <= 28000.0) tmp = Float64(x * fma(y, Float64(1.0 / z), Float64(-t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(y + t), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -1.75e+27], t$95$1, If[LessEqual[z, 28000.0], N[(x * N[(y * N[(1.0 / z), $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y + t\right) \cdot x}{z}\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 28000:\\
\;\;\;\;x \cdot \mathsf{fma}\left(y, \frac{1}{z}, -t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.7500000000000001e27 or 28000 < z Initial program 94.0%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6471.1
Applied rewrites71.1%
lift--.f64N/A
lift-neg.f64N/A
add-flip-revN/A
lower-+.f6471.1
Applied rewrites71.1%
if -1.7500000000000001e27 < z < 28000Initial program 94.0%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-flipN/A
mult-flipN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
associate-*r/N/A
mul-1-negN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6494.0
Applied rewrites94.0%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6464.0
Applied rewrites64.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (+ t y) (/ x z)))) (if (<= z -1.52e-9) 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 <= -1.52e-9) {
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 <= (-1.52d-9)) 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 <= -1.52e-9) {
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 <= -1.52e-9: 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 <= -1.52e-9) 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 <= -1.52e-9) 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, -1.52e-9], 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 -1.52 \cdot 10^{-9}:\\
\;\;\;\;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.51999999999999992e-9 or 1 < z Initial program 94.0%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6471.1
Applied rewrites71.1%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-neg.f64N/A
associate-/l*N/A
add-flip-revN/A
+-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f6471.4
Applied rewrites71.4%
if -1.51999999999999992e-9 < z < 1Initial program 94.0%
Taylor expanded in z around 0
Applied rewrites64.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ t (- z 1.0))))) (if (<= t -3.2e+41) t_1 (if (<= t 7.8e+99) (* 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 <= -3.2e+41) {
tmp = t_1;
} else if (t <= 7.8e+99) {
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 <= (-3.2d+41)) then
tmp = t_1
else if (t <= 7.8d+99) 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 <= -3.2e+41) {
tmp = t_1;
} else if (t <= 7.8e+99) {
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 <= -3.2e+41: tmp = t_1 elif t <= 7.8e+99: 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 <= -3.2e+41) tmp = t_1; elseif (t <= 7.8e+99) 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 / (z - 1.0)); tmp = 0.0; if (t <= -3.2e+41) tmp = t_1; elseif (t <= 7.8e+99) 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, -3.2e+41], t$95$1, If[LessEqual[t, 7.8e+99], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z - 1}\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{+99}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.2000000000000001e41 or 7.79999999999999989e99 < t Initial program 94.0%
Taylor expanded in y around 0
associate-*r/N/A
mul-1-negN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6445.9
Applied rewrites45.9%
if -3.2000000000000001e41 < t < 7.79999999999999989e99Initial program 94.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.7
Applied rewrites60.7%
(FPCore (x y z t) :precision binary64 (if (<= y -1.7e-96) (* x (/ y z)) (if (<= y 2.5e-97) (/ (* t x) (- z 1.0)) (* (/ x z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e-96) {
tmp = x * (y / z);
} else if (y <= 2.5e-97) {
tmp = (t * x) / (z - 1.0);
} else {
tmp = (x / z) * y;
}
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.7d-96)) then
tmp = x * (y / z)
else if (y <= 2.5d-97) then
tmp = (t * x) / (z - 1.0d0)
else
tmp = (x / z) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e-96) {
tmp = x * (y / z);
} else if (y <= 2.5e-97) {
tmp = (t * x) / (z - 1.0);
} else {
tmp = (x / z) * y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e-96: tmp = x * (y / z) elif y <= 2.5e-97: tmp = (t * x) / (z - 1.0) else: tmp = (x / z) * y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e-96) tmp = Float64(x * Float64(y / z)); elseif (y <= 2.5e-97) tmp = Float64(Float64(t * x) / Float64(z - 1.0)); else tmp = Float64(Float64(x / z) * y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.7e-96) tmp = x * (y / z); elseif (y <= 2.5e-97) tmp = (t * x) / (z - 1.0); else tmp = (x / z) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e-96], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e-97], N[(N[(t * x), $MachinePrecision] / N[(z - 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-96}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-97}:\\
\;\;\;\;\frac{t \cdot x}{z - 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}
\end{array}
if y < -1.7e-96Initial program 94.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.7
Applied rewrites60.7%
if -1.7e-96 < y < 2.4999999999999998e-97Initial program 94.0%
Taylor expanded in y around 0
associate-*r/N/A
mul-1-negN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.6
Applied rewrites43.6%
if 2.4999999999999998e-97 < y Initial program 94.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.7
Applied rewrites60.7%
lift-/.f64N/A
mult-flip-revN/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6460.6
Applied rewrites60.6%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r*N/A
mult-flipN/A
lower-*.f64N/A
lower-/.f6461.2
Applied rewrites61.2%
(FPCore (x y z t) :precision binary64 (if (<= y -1.7e-96) (* x (/ y z)) (if (<= y 8.2e-97) (* t (/ x (- z 1.0))) (* (/ x z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e-96) {
tmp = x * (y / z);
} else if (y <= 8.2e-97) {
tmp = t * (x / (z - 1.0));
} else {
tmp = (x / z) * y;
}
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.7d-96)) then
tmp = x * (y / z)
else if (y <= 8.2d-97) then
tmp = t * (x / (z - 1.0d0))
else
tmp = (x / z) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e-96) {
tmp = x * (y / z);
} else if (y <= 8.2e-97) {
tmp = t * (x / (z - 1.0));
} else {
tmp = (x / z) * y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e-96: tmp = x * (y / z) elif y <= 8.2e-97: tmp = t * (x / (z - 1.0)) else: tmp = (x / z) * y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e-96) tmp = Float64(x * Float64(y / z)); elseif (y <= 8.2e-97) tmp = Float64(t * Float64(x / Float64(z - 1.0))); else tmp = Float64(Float64(x / z) * y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.7e-96) tmp = x * (y / z); elseif (y <= 8.2e-97) tmp = t * (x / (z - 1.0)); else tmp = (x / z) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e-96], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e-97], N[(t * N[(x / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-96}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-97}:\\
\;\;\;\;t \cdot \frac{x}{z - 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}
\end{array}
if y < -1.7e-96Initial program 94.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.7
Applied rewrites60.7%
if -1.7e-96 < y < 8.19999999999999986e-97Initial program 94.0%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-flipN/A
mult-flipN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
associate-*r/N/A
mul-1-negN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6494.0
Applied rewrites94.0%
Taylor expanded in y around 0
mult-flip-revN/A
frac-2negN/A
mul-1-negN/A
sub-negate-revN/A
associate-*r/N/A
mul-1-negN/A
sub-flipN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6443.8
Applied rewrites43.8%
if 8.19999999999999986e-97 < y Initial program 94.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.7
Applied rewrites60.7%
lift-/.f64N/A
mult-flip-revN/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6460.6
Applied rewrites60.6%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r*N/A
mult-flipN/A
lower-*.f64N/A
lower-/.f6461.2
Applied rewrites61.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ t z)))) (if (<= t -2.1e+88) t_1 (if (<= t 7e+61) (* 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 <= -2.1e+88) {
tmp = t_1;
} else if (t <= 7e+61) {
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 <= (-2.1d+88)) then
tmp = t_1
else if (t <= 7d+61) 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 <= -2.1e+88) {
tmp = t_1;
} else if (t <= 7e+61) {
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 <= -2.1e+88: tmp = t_1 elif t <= 7e+61: 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 <= -2.1e+88) tmp = t_1; elseif (t <= 7e+61) 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 / z); tmp = 0.0; if (t <= -2.1e+88) tmp = t_1; elseif (t <= 7e+61) 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, -2.1e+88], t$95$1, If[LessEqual[t, 7e+61], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+61}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.1e88 or 7.00000000000000036e61 < t Initial program 94.0%
Taylor expanded in y around 0
associate-*r/N/A
mul-1-negN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6445.9
Applied rewrites45.9%
Taylor expanded in z around inf
lower-/.f6435.4
Applied rewrites35.4%
if -2.1e88 < t < 7.00000000000000036e61Initial program 94.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.7
Applied rewrites60.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* t x) z))) (if (<= t -2.1e+88) t_1 (if (<= t 7e+61) (* x (/ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (t * x) / z;
double tmp;
if (t <= -2.1e+88) {
tmp = t_1;
} else if (t <= 7e+61) {
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
if (t <= (-2.1d+88)) then
tmp = t_1
else if (t <= 7d+61) 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;
double tmp;
if (t <= -2.1e+88) {
tmp = t_1;
} else if (t <= 7e+61) {
tmp = x * (y / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t * x) / z tmp = 0 if t <= -2.1e+88: tmp = t_1 elif t <= 7e+61: tmp = x * (y / 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 <= -2.1e+88) tmp = t_1; elseif (t <= 7e+61) tmp = Float64(x * Float64(y / 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 <= -2.1e+88) tmp = t_1; elseif (t <= 7e+61) 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] / z), $MachinePrecision]}, If[LessEqual[t, -2.1e+88], t$95$1, If[LessEqual[t, 7e+61], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot x}{z}\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+61}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.1e88 or 7.00000000000000036e61 < t Initial program 94.0%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6471.1
Applied rewrites71.1%
Taylor expanded in y around 0
Applied rewrites33.2%
if -2.1e88 < t < 7.00000000000000036e61Initial program 94.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.7
Applied rewrites60.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* t (/ x z)))) (if (<= t -2.1e+88) t_1 (if (<= t 7.5e+61) (* x (/ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = t * (x / z);
double tmp;
if (t <= -2.1e+88) {
tmp = t_1;
} else if (t <= 7.5e+61) {
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)
if (t <= (-2.1d+88)) then
tmp = t_1
else if (t <= 7.5d+61) 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);
double tmp;
if (t <= -2.1e+88) {
tmp = t_1;
} else if (t <= 7.5e+61) {
tmp = x * (y / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (x / z) tmp = 0 if t <= -2.1e+88: tmp = t_1 elif t <= 7.5e+61: tmp = x * (y / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(x / z)) tmp = 0.0 if (t <= -2.1e+88) tmp = t_1; elseif (t <= 7.5e+61) tmp = Float64(x * Float64(y / 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 <= -2.1e+88) tmp = t_1; elseif (t <= 7.5e+61) tmp = x * (y / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e+88], t$95$1, If[LessEqual[t, 7.5e+61], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{x}{z}\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+61}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.1e88 or 7.5e61 < t Initial program 94.0%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6471.1
Applied rewrites71.1%
Taylor expanded in y around 0
Applied rewrites33.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6434.4
Applied rewrites34.4%
if -2.1e88 < t < 7.5e61Initial program 94.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.7
Applied rewrites60.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ y z)))) (if (<= y -3.8e-181) t_1 (if (<= y 8.2e-303) (* x (- t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / z);
double tmp;
if (y <= -3.8e-181) {
tmp = t_1;
} else if (y <= 8.2e-303) {
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 = x * (y / z)
if (y <= (-3.8d-181)) then
tmp = t_1
else if (y <= 8.2d-303) 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 = x * (y / z);
double tmp;
if (y <= -3.8e-181) {
tmp = t_1;
} else if (y <= 8.2e-303) {
tmp = x * -t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / z) tmp = 0 if y <= -3.8e-181: tmp = t_1 elif y <= 8.2e-303: tmp = x * -t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / z)) tmp = 0.0 if (y <= -3.8e-181) tmp = t_1; elseif (y <= 8.2e-303) tmp = Float64(x * Float64(-t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / z); tmp = 0.0; if (y <= -3.8e-181) tmp = t_1; elseif (y <= 8.2e-303) tmp = x * -t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.8e-181], t$95$1, If[LessEqual[y, 8.2e-303], N[(x * (-t)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{-181}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-303}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.7999999999999998e-181 or 8.20000000000000037e-303 < y Initial program 94.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lift-/.f6460.7
Applied rewrites60.7%
if -3.7999999999999998e-181 < y < 8.20000000000000037e-303Initial program 94.0%
Taylor expanded in y around 0
associate-*r/N/A
mul-1-negN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6445.9
Applied rewrites45.9%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6423.2
Applied rewrites23.2%
(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.0%
Taylor expanded in y around 0
associate-*r/N/A
mul-1-negN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6445.9
Applied rewrites45.9%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6423.2
Applied rewrites23.2%
herbie shell --seed 2025134
(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)))))