
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* (- b y) z) y))
(t_2 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_3 (- (* (/ x t_1) y) (* (- a t) (/ z t_1)))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -1e-220)
t_2
(if (<= t_2 0.0)
(/ (- t a) (- b y))
(if (<= t_2 2e+301)
t_2
(if (<= t_2 INFINITY)
t_3
(- (/ t (- b y)) (/ a (- b y))))))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((b - y) * z) + y;
double t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_3 = ((x / t_1) * y) - ((a - t) * (z / t_1));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -1e-220) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (t - a) / (b - y);
} else if (t_2 <= 2e+301) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((b - y) * z) + y;
double t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_3 = ((x / t_1) * y) - ((a - t) * (z / t_1));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_3;
} else if (t_2 <= -1e-220) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (t - a) / (b - y);
} else if (t_2 <= 2e+301) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((b - y) * z) + y t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) t_3 = ((x / t_1) * y) - ((a - t) * (z / t_1)) tmp = 0 if t_2 <= -math.inf: tmp = t_3 elif t_2 <= -1e-220: tmp = t_2 elif t_2 <= 0.0: tmp = (t - a) / (b - y) elif t_2 <= 2e+301: tmp = t_2 elif t_2 <= math.inf: tmp = t_3 else: tmp = (t / (b - y)) - (a / (b - y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(b - y) * z) + y) t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_3 = Float64(Float64(Float64(x / t_1) * y) - Float64(Float64(a - t) * Float64(z / t_1))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -1e-220) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (t_2 <= 2e+301) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(Float64(t / Float64(b - y)) - Float64(a / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((b - y) * z) + y; t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); t_3 = ((x / t_1) * y) - ((a - t) * (z / t_1)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_3; elseif (t_2 <= -1e-220) tmp = t_2; elseif (t_2 <= 0.0) tmp = (t - a) / (b - y); elseif (t_2 <= 2e+301) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = (t / (b - y)) - (a / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x / t$95$1), $MachinePrecision] * y), $MachinePrecision] - N[(N[(a - t), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -1e-220], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+301], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
t_1 := \left(b - y\right) \cdot z + y\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_3 := \frac{x}{t\_1} \cdot y - \left(a - t\right) \cdot \frac{z}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-220}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y} - \frac{a}{b - y}\\
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 2.0000000000000001e301 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
div-subN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.1%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -9.9999999999999999e-221 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.0000000000000001e301Initial program 66.8%
if -9.9999999999999999e-221 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in z around inf
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_2
(- (* (/ z (+ (* (- b y) z) y)) (- t a)) (/ x (- z 1.0)))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -1e-220)
t_1
(if (<= t_1 0.0)
(/ (- t a) (- b y))
(if (<= t_1 1e+300)
t_1
(if (<= t_1 INFINITY)
t_2
(- (/ t (- b y)) (/ a (- b y))))))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_2 = ((z / (((b - y) * z) + y)) * (t - a)) - (x / (z - 1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -1e-220) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (t - a) / (b - y);
} else if (t_1 <= 1e+300) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_2 = ((z / (((b - y) * z) + y)) * (t - a)) - (x / (z - 1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= -1e-220) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (t - a) / (b - y);
} else if (t_1 <= 1e+300) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) t_2 = ((z / (((b - y) * z) + y)) * (t - a)) - (x / (z - 1.0)) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= -1e-220: tmp = t_1 elif t_1 <= 0.0: tmp = (t - a) / (b - y) elif t_1 <= 1e+300: tmp = t_1 elif t_1 <= math.inf: tmp = t_2 else: tmp = (t / (b - y)) - (a / (b - y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_2 = Float64(Float64(Float64(z / Float64(Float64(Float64(b - y) * z) + y)) * Float64(t - a)) - Float64(x / Float64(z - 1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -1e-220) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (t_1 <= 1e+300) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(Float64(t / Float64(b - y)) - Float64(a / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); t_2 = ((z / (((b - y) * z) + y)) * (t - a)) - (x / (z - 1.0)); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= -1e-220) tmp = t_1; elseif (t_1 <= 0.0) tmp = (t - a) / (b - y); elseif (t_1 <= 1e+300) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; else tmp = (t / (b - y)) - (a / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision] - N[(x / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -1e-220], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+300], t$95$1, If[LessEqual[t$95$1, Infinity], t$95$2, N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_2 := \frac{z}{\left(b - y\right) \cdot z + y} \cdot \left(t - a\right) - \frac{x}{z - 1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-220}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;t\_1 \leq 10^{+300}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y} - \frac{a}{b - y}\\
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 1.0000000000000001e300 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6471.3%
Applied rewrites71.3%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -9.9999999999999999e-221 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.0000000000000001e300Initial program 66.8%
if -9.9999999999999999e-221 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in z around inf
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y z t a b) :precision binary64 (- (/ (- t a) (- b (- y (/ y z)))) (* (- x) (/ y (+ (* (- b y) z) y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((t - a) / (b - (y - (y / z)))) - (-x * (y / (((b - y) * z) + y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((t - a) / (b - (y - (y / z)))) - (-x * (y / (((b - y) * z) + y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((t - a) / (b - (y - (y / z)))) - (-x * (y / (((b - y) * z) + y)));
}
def code(x, y, z, t, a, b): return ((t - a) / (b - (y - (y / z)))) - (-x * (y / (((b - y) * z) + y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(t - a) / Float64(b - Float64(y - Float64(y / z)))) - Float64(Float64(-x) * Float64(y / Float64(Float64(Float64(b - y) * z) + y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((t - a) / (b - (y - (y / z)))) - (-x * (y / (((b - y) * z) + y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(t - a), $MachinePrecision] / N[(b - N[(y - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[((-x) * N[(y / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{t - a}{b - \left(y - \frac{y}{z}\right)} - \left(-x\right) \cdot \frac{y}{\left(b - y\right) \cdot z + y}
Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6479.3%
Applied rewrites79.3%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f6479.4%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
add-to-fraction-revN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f64N/A
lower-/.f6493.4%
Applied rewrites93.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_2 (- (/ (- t a) (- b (- y (/ y z)))) (* (- x) 1.0))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -1e-220)
t_1
(if (<= t_1 0.0)
(/ (- t a) (- b y))
(if (<= t_1 1e+258)
t_1
(if (<= t_1 INFINITY)
t_2
(- (/ t (- b y)) (/ a (- b y))))))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_2 = ((t - a) / (b - (y - (y / z)))) - (-x * 1.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -1e-220) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (t - a) / (b - y);
} else if (t_1 <= 1e+258) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_2 = ((t - a) / (b - (y - (y / z)))) - (-x * 1.0);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= -1e-220) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (t - a) / (b - y);
} else if (t_1 <= 1e+258) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) t_2 = ((t - a) / (b - (y - (y / z)))) - (-x * 1.0) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= -1e-220: tmp = t_1 elif t_1 <= 0.0: tmp = (t - a) / (b - y) elif t_1 <= 1e+258: tmp = t_1 elif t_1 <= math.inf: tmp = t_2 else: tmp = (t / (b - y)) - (a / (b - y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_2 = Float64(Float64(Float64(t - a) / Float64(b - Float64(y - Float64(y / z)))) - Float64(Float64(-x) * 1.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -1e-220) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (t_1 <= 1e+258) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(Float64(t / Float64(b - y)) - Float64(a / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); t_2 = ((t - a) / (b - (y - (y / z)))) - (-x * 1.0); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= -1e-220) tmp = t_1; elseif (t_1 <= 0.0) tmp = (t - a) / (b - y); elseif (t_1 <= 1e+258) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; else tmp = (t / (b - y)) - (a / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t - a), $MachinePrecision] / N[(b - N[(y - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[((-x) * 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -1e-220], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+258], t$95$1, If[LessEqual[t$95$1, Infinity], t$95$2, N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_2 := \frac{t - a}{b - \left(y - \frac{y}{z}\right)} - \left(-x\right) \cdot 1\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-220}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;t\_1 \leq 10^{+258}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y} - \frac{a}{b - y}\\
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 1.0000000000000001e258 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6479.3%
Applied rewrites79.3%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f6479.4%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
add-to-fraction-revN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f64N/A
lower-/.f6493.4%
Applied rewrites93.4%
Taylor expanded in z around 0
Applied rewrites66.3%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -9.9999999999999999e-221 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.0000000000000001e258Initial program 66.8%
if -9.9999999999999999e-221 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in z around inf
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_2 (- (* (/ z (+ (* (- b y) z) y)) (- t a)) (* (- x) 1.0))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -1e-220)
t_1
(if (<= t_1 0.0)
(/ (- t a) (- b y))
(if (<= t_1 1e+300)
t_1
(if (<= t_1 INFINITY)
t_2
(- (/ t (- b y)) (/ a (- b y))))))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_2 = ((z / (((b - y) * z) + y)) * (t - a)) - (-x * 1.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -1e-220) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (t - a) / (b - y);
} else if (t_1 <= 1e+300) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_2 = ((z / (((b - y) * z) + y)) * (t - a)) - (-x * 1.0);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= -1e-220) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (t - a) / (b - y);
} else if (t_1 <= 1e+300) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) t_2 = ((z / (((b - y) * z) + y)) * (t - a)) - (-x * 1.0) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= -1e-220: tmp = t_1 elif t_1 <= 0.0: tmp = (t - a) / (b - y) elif t_1 <= 1e+300: tmp = t_1 elif t_1 <= math.inf: tmp = t_2 else: tmp = (t / (b - y)) - (a / (b - y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_2 = Float64(Float64(Float64(z / Float64(Float64(Float64(b - y) * z) + y)) * Float64(t - a)) - Float64(Float64(-x) * 1.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -1e-220) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (t_1 <= 1e+300) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(Float64(t / Float64(b - y)) - Float64(a / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); t_2 = ((z / (((b - y) * z) + y)) * (t - a)) - (-x * 1.0); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= -1e-220) tmp = t_1; elseif (t_1 <= 0.0) tmp = (t - a) / (b - y); elseif (t_1 <= 1e+300) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; else tmp = (t / (b - y)) - (a / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision] - N[((-x) * 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -1e-220], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+300], t$95$1, If[LessEqual[t$95$1, Infinity], t$95$2, N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_2 := \frac{z}{\left(b - y\right) \cdot z + y} \cdot \left(t - a\right) - \left(-x\right) \cdot 1\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-220}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;t\_1 \leq 10^{+300}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y} - \frac{a}{b - y}\\
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 1.0000000000000001e300 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in z around 0
Applied rewrites59.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -9.9999999999999999e-221 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.0000000000000001e300Initial program 66.8%
if -9.9999999999999999e-221 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in z around inf
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* (- b y) z) y)))
(if (<= z -2.8e+110)
(/ (- t a) (- b y))
(if (<= z 4e+85)
(- (* (/ z t_1) (- t a)) (* (- x) (/ y t_1)))
(- (/ t (- b y)) (/ a (- b y)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((b - y) * z) + y;
double tmp;
if (z <= -2.8e+110) {
tmp = (t - a) / (b - y);
} else if (z <= 4e+85) {
tmp = ((z / t_1) * (t - a)) - (-x * (y / t_1));
} else {
tmp = (t / (b - y)) - (a / (b - 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, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = ((b - y) * z) + y
if (z <= (-2.8d+110)) then
tmp = (t - a) / (b - y)
else if (z <= 4d+85) then
tmp = ((z / t_1) * (t - a)) - (-x * (y / t_1))
else
tmp = (t / (b - y)) - (a / (b - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((b - y) * z) + y;
double tmp;
if (z <= -2.8e+110) {
tmp = (t - a) / (b - y);
} else if (z <= 4e+85) {
tmp = ((z / t_1) * (t - a)) - (-x * (y / t_1));
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((b - y) * z) + y tmp = 0 if z <= -2.8e+110: tmp = (t - a) / (b - y) elif z <= 4e+85: tmp = ((z / t_1) * (t - a)) - (-x * (y / t_1)) else: tmp = (t / (b - y)) - (a / (b - y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(b - y) * z) + y) tmp = 0.0 if (z <= -2.8e+110) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (z <= 4e+85) tmp = Float64(Float64(Float64(z / t_1) * Float64(t - a)) - Float64(Float64(-x) * Float64(y / t_1))); else tmp = Float64(Float64(t / Float64(b - y)) - Float64(a / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((b - y) * z) + y; tmp = 0.0; if (z <= -2.8e+110) tmp = (t - a) / (b - y); elseif (z <= 4e+85) tmp = ((z / t_1) * (t - a)) - (-x * (y / t_1)); else tmp = (t / (b - y)) - (a / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[z, -2.8e+110], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+85], N[(N[(N[(z / t$95$1), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision] - N[((-x) * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(b - y\right) \cdot z + y\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+110}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+85}:\\
\;\;\;\;\frac{z}{t\_1} \cdot \left(t - a\right) - \left(-x\right) \cdot \frac{y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y} - \frac{a}{b - y}\\
\end{array}
if z < -2.7999999999999999e110Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if -2.7999999999999999e110 < z < 4.0000000000000001e85Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
if 4.0000000000000001e85 < z Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in z around inf
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.85e+25)
(/ (- t a) (- b y))
(if (<= z 3.8e+52)
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))
(- (/ t (- b y)) (/ a (- b y))))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.85e+25) {
tmp = (t - a) / (b - y);
} else if (z <= 3.8e+52) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
} else {
tmp = (t / (b - y)) - (a / (b - 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, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.85d+25)) then
tmp = (t - a) / (b - y)
else if (z <= 3.8d+52) then
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
else
tmp = (t / (b - y)) - (a / (b - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.85e+25) {
tmp = (t - a) / (b - y);
} else if (z <= 3.8e+52) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.85e+25: tmp = (t - a) / (b - y) elif z <= 3.8e+52: tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) else: tmp = (t / (b - y)) - (a / (b - y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.85e+25) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (z <= 3.8e+52) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); else tmp = Float64(Float64(t / Float64(b - y)) - Float64(a / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.85e+25) tmp = (t - a) / (b - y); elseif (z <= 3.8e+52) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); else tmp = (t / (b - y)) - (a / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.85e+25], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+52], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+25}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+52}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y} - \frac{a}{b - y}\\
\end{array}
if z < -1.8499999999999999e25Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if -1.8499999999999999e25 < z < 3.8e52Initial program 66.8%
if 3.8e52 < z Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in z around inf
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.22e-6)
(/ (- t a) (- b y))
(if (<= z 860000.0)
(/ (+ (* x y) (* z (- t a))) (+ y (* z b)))
(- (/ t (- b y)) (/ a (- b y))))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.22e-6) {
tmp = (t - a) / (b - y);
} else if (z <= 860000.0) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * b));
} else {
tmp = (t / (b - y)) - (a / (b - 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, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.22d-6)) then
tmp = (t - a) / (b - y)
else if (z <= 860000.0d0) then
tmp = ((x * y) + (z * (t - a))) / (y + (z * b))
else
tmp = (t / (b - y)) - (a / (b - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.22e-6) {
tmp = (t - a) / (b - y);
} else if (z <= 860000.0) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * b));
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.22e-6: tmp = (t - a) / (b - y) elif z <= 860000.0: tmp = ((x * y) + (z * (t - a))) / (y + (z * b)) else: tmp = (t / (b - y)) - (a / (b - y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.22e-6) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (z <= 860000.0) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * b))); else tmp = Float64(Float64(t / Float64(b - y)) - Float64(a / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.22e-6) tmp = (t - a) / (b - y); elseif (z <= 860000.0) tmp = ((x * y) + (z * (t - a))) / (y + (z * b)); else tmp = (t / (b - y)) - (a / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.22e-6], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 860000.0], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{-6}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;z \leq 860000:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y} - \frac{a}{b - y}\\
\end{array}
if z < -1.22e-6Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if -1.22e-6 < z < 8.6e5Initial program 66.8%
Taylor expanded in y around 0
Applied rewrites57.5%
if 8.6e5 < z Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in z around inf
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -5.7e-7)
(/ (- t a) (- b y))
(if (<= z -3.6e-151)
(/ (+ (* x y) (* t z)) (+ y (* z (- b y))))
(if (<= z 2.5e-170)
(/ x (/ (+ (* (- b y) z) y) y))
(if (<= z 1.9e-81)
(/ (+ (* x y) (* z (- t a))) (* (- 1.0 z) y))
(- (/ t (- b y)) (/ a (- b y))))))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.7e-7) {
tmp = (t - a) / (b - y);
} else if (z <= -3.6e-151) {
tmp = ((x * y) + (t * z)) / (y + (z * (b - y)));
} else if (z <= 2.5e-170) {
tmp = x / ((((b - y) * z) + y) / y);
} else if (z <= 1.9e-81) {
tmp = ((x * y) + (z * (t - a))) / ((1.0 - z) * y);
} else {
tmp = (t / (b - y)) - (a / (b - 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, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-5.7d-7)) then
tmp = (t - a) / (b - y)
else if (z <= (-3.6d-151)) then
tmp = ((x * y) + (t * z)) / (y + (z * (b - y)))
else if (z <= 2.5d-170) then
tmp = x / ((((b - y) * z) + y) / y)
else if (z <= 1.9d-81) then
tmp = ((x * y) + (z * (t - a))) / ((1.0d0 - z) * y)
else
tmp = (t / (b - y)) - (a / (b - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.7e-7) {
tmp = (t - a) / (b - y);
} else if (z <= -3.6e-151) {
tmp = ((x * y) + (t * z)) / (y + (z * (b - y)));
} else if (z <= 2.5e-170) {
tmp = x / ((((b - y) * z) + y) / y);
} else if (z <= 1.9e-81) {
tmp = ((x * y) + (z * (t - a))) / ((1.0 - z) * y);
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -5.7e-7: tmp = (t - a) / (b - y) elif z <= -3.6e-151: tmp = ((x * y) + (t * z)) / (y + (z * (b - y))) elif z <= 2.5e-170: tmp = x / ((((b - y) * z) + y) / y) elif z <= 1.9e-81: tmp = ((x * y) + (z * (t - a))) / ((1.0 - z) * y) else: tmp = (t / (b - y)) - (a / (b - y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.7e-7) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (z <= -3.6e-151) tmp = Float64(Float64(Float64(x * y) + Float64(t * z)) / Float64(y + Float64(z * Float64(b - y)))); elseif (z <= 2.5e-170) tmp = Float64(x / Float64(Float64(Float64(Float64(b - y) * z) + y) / y)); elseif (z <= 1.9e-81) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(Float64(1.0 - z) * y)); else tmp = Float64(Float64(t / Float64(b - y)) - Float64(a / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -5.7e-7) tmp = (t - a) / (b - y); elseif (z <= -3.6e-151) tmp = ((x * y) + (t * z)) / (y + (z * (b - y))); elseif (z <= 2.5e-170) tmp = x / ((((b - y) * z) + y) / y); elseif (z <= 1.9e-81) tmp = ((x * y) + (z * (t - a))) / ((1.0 - z) * y); else tmp = (t / (b - y)) - (a / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.7e-7], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e-151], N[(N[(N[(x * y), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e-170], N[(x / N[(N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-81], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -5.7 \cdot 10^{-7}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-151}:\\
\;\;\;\;\frac{x \cdot y + t \cdot z}{y + z \cdot \left(b - y\right)}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-170}:\\
\;\;\;\;\frac{x}{\frac{\left(b - y\right) \cdot z + y}{y}}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-81}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{\left(1 - z\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y} - \frac{a}{b - y}\\
\end{array}
if z < -5.7000000000000005e-7Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if -5.7000000000000005e-7 < z < -3.6000000000000003e-151Initial program 66.8%
Taylor expanded in t around inf
lower-*.f6447.9%
Applied rewrites47.9%
if -3.6000000000000003e-151 < z < 2.5000000000000001e-170Initial program 66.8%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6429.3%
Applied rewrites29.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
div-flip-revN/A
lift-+.f64N/A
+-commutativeN/A
*-lft-identityN/A
lift-*.f64N/A
fp-cancel-sign-subN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
sub-to-fractionN/A
lift-/.f64N/A
lift--.f64N/A
Applied rewrites36.5%
if 2.5000000000000001e-170 < z < 1.8999999999999999e-81Initial program 66.8%
lift-+.f64N/A
add-flipN/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6461.0%
Applied rewrites61.0%
Taylor expanded in y around inf
Applied rewrites42.8%
if 1.8999999999999999e-81 < z Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in z around inf
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y)))))
(if (<= z -5.7e-7)
(/ (- t a) (- b y))
(if (<= z -3.6e-151)
(/ (+ (* x y) (* t z)) t_1)
(if (<= z 3.5e-96)
(/ x (/ (+ (* (- b y) z) y) y))
(if (<= z 9.8e+28)
(/ (* z (- t a)) t_1)
(- (/ t (- b y)) (/ a (- b y)))))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double tmp;
if (z <= -5.7e-7) {
tmp = (t - a) / (b - y);
} else if (z <= -3.6e-151) {
tmp = ((x * y) + (t * z)) / t_1;
} else if (z <= 3.5e-96) {
tmp = x / ((((b - y) * z) + y) / y);
} else if (z <= 9.8e+28) {
tmp = (z * (t - a)) / t_1;
} else {
tmp = (t / (b - y)) - (a / (b - 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, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y + (z * (b - y))
if (z <= (-5.7d-7)) then
tmp = (t - a) / (b - y)
else if (z <= (-3.6d-151)) then
tmp = ((x * y) + (t * z)) / t_1
else if (z <= 3.5d-96) then
tmp = x / ((((b - y) * z) + y) / y)
else if (z <= 9.8d+28) then
tmp = (z * (t - a)) / t_1
else
tmp = (t / (b - y)) - (a / (b - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double tmp;
if (z <= -5.7e-7) {
tmp = (t - a) / (b - y);
} else if (z <= -3.6e-151) {
tmp = ((x * y) + (t * z)) / t_1;
} else if (z <= 3.5e-96) {
tmp = x / ((((b - y) * z) + y) / y);
} else if (z <= 9.8e+28) {
tmp = (z * (t - a)) / t_1;
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) tmp = 0 if z <= -5.7e-7: tmp = (t - a) / (b - y) elif z <= -3.6e-151: tmp = ((x * y) + (t * z)) / t_1 elif z <= 3.5e-96: tmp = x / ((((b - y) * z) + y) / y) elif z <= 9.8e+28: tmp = (z * (t - a)) / t_1 else: tmp = (t / (b - y)) - (a / (b - y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) tmp = 0.0 if (z <= -5.7e-7) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (z <= -3.6e-151) tmp = Float64(Float64(Float64(x * y) + Float64(t * z)) / t_1); elseif (z <= 3.5e-96) tmp = Float64(x / Float64(Float64(Float64(Float64(b - y) * z) + y) / y)); elseif (z <= 9.8e+28) tmp = Float64(Float64(z * Float64(t - a)) / t_1); else tmp = Float64(Float64(t / Float64(b - y)) - Float64(a / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); tmp = 0.0; if (z <= -5.7e-7) tmp = (t - a) / (b - y); elseif (z <= -3.6e-151) tmp = ((x * y) + (t * z)) / t_1; elseif (z <= 3.5e-96) tmp = x / ((((b - y) * z) + y) / y); elseif (z <= 9.8e+28) tmp = (z * (t - a)) / t_1; else tmp = (t / (b - y)) - (a / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.7e-7], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e-151], N[(N[(N[(x * y), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 3.5e-96], N[(x / N[(N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.8e+28], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
\mathbf{if}\;z \leq -5.7 \cdot 10^{-7}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-151}:\\
\;\;\;\;\frac{x \cdot y + t \cdot z}{t\_1}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-96}:\\
\;\;\;\;\frac{x}{\frac{\left(b - y\right) \cdot z + y}{y}}\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+28}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y} - \frac{a}{b - y}\\
\end{array}
if z < -5.7000000000000005e-7Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if -5.7000000000000005e-7 < z < -3.6000000000000003e-151Initial program 66.8%
Taylor expanded in t around inf
lower-*.f6447.9%
Applied rewrites47.9%
if -3.6000000000000003e-151 < z < 3.4999999999999999e-96Initial program 66.8%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6429.3%
Applied rewrites29.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
div-flip-revN/A
lift-+.f64N/A
+-commutativeN/A
*-lft-identityN/A
lift-*.f64N/A
fp-cancel-sign-subN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
sub-to-fractionN/A
lift-/.f64N/A
lift--.f64N/A
Applied rewrites36.5%
if 3.4999999999999999e-96 < z < 9.7999999999999992e28Initial program 66.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
if 9.7999999999999992e28 < z Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in z around inf
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.6e+14)
(/ (- t a) (- b y))
(if (<= z -3.6e-151)
(/ (+ (* x y) (* t z)) (+ y (* z b)))
(if (<= z 3.5e-96)
(/ x (/ (+ (* (- b y) z) y) y))
(if (<= z 9.8e+28)
(/ (* z (- t a)) (+ y (* z (- b y))))
(- (/ t (- b y)) (/ a (- b y))))))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.6e+14) {
tmp = (t - a) / (b - y);
} else if (z <= -3.6e-151) {
tmp = ((x * y) + (t * z)) / (y + (z * b));
} else if (z <= 3.5e-96) {
tmp = x / ((((b - y) * z) + y) / y);
} else if (z <= 9.8e+28) {
tmp = (z * (t - a)) / (y + (z * (b - y)));
} else {
tmp = (t / (b - y)) - (a / (b - 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, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.6d+14)) then
tmp = (t - a) / (b - y)
else if (z <= (-3.6d-151)) then
tmp = ((x * y) + (t * z)) / (y + (z * b))
else if (z <= 3.5d-96) then
tmp = x / ((((b - y) * z) + y) / y)
else if (z <= 9.8d+28) then
tmp = (z * (t - a)) / (y + (z * (b - y)))
else
tmp = (t / (b - y)) - (a / (b - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.6e+14) {
tmp = (t - a) / (b - y);
} else if (z <= -3.6e-151) {
tmp = ((x * y) + (t * z)) / (y + (z * b));
} else if (z <= 3.5e-96) {
tmp = x / ((((b - y) * z) + y) / y);
} else if (z <= 9.8e+28) {
tmp = (z * (t - a)) / (y + (z * (b - y)));
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.6e+14: tmp = (t - a) / (b - y) elif z <= -3.6e-151: tmp = ((x * y) + (t * z)) / (y + (z * b)) elif z <= 3.5e-96: tmp = x / ((((b - y) * z) + y) / y) elif z <= 9.8e+28: tmp = (z * (t - a)) / (y + (z * (b - y))) else: tmp = (t / (b - y)) - (a / (b - y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.6e+14) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (z <= -3.6e-151) tmp = Float64(Float64(Float64(x * y) + Float64(t * z)) / Float64(y + Float64(z * b))); elseif (z <= 3.5e-96) tmp = Float64(x / Float64(Float64(Float64(Float64(b - y) * z) + y) / y)); elseif (z <= 9.8e+28) tmp = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * Float64(b - y)))); else tmp = Float64(Float64(t / Float64(b - y)) - Float64(a / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.6e+14) tmp = (t - a) / (b - y); elseif (z <= -3.6e-151) tmp = ((x * y) + (t * z)) / (y + (z * b)); elseif (z <= 3.5e-96) tmp = x / ((((b - y) * z) + y) / y); elseif (z <= 9.8e+28) tmp = (z * (t - a)) / (y + (z * (b - y))); else tmp = (t / (b - y)) - (a / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.6e+14], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e-151], N[(N[(N[(x * y), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e-96], N[(x / N[(N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.8e+28], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+14}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-151}:\\
\;\;\;\;\frac{x \cdot y + t \cdot z}{y + z \cdot b}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-96}:\\
\;\;\;\;\frac{x}{\frac{\left(b - y\right) \cdot z + y}{y}}\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+28}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y} - \frac{a}{b - y}\\
\end{array}
if z < -4.6e14Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if -4.6e14 < z < -3.6000000000000003e-151Initial program 66.8%
Taylor expanded in y around 0
Applied rewrites57.5%
Taylor expanded in t around inf
lower-*.f6442.0%
Applied rewrites42.0%
if -3.6000000000000003e-151 < z < 3.4999999999999999e-96Initial program 66.8%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6429.3%
Applied rewrites29.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
div-flip-revN/A
lift-+.f64N/A
+-commutativeN/A
*-lft-identityN/A
lift-*.f64N/A
fp-cancel-sign-subN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
sub-to-fractionN/A
lift-/.f64N/A
lift--.f64N/A
Applied rewrites36.5%
if 3.4999999999999999e-96 < z < 9.7999999999999992e28Initial program 66.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
if 9.7999999999999992e28 < z Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in z around inf
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.6e+14)
(/ (- t a) (- b y))
(if (<= z -3.6e-151)
(/ (+ (* x y) (* t z)) (+ y (* z b)))
(if (<= z 3.5e-96)
(* (/ y (+ (* (- b y) z) y)) x)
(if (<= z 9.8e+28)
(/ (* z (- t a)) (+ y (* z (- b y))))
(- (/ t (- b y)) (/ a (- b y))))))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.6e+14) {
tmp = (t - a) / (b - y);
} else if (z <= -3.6e-151) {
tmp = ((x * y) + (t * z)) / (y + (z * b));
} else if (z <= 3.5e-96) {
tmp = (y / (((b - y) * z) + y)) * x;
} else if (z <= 9.8e+28) {
tmp = (z * (t - a)) / (y + (z * (b - y)));
} else {
tmp = (t / (b - y)) - (a / (b - 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, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.6d+14)) then
tmp = (t - a) / (b - y)
else if (z <= (-3.6d-151)) then
tmp = ((x * y) + (t * z)) / (y + (z * b))
else if (z <= 3.5d-96) then
tmp = (y / (((b - y) * z) + y)) * x
else if (z <= 9.8d+28) then
tmp = (z * (t - a)) / (y + (z * (b - y)))
else
tmp = (t / (b - y)) - (a / (b - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.6e+14) {
tmp = (t - a) / (b - y);
} else if (z <= -3.6e-151) {
tmp = ((x * y) + (t * z)) / (y + (z * b));
} else if (z <= 3.5e-96) {
tmp = (y / (((b - y) * z) + y)) * x;
} else if (z <= 9.8e+28) {
tmp = (z * (t - a)) / (y + (z * (b - y)));
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.6e+14: tmp = (t - a) / (b - y) elif z <= -3.6e-151: tmp = ((x * y) + (t * z)) / (y + (z * b)) elif z <= 3.5e-96: tmp = (y / (((b - y) * z) + y)) * x elif z <= 9.8e+28: tmp = (z * (t - a)) / (y + (z * (b - y))) else: tmp = (t / (b - y)) - (a / (b - y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.6e+14) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (z <= -3.6e-151) tmp = Float64(Float64(Float64(x * y) + Float64(t * z)) / Float64(y + Float64(z * b))); elseif (z <= 3.5e-96) tmp = Float64(Float64(y / Float64(Float64(Float64(b - y) * z) + y)) * x); elseif (z <= 9.8e+28) tmp = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * Float64(b - y)))); else tmp = Float64(Float64(t / Float64(b - y)) - Float64(a / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.6e+14) tmp = (t - a) / (b - y); elseif (z <= -3.6e-151) tmp = ((x * y) + (t * z)) / (y + (z * b)); elseif (z <= 3.5e-96) tmp = (y / (((b - y) * z) + y)) * x; elseif (z <= 9.8e+28) tmp = (z * (t - a)) / (y + (z * (b - y))); else tmp = (t / (b - y)) - (a / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.6e+14], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e-151], N[(N[(N[(x * y), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e-96], N[(N[(y / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 9.8e+28], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+14}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-151}:\\
\;\;\;\;\frac{x \cdot y + t \cdot z}{y + z \cdot b}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-96}:\\
\;\;\;\;\frac{y}{\left(b - y\right) \cdot z + y} \cdot x\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+28}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y} - \frac{a}{b - y}\\
\end{array}
if z < -4.6e14Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if -4.6e14 < z < -3.6000000000000003e-151Initial program 66.8%
Taylor expanded in y around 0
Applied rewrites57.5%
Taylor expanded in t around inf
lower-*.f6442.0%
Applied rewrites42.0%
if -3.6000000000000003e-151 < z < 3.4999999999999999e-96Initial program 66.8%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6429.3%
Applied rewrites29.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-/.f64N/A
*-commutativeN/A
Applied rewrites36.5%
if 3.4999999999999999e-96 < z < 9.7999999999999992e28Initial program 66.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
if 9.7999999999999992e28 < z Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in z around inf
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -9.5e-28)
(/ (- t a) (- b y))
(if (<= z 3.5e-96)
(* (/ y (+ (* (- b y) z) y)) x)
(if (<= z 9.8e+28)
(/ (* z (- t a)) (+ y (* z (- b y))))
(- (/ t (- b y)) (/ a (- b y)))))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -9.5e-28) {
tmp = (t - a) / (b - y);
} else if (z <= 3.5e-96) {
tmp = (y / (((b - y) * z) + y)) * x;
} else if (z <= 9.8e+28) {
tmp = (z * (t - a)) / (y + (z * (b - y)));
} else {
tmp = (t / (b - y)) - (a / (b - 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, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-9.5d-28)) then
tmp = (t - a) / (b - y)
else if (z <= 3.5d-96) then
tmp = (y / (((b - y) * z) + y)) * x
else if (z <= 9.8d+28) then
tmp = (z * (t - a)) / (y + (z * (b - y)))
else
tmp = (t / (b - y)) - (a / (b - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -9.5e-28) {
tmp = (t - a) / (b - y);
} else if (z <= 3.5e-96) {
tmp = (y / (((b - y) * z) + y)) * x;
} else if (z <= 9.8e+28) {
tmp = (z * (t - a)) / (y + (z * (b - y)));
} else {
tmp = (t / (b - y)) - (a / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -9.5e-28: tmp = (t - a) / (b - y) elif z <= 3.5e-96: tmp = (y / (((b - y) * z) + y)) * x elif z <= 9.8e+28: tmp = (z * (t - a)) / (y + (z * (b - y))) else: tmp = (t / (b - y)) - (a / (b - y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -9.5e-28) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (z <= 3.5e-96) tmp = Float64(Float64(y / Float64(Float64(Float64(b - y) * z) + y)) * x); elseif (z <= 9.8e+28) tmp = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * Float64(b - y)))); else tmp = Float64(Float64(t / Float64(b - y)) - Float64(a / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -9.5e-28) tmp = (t - a) / (b - y); elseif (z <= 3.5e-96) tmp = (y / (((b - y) * z) + y)) * x; elseif (z <= 9.8e+28) tmp = (z * (t - a)) / (y + (z * (b - y))); else tmp = (t / (b - y)) - (a / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -9.5e-28], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e-96], N[(N[(y / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 9.8e+28], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-28}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-96}:\\
\;\;\;\;\frac{y}{\left(b - y\right) \cdot z + y} \cdot x\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+28}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y} - \frac{a}{b - y}\\
\end{array}
if z < -9.5e-28Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if -9.5e-28 < z < 3.4999999999999999e-96Initial program 66.8%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6429.3%
Applied rewrites29.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-/.f64N/A
*-commutativeN/A
Applied rewrites36.5%
if 3.4999999999999999e-96 < z < 9.7999999999999992e28Initial program 66.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
if 9.7999999999999992e28 < z Initial program 66.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites79.4%
Taylor expanded in z around inf
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -9.5e-28)
t_1
(if (<= z 3.5e-96)
(* (/ y (+ (* (- b y) z) y)) x)
(if (<= z 9.8e+28) (/ (* z (- t a)) (+ y (* z (- b y)))) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -9.5e-28) {
tmp = t_1;
} else if (z <= 3.5e-96) {
tmp = (y / (((b - y) * z) + y)) * x;
} else if (z <= 9.8e+28) {
tmp = (z * (t - a)) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-9.5d-28)) then
tmp = t_1
else if (z <= 3.5d-96) then
tmp = (y / (((b - y) * z) + y)) * x
else if (z <= 9.8d+28) then
tmp = (z * (t - a)) / (y + (z * (b - y)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -9.5e-28) {
tmp = t_1;
} else if (z <= 3.5e-96) {
tmp = (y / (((b - y) * z) + y)) * x;
} else if (z <= 9.8e+28) {
tmp = (z * (t - a)) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -9.5e-28: tmp = t_1 elif z <= 3.5e-96: tmp = (y / (((b - y) * z) + y)) * x elif z <= 9.8e+28: tmp = (z * (t - a)) / (y + (z * (b - y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -9.5e-28) tmp = t_1; elseif (z <= 3.5e-96) tmp = Float64(Float64(y / Float64(Float64(Float64(b - y) * z) + y)) * x); elseif (z <= 9.8e+28) tmp = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -9.5e-28) tmp = t_1; elseif (z <= 3.5e-96) tmp = (y / (((b - y) * z) + y)) * x; elseif (z <= 9.8e+28) tmp = (z * (t - a)) / (y + (z * (b - y))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.5e-28], t$95$1, If[LessEqual[z, 3.5e-96], N[(N[(y / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 9.8e+28], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-96}:\\
\;\;\;\;\frac{y}{\left(b - y\right) \cdot z + y} \cdot x\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+28}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -9.5e-28 or 9.7999999999999992e28 < z Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if -9.5e-28 < z < 3.4999999999999999e-96Initial program 66.8%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6429.3%
Applied rewrites29.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-/.f64N/A
*-commutativeN/A
Applied rewrites36.5%
if 3.4999999999999999e-96 < z < 9.7999999999999992e28Initial program 66.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -9.5e-28)
t_1
(if (<= z 3.5e-96)
(* (/ y (+ (* (- b y) z) y)) x)
(if (<= z 1.18e-11) (/ (* z (- t a)) (+ y (* z b))) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -9.5e-28) {
tmp = t_1;
} else if (z <= 3.5e-96) {
tmp = (y / (((b - y) * z) + y)) * x;
} else if (z <= 1.18e-11) {
tmp = (z * (t - a)) / (y + (z * b));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-9.5d-28)) then
tmp = t_1
else if (z <= 3.5d-96) then
tmp = (y / (((b - y) * z) + y)) * x
else if (z <= 1.18d-11) then
tmp = (z * (t - a)) / (y + (z * b))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -9.5e-28) {
tmp = t_1;
} else if (z <= 3.5e-96) {
tmp = (y / (((b - y) * z) + y)) * x;
} else if (z <= 1.18e-11) {
tmp = (z * (t - a)) / (y + (z * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -9.5e-28: tmp = t_1 elif z <= 3.5e-96: tmp = (y / (((b - y) * z) + y)) * x elif z <= 1.18e-11: tmp = (z * (t - a)) / (y + (z * b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -9.5e-28) tmp = t_1; elseif (z <= 3.5e-96) tmp = Float64(Float64(y / Float64(Float64(Float64(b - y) * z) + y)) * x); elseif (z <= 1.18e-11) tmp = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * b))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -9.5e-28) tmp = t_1; elseif (z <= 3.5e-96) tmp = (y / (((b - y) * z) + y)) * x; elseif (z <= 1.18e-11) tmp = (z * (t - a)) / (y + (z * b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.5e-28], t$95$1, If[LessEqual[z, 3.5e-96], N[(N[(y / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.18e-11], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-96}:\\
\;\;\;\;\frac{y}{\left(b - y\right) \cdot z + y} \cdot x\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{-11}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -9.5e-28 or 1.1800000000000001e-11 < z Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if -9.5e-28 < z < 3.4999999999999999e-96Initial program 66.8%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6429.3%
Applied rewrites29.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-/.f64N/A
*-commutativeN/A
Applied rewrites36.5%
if 3.4999999999999999e-96 < z < 1.1800000000000001e-11Initial program 66.8%
Taylor expanded in y around 0
Applied rewrites57.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6434.9%
Applied rewrites34.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -9.5e-28)
t_1
(if (<= z 1.85e-48) (* (/ y (+ (* (- b y) z) y)) x) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -9.5e-28) {
tmp = t_1;
} else if (z <= 1.85e-48) {
tmp = (y / (((b - y) * z) + y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-9.5d-28)) then
tmp = t_1
else if (z <= 1.85d-48) then
tmp = (y / (((b - y) * z) + y)) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -9.5e-28) {
tmp = t_1;
} else if (z <= 1.85e-48) {
tmp = (y / (((b - y) * z) + y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -9.5e-28: tmp = t_1 elif z <= 1.85e-48: tmp = (y / (((b - y) * z) + y)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -9.5e-28) tmp = t_1; elseif (z <= 1.85e-48) tmp = Float64(Float64(y / Float64(Float64(Float64(b - y) * z) + y)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -9.5e-28) tmp = t_1; elseif (z <= 1.85e-48) tmp = (y / (((b - y) * z) + y)) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.5e-28], t$95$1, If[LessEqual[z, 1.85e-48], N[(N[(y / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-48}:\\
\;\;\;\;\frac{y}{\left(b - y\right) \cdot z + y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -9.5e-28 or 1.8499999999999999e-48 < z Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if -9.5e-28 < z < 1.8499999999999999e-48Initial program 66.8%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6429.3%
Applied rewrites29.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-/.f64N/A
*-commutativeN/A
Applied rewrites36.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -6.6e-79) t_1 (if (<= z 1.9e-81) (+ x (* x z)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -6.6e-79) {
tmp = t_1;
} else if (z <= 1.9e-81) {
tmp = x + (x * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-6.6d-79)) then
tmp = t_1
else if (z <= 1.9d-81) then
tmp = x + (x * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -6.6e-79) {
tmp = t_1;
} else if (z <= 1.9e-81) {
tmp = x + (x * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -6.6e-79: tmp = t_1 elif z <= 1.9e-81: tmp = x + (x * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -6.6e-79) tmp = t_1; elseif (z <= 1.9e-81) tmp = Float64(x + Float64(x * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -6.6e-79) tmp = t_1; elseif (z <= 1.9e-81) tmp = x + (x * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e-79], t$95$1, If[LessEqual[z, 1.9e-81], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{-79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-81}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -6.5999999999999996e-79 or 1.8999999999999999e-81 < z Initial program 66.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if -6.5999999999999996e-79 < z < 1.8999999999999999e-81Initial program 66.8%
lift-+.f64N/A
add-flipN/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6461.0%
Applied rewrites61.0%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6433.4%
Applied rewrites33.4%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f6425.8%
Applied rewrites25.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -4.7e+39) t_1 (if (<= y 3e+65) (/ (- t a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -4.7e+39) {
tmp = t_1;
} else if (y <= 3e+65) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - z)
if (y <= (-4.7d+39)) then
tmp = t_1
else if (y <= 3d+65) then
tmp = (t - a) / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -4.7e+39) {
tmp = t_1;
} else if (y <= 3e+65) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -4.7e+39: tmp = t_1 elif y <= 3e+65: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -4.7e+39) tmp = t_1; elseif (y <= 3e+65) tmp = Float64(Float64(t - a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -4.7e+39) tmp = t_1; elseif (y <= 3e+65) tmp = (t - a) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.7e+39], t$95$1, If[LessEqual[y, 3e+65], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -4.7 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+65}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -4.6999999999999999e39 or 3.0000000000000002e65 < y Initial program 66.8%
lift-+.f64N/A
add-flipN/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6461.0%
Applied rewrites61.0%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6433.4%
Applied rewrites33.4%
if -4.6999999999999999e39 < y < 3.0000000000000002e65Initial program 66.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6434.7%
Applied rewrites34.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -180000000000.0) t_1 (if (<= y 7.2e-22) (/ t b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -180000000000.0) {
tmp = t_1;
} else if (y <= 7.2e-22) {
tmp = t / b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - z)
if (y <= (-180000000000.0d0)) then
tmp = t_1
else if (y <= 7.2d-22) then
tmp = t / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -180000000000.0) {
tmp = t_1;
} else if (y <= 7.2e-22) {
tmp = t / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -180000000000.0: tmp = t_1 elif y <= 7.2e-22: tmp = t / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -180000000000.0) tmp = t_1; elseif (y <= 7.2e-22) tmp = Float64(t / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -180000000000.0) tmp = t_1; elseif (y <= 7.2e-22) tmp = t / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -180000000000.0], t$95$1, If[LessEqual[y, 7.2e-22], N[(t / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -180000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-22}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.8e11 or 7.1999999999999996e-22 < y Initial program 66.8%
lift-+.f64N/A
add-flipN/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6461.0%
Applied rewrites61.0%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6433.4%
Applied rewrites33.4%
if -1.8e11 < y < 7.1999999999999996e-22Initial program 66.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6434.7%
Applied rewrites34.7%
Taylor expanded in t around inf
lower-/.f6419.7%
Applied rewrites19.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -6.2e-77) (/ t b) (if (<= z 5.5e-91) (+ x (* x z)) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -6.2e-77) {
tmp = t / b;
} else if (z <= 5.5e-91) {
tmp = x + (x * z);
} else {
tmp = t / b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-6.2d-77)) then
tmp = t / b
else if (z <= 5.5d-91) then
tmp = x + (x * z)
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -6.2e-77) {
tmp = t / b;
} else if (z <= 5.5e-91) {
tmp = x + (x * z);
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -6.2e-77: tmp = t / b elif z <= 5.5e-91: tmp = x + (x * z) else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -6.2e-77) tmp = Float64(t / b); elseif (z <= 5.5e-91) tmp = Float64(x + Float64(x * z)); else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -6.2e-77) tmp = t / b; elseif (z <= 5.5e-91) tmp = x + (x * z); else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -6.2e-77], N[(t / b), $MachinePrecision], If[LessEqual[z, 5.5e-91], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-77}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-91}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
if z < -6.2000000000000002e-77 or 5.4999999999999996e-91 < z Initial program 66.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6434.7%
Applied rewrites34.7%
Taylor expanded in t around inf
lower-/.f6419.7%
Applied rewrites19.7%
if -6.2000000000000002e-77 < z < 5.4999999999999996e-91Initial program 66.8%
lift-+.f64N/A
add-flipN/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6461.0%
Applied rewrites61.0%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6433.4%
Applied rewrites33.4%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f6425.8%
Applied rewrites25.8%
(FPCore (x y z t a b) :precision binary64 (+ x (* x z)))
double code(double x, double y, double z, double t, double a, double b) {
return x + (x * z);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x + (x * z)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + (x * z);
}
def code(x, y, z, t, a, b): return x + (x * z)
function code(x, y, z, t, a, b) return Float64(x + Float64(x * z)) end
function tmp = code(x, y, z, t, a, b) tmp = x + (x * z); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]
x + x \cdot z
Initial program 66.8%
lift-+.f64N/A
add-flipN/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6461.0%
Applied rewrites61.0%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6433.4%
Applied rewrites33.4%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f6425.8%
Applied rewrites25.8%
herbie shell --seed 2025258
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))