
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* z (/ y (- a t)))))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t))))
(t_3 (- (+ x y) (/ (fma (- t) y (* z y)) (- a t)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -2e-262)
t_3
(if (<= t_2 0.0)
(+ x (- (/ (* y (- a z)) t)))
(if (<= t_2 2e+300) t_3 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (z * (y / (a - t)));
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double t_3 = (x + y) - (fma(-t, y, (z * y)) / (a - t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -2e-262) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = x + -((y * (a - z)) / t);
} else if (t_2 <= 2e+300) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - Float64(z * Float64(y / Float64(a - t)))) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) t_3 = Float64(Float64(x + y) - Float64(fma(Float64(-t), y, Float64(z * y)) / Float64(a - t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -2e-262) tmp = t_3; elseif (t_2 <= 0.0) tmp = Float64(x + Float64(-Float64(Float64(y * Float64(a - z)) / t))); elseif (t_2 <= 2e+300) tmp = t_3; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + y), $MachinePrecision] - N[(N[((-t) * y + N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -2e-262], t$95$3, If[LessEqual[t$95$2, 0.0], N[(x + (-N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$2, 2e+300], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot \frac{y}{a - t}\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
t_3 := \left(x + y\right) - \frac{\mathsf{fma}\left(-t, y, z \cdot y\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-262}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;x + \left(-\frac{y \cdot \left(a - z\right)}{t}\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0 or 2.0000000000000001e300 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 39.2%
Taylor expanded in x around inf
Applied rewrites38.6%
Taylor expanded in z around inf
Applied rewrites59.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6476.3
Applied rewrites76.3%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -2.00000000000000002e-262 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 2.0000000000000001e300Initial program 97.7%
Taylor expanded in z around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6497.7
Applied rewrites97.7%
if -2.00000000000000002e-262 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 6.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6472.8
Applied rewrites72.8%
Taylor expanded in t around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6498.1
Applied rewrites98.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* z (/ y (- a t)))))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -2e-262)
t_2
(if (<= t_2 0.0)
(+ x (- (/ (* y (- a z)) t)))
(if (<= t_2 2e+300) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (z * (y / (a - t)));
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -2e-262) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = x + -((y * (a - z)) / t);
} else if (t_2 <= 2e+300) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (z * (y / (a - t)));
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -2e-262) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = x + -((y * (a - z)) / t);
} else if (t_2 <= 2e+300) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (z * (y / (a - t))) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -2e-262: tmp = t_2 elif t_2 <= 0.0: tmp = x + -((y * (a - z)) / t) elif t_2 <= 2e+300: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(z * Float64(y / Float64(a - t)))) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -2e-262) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(x + Float64(-Float64(Float64(y * Float64(a - z)) / t))); elseif (t_2 <= 2e+300) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (z * (y / (a - t))); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -2e-262) tmp = t_2; elseif (t_2 <= 0.0) tmp = x + -((y * (a - z)) / t); elseif (t_2 <= 2e+300) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -2e-262], t$95$2, If[LessEqual[t$95$2, 0.0], N[(x + (-N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$2, 2e+300], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot \frac{y}{a - t}\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-262}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;x + \left(-\frac{y \cdot \left(a - z\right)}{t}\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0 or 2.0000000000000001e300 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 39.2%
Taylor expanded in x around inf
Applied rewrites38.6%
Taylor expanded in z around inf
Applied rewrites59.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6476.3
Applied rewrites76.3%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -2.00000000000000002e-262 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 2.0000000000000001e300Initial program 97.7%
if -2.00000000000000002e-262 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 6.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6472.8
Applied rewrites72.8%
Taylor expanded in t around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6498.1
Applied rewrites98.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- (+ (+ (/ t (- a t)) 1.0) (/ x y)) (/ z (- a t))) y)))
(if (<= y -8e-163)
t_1
(if (<= y 1.3e-77) (- (+ x y) (/ (* (- z t) y) (- a t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((((t / (a - t)) + 1.0) + (x / y)) - (z / (a - t))) * y;
double tmp;
if (y <= -8e-163) {
tmp = t_1;
} else if (y <= 1.3e-77) {
tmp = (x + y) - (((z - t) * y) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((((t / (a - t)) + 1.0d0) + (x / y)) - (z / (a - t))) * y
if (y <= (-8d-163)) then
tmp = t_1
else if (y <= 1.3d-77) then
tmp = (x + y) - (((z - t) * y) / (a - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((((t / (a - t)) + 1.0) + (x / y)) - (z / (a - t))) * y;
double tmp;
if (y <= -8e-163) {
tmp = t_1;
} else if (y <= 1.3e-77) {
tmp = (x + y) - (((z - t) * y) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((((t / (a - t)) + 1.0) + (x / y)) - (z / (a - t))) * y tmp = 0 if y <= -8e-163: tmp = t_1 elif y <= 1.3e-77: tmp = (x + y) - (((z - t) * y) / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(Float64(Float64(t / Float64(a - t)) + 1.0) + Float64(x / y)) - Float64(z / Float64(a - t))) * y) tmp = 0.0 if (y <= -8e-163) tmp = t_1; elseif (y <= 1.3e-77) tmp = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((((t / (a - t)) + 1.0) + (x / y)) - (z / (a - t))) * y; tmp = 0.0; if (y <= -8e-163) tmp = t_1; elseif (y <= 1.3e-77) tmp = (x + y) - (((z - t) * y) / (a - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(N[(N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -8e-163], t$95$1, If[LessEqual[y, 1.3e-77], N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\left(\frac{t}{a - t} + 1\right) + \frac{x}{y}\right) - \frac{z}{a - t}\right) \cdot y\\
\mathbf{if}\;y \leq -8 \cdot 10^{-163}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-77}:\\
\;\;\;\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.99999999999999939e-163 or 1.3000000000000001e-77 < y Initial program 68.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6489.3
Applied rewrites89.3%
if -7.99999999999999939e-163 < y < 1.3000000000000001e-77Initial program 95.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- (+ x y) (* z (/ y a))))) (if (<= a -4.2e-79) t_1 (if (<= a 3800.0) (- x (/ (* z y) (- a t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (z * (y / a));
double tmp;
if (a <= -4.2e-79) {
tmp = t_1;
} else if (a <= 3800.0) {
tmp = x - ((z * y) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (x + y) - (z * (y / a))
if (a <= (-4.2d-79)) then
tmp = t_1
else if (a <= 3800.0d0) then
tmp = x - ((z * y) / (a - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (z * (y / a));
double tmp;
if (a <= -4.2e-79) {
tmp = t_1;
} else if (a <= 3800.0) {
tmp = x - ((z * y) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (z * (y / a)) tmp = 0 if a <= -4.2e-79: tmp = t_1 elif a <= 3800.0: tmp = x - ((z * y) / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(z * Float64(y / a))) tmp = 0.0 if (a <= -4.2e-79) tmp = t_1; elseif (a <= 3800.0) tmp = Float64(x - Float64(Float64(z * y) / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (z * (y / a)); tmp = 0.0; if (a <= -4.2e-79) tmp = t_1; elseif (a <= 3800.0) tmp = x - ((z * y) / (a - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.2e-79], t$95$1, If[LessEqual[a, 3800.0], N[(x - N[(N[(z * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - z \cdot \frac{y}{a}\\
\mathbf{if}\;a \leq -4.2 \cdot 10^{-79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3800:\\
\;\;\;\;x - \frac{z \cdot y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.1999999999999999e-79 or 3800 < a Initial program 78.3%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6478.1
Applied rewrites78.1%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6483.4
Applied rewrites83.4%
if -4.1999999999999999e-79 < a < 3800Initial program 74.0%
Taylor expanded in x around inf
Applied rewrites69.1%
Taylor expanded in z around inf
Applied rewrites89.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.2e+56) (+ y x) (if (<= a 2.5e+96) (- x (* z (/ y (- a t)))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.2e+56) {
tmp = y + x;
} else if (a <= 2.5e+96) {
tmp = x - (z * (y / (a - t)));
} else {
tmp = y + x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-5.2d+56)) then
tmp = y + x
else if (a <= 2.5d+96) then
tmp = x - (z * (y / (a - t)))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.2e+56) {
tmp = y + x;
} else if (a <= 2.5e+96) {
tmp = x - (z * (y / (a - t)));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.2e+56: tmp = y + x elif a <= 2.5e+96: tmp = x - (z * (y / (a - t))) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.2e+56) tmp = Float64(y + x); elseif (a <= 2.5e+96) tmp = Float64(x - Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.2e+56) tmp = y + x; elseif (a <= 2.5e+96) tmp = x - (z * (y / (a - t))); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.2e+56], N[(y + x), $MachinePrecision], If[LessEqual[a, 2.5e+96], N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{+56}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{+96}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -5.20000000000000022e56 or 2.5000000000000002e96 < a Initial program 78.8%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6482.3
Applied rewrites82.3%
if -5.20000000000000022e56 < a < 2.5000000000000002e96Initial program 74.9%
Taylor expanded in x around inf
Applied rewrites67.0%
Taylor expanded in z around inf
Applied rewrites84.8%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6486.7
Applied rewrites86.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.25e+19) (+ y x) (if (<= a 3300.0) (- x (/ (* z y) (- t))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.25e+19) {
tmp = y + x;
} else if (a <= 3300.0) {
tmp = x - ((z * y) / -t);
} else {
tmp = y + x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.25d+19)) then
tmp = y + x
else if (a <= 3300.0d0) then
tmp = x - ((z * y) / -t)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.25e+19) {
tmp = y + x;
} else if (a <= 3300.0) {
tmp = x - ((z * y) / -t);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.25e+19: tmp = y + x elif a <= 3300.0: tmp = x - ((z * y) / -t) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.25e+19) tmp = Float64(y + x); elseif (a <= 3300.0) tmp = Float64(x - Float64(Float64(z * y) / Float64(-t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.25e+19) tmp = y + x; elseif (a <= 3300.0) tmp = x - ((z * y) / -t); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.25e+19], N[(y + x), $MachinePrecision], If[LessEqual[a, 3300.0], N[(x - N[(N[(z * y), $MachinePrecision] / (-t)), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{+19}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 3300:\\
\;\;\;\;x - \frac{z \cdot y}{-t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -1.25e19 or 3300 < a Initial program 78.4%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6477.8
Applied rewrites77.8%
if -1.25e19 < a < 3300Initial program 74.6%
Taylor expanded in x around inf
Applied rewrites68.7%
Taylor expanded in z around inf
Applied rewrites88.1%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6476.5
Applied rewrites76.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_1 (- INFINITY))
(* (- 1.0 (/ z a)) y)
(if (<= t_1 -2e-221)
(+ y x)
(if (<= t_1 0.0)
x
(if (<= t_1 1e+307) (+ y x) (* (/ (- z) (- a t)) y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (1.0 - (z / a)) * y;
} else if (t_1 <= -2e-221) {
tmp = y + x;
} else if (t_1 <= 0.0) {
tmp = x;
} else if (t_1 <= 1e+307) {
tmp = y + x;
} else {
tmp = (-z / (a - t)) * y;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (1.0 - (z / a)) * y;
} else if (t_1 <= -2e-221) {
tmp = y + x;
} else if (t_1 <= 0.0) {
tmp = x;
} else if (t_1 <= 1e+307) {
tmp = y + x;
} else {
tmp = (-z / (a - t)) * y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_1 <= -math.inf: tmp = (1.0 - (z / a)) * y elif t_1 <= -2e-221: tmp = y + x elif t_1 <= 0.0: tmp = x elif t_1 <= 1e+307: tmp = y + x else: tmp = (-z / (a - t)) * y return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(1.0 - Float64(z / a)) * y); elseif (t_1 <= -2e-221) tmp = Float64(y + x); elseif (t_1 <= 0.0) tmp = x; elseif (t_1 <= 1e+307) tmp = Float64(y + x); else tmp = Float64(Float64(Float64(-z) / Float64(a - t)) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_1 <= -Inf) tmp = (1.0 - (z / a)) * y; elseif (t_1 <= -2e-221) tmp = y + x; elseif (t_1 <= 0.0) tmp = x; elseif (t_1 <= 1e+307) tmp = y + x; else tmp = (-z / (a - t)) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, -2e-221], N[(y + x), $MachinePrecision], If[LessEqual[t$95$1, 0.0], x, If[LessEqual[t$95$1, 1e+307], N[(y + x), $MachinePrecision], N[(N[((-z) / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(1 - \frac{z}{a}\right) \cdot y\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-221}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 10^{+307}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{-z}{a - t} \cdot y\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 37.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate--l+N/A
lower-+.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f6460.7
Applied rewrites60.7%
Taylor expanded in t around 0
lower--.f64N/A
lower-/.f6445.7
Applied rewrites45.7%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -2.00000000000000003e-221 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 9.99999999999999986e306Initial program 97.8%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6479.3
Applied rewrites79.3%
if -2.00000000000000003e-221 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 11.3%
Taylor expanded in x around inf
Applied rewrites47.4%
if 9.99999999999999986e306 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 97.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6481.1
Applied rewrites81.1%
Taylor expanded in z around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f6418.4
Applied rewrites18.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_1 (- INFINITY))
(* (- 1.0 (/ z a)) y)
(if (<= t_1 -2e-221)
(+ y x)
(if (<= t_1 0.0) x (if (<= t_1 1e+307) (+ y x) (* (/ (- z a) t) y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (1.0 - (z / a)) * y;
} else if (t_1 <= -2e-221) {
tmp = y + x;
} else if (t_1 <= 0.0) {
tmp = x;
} else if (t_1 <= 1e+307) {
tmp = y + x;
} else {
tmp = ((z - a) / t) * y;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (1.0 - (z / a)) * y;
} else if (t_1 <= -2e-221) {
tmp = y + x;
} else if (t_1 <= 0.0) {
tmp = x;
} else if (t_1 <= 1e+307) {
tmp = y + x;
} else {
tmp = ((z - a) / t) * y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_1 <= -math.inf: tmp = (1.0 - (z / a)) * y elif t_1 <= -2e-221: tmp = y + x elif t_1 <= 0.0: tmp = x elif t_1 <= 1e+307: tmp = y + x else: tmp = ((z - a) / t) * y return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(1.0 - Float64(z / a)) * y); elseif (t_1 <= -2e-221) tmp = Float64(y + x); elseif (t_1 <= 0.0) tmp = x; elseif (t_1 <= 1e+307) tmp = Float64(y + x); else tmp = Float64(Float64(Float64(z - a) / t) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_1 <= -Inf) tmp = (1.0 - (z / a)) * y; elseif (t_1 <= -2e-221) tmp = y + x; elseif (t_1 <= 0.0) tmp = x; elseif (t_1 <= 1e+307) tmp = y + x; else tmp = ((z - a) / t) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, -2e-221], N[(y + x), $MachinePrecision], If[LessEqual[t$95$1, 0.0], x, If[LessEqual[t$95$1, 1e+307], N[(y + x), $MachinePrecision], N[(N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(1 - \frac{z}{a}\right) \cdot y\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-221}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 10^{+307}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{z - a}{t} \cdot y\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 37.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate--l+N/A
lower-+.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f6460.7
Applied rewrites60.7%
Taylor expanded in t around 0
lower--.f64N/A
lower-/.f6445.7
Applied rewrites45.7%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -2.00000000000000003e-221 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 9.99999999999999986e306Initial program 97.8%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6479.3
Applied rewrites79.3%
if -2.00000000000000003e-221 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 11.3%
Taylor expanded in x around inf
Applied rewrites47.4%
if 9.99999999999999986e306 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 97.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate--l+N/A
lower-+.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f6438.2
Applied rewrites38.2%
Taylor expanded in t around -inf
lower-/.f64N/A
lower--.f6412.2
Applied rewrites12.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_1 (- INFINITY))
(* (- 1.0 (/ z a)) y)
(if (<= t_1 -2e-221)
(+ y x)
(if (<= t_1 0.0) x (if (<= t_1 1e+307) (+ y x) (/ (* (- z a) y) t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (1.0 - (z / a)) * y;
} else if (t_1 <= -2e-221) {
tmp = y + x;
} else if (t_1 <= 0.0) {
tmp = x;
} else if (t_1 <= 1e+307) {
tmp = y + x;
} else {
tmp = ((z - a) * y) / t;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (1.0 - (z / a)) * y;
} else if (t_1 <= -2e-221) {
tmp = y + x;
} else if (t_1 <= 0.0) {
tmp = x;
} else if (t_1 <= 1e+307) {
tmp = y + x;
} else {
tmp = ((z - a) * y) / t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_1 <= -math.inf: tmp = (1.0 - (z / a)) * y elif t_1 <= -2e-221: tmp = y + x elif t_1 <= 0.0: tmp = x elif t_1 <= 1e+307: tmp = y + x else: tmp = ((z - a) * y) / t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(1.0 - Float64(z / a)) * y); elseif (t_1 <= -2e-221) tmp = Float64(y + x); elseif (t_1 <= 0.0) tmp = x; elseif (t_1 <= 1e+307) tmp = Float64(y + x); else tmp = Float64(Float64(Float64(z - a) * y) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_1 <= -Inf) tmp = (1.0 - (z / a)) * y; elseif (t_1 <= -2e-221) tmp = y + x; elseif (t_1 <= 0.0) tmp = x; elseif (t_1 <= 1e+307) tmp = y + x; else tmp = ((z - a) * y) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, -2e-221], N[(y + x), $MachinePrecision], If[LessEqual[t$95$1, 0.0], x, If[LessEqual[t$95$1, 1e+307], N[(y + x), $MachinePrecision], N[(N[(N[(z - a), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(1 - \frac{z}{a}\right) \cdot y\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-221}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 10^{+307}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(z - a\right) \cdot y}{t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 37.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate--l+N/A
lower-+.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f6460.7
Applied rewrites60.7%
Taylor expanded in t around 0
lower--.f64N/A
lower-/.f6445.7
Applied rewrites45.7%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -2.00000000000000003e-221 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 9.99999999999999986e306Initial program 97.8%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6479.3
Applied rewrites79.3%
if -2.00000000000000003e-221 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 11.3%
Taylor expanded in x around inf
Applied rewrites47.4%
if 9.99999999999999986e306 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 97.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate--l+N/A
lower-+.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f6438.2
Applied rewrites38.2%
Taylor expanded in t around -inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6413.0
Applied rewrites13.0%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.2e-80)
(+ y x)
(if (<= a -5e-225)
x
(if (<= a 1.52e-198)
(/ (* (- z a) y) t)
(if (<= a 2.25e-10) x (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e-80) {
tmp = y + x;
} else if (a <= -5e-225) {
tmp = x;
} else if (a <= 1.52e-198) {
tmp = ((z - a) * y) / t;
} else if (a <= 2.25e-10) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-3.2d-80)) then
tmp = y + x
else if (a <= (-5d-225)) then
tmp = x
else if (a <= 1.52d-198) then
tmp = ((z - a) * y) / t
else if (a <= 2.25d-10) then
tmp = x
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e-80) {
tmp = y + x;
} else if (a <= -5e-225) {
tmp = x;
} else if (a <= 1.52e-198) {
tmp = ((z - a) * y) / t;
} else if (a <= 2.25e-10) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.2e-80: tmp = y + x elif a <= -5e-225: tmp = x elif a <= 1.52e-198: tmp = ((z - a) * y) / t elif a <= 2.25e-10: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.2e-80) tmp = Float64(y + x); elseif (a <= -5e-225) tmp = x; elseif (a <= 1.52e-198) tmp = Float64(Float64(Float64(z - a) * y) / t); elseif (a <= 2.25e-10) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.2e-80) tmp = y + x; elseif (a <= -5e-225) tmp = x; elseif (a <= 1.52e-198) tmp = ((z - a) * y) / t; elseif (a <= 2.25e-10) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.2e-80], N[(y + x), $MachinePrecision], If[LessEqual[a, -5e-225], x, If[LessEqual[a, 1.52e-198], N[(N[(N[(z - a), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 2.25e-10], x, N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{-80}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq -5 \cdot 10^{-225}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.52 \cdot 10^{-198}:\\
\;\;\;\;\frac{\left(z - a\right) \cdot y}{t}\\
\mathbf{elif}\;a \leq 2.25 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -3.1999999999999999e-80 or 2.25e-10 < a Initial program 78.4%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6474.5
Applied rewrites74.5%
if -3.1999999999999999e-80 < a < -5.0000000000000001e-225 or 1.5199999999999999e-198 < a < 2.25e-10Initial program 75.2%
Taylor expanded in x around inf
Applied rewrites50.9%
if -5.0000000000000001e-225 < a < 1.5199999999999999e-198Initial program 71.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate--l+N/A
lower-+.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f6436.5
Applied rewrites36.5%
Taylor expanded in t around -inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6443.3
Applied rewrites43.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.2e-80)
(+ y x)
(if (<= a -4.8e-225)
x
(if (<= a 1.52e-198) (/ (* y z) t) (if (<= a 2.25e-10) x (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e-80) {
tmp = y + x;
} else if (a <= -4.8e-225) {
tmp = x;
} else if (a <= 1.52e-198) {
tmp = (y * z) / t;
} else if (a <= 2.25e-10) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-3.2d-80)) then
tmp = y + x
else if (a <= (-4.8d-225)) then
tmp = x
else if (a <= 1.52d-198) then
tmp = (y * z) / t
else if (a <= 2.25d-10) then
tmp = x
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e-80) {
tmp = y + x;
} else if (a <= -4.8e-225) {
tmp = x;
} else if (a <= 1.52e-198) {
tmp = (y * z) / t;
} else if (a <= 2.25e-10) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.2e-80: tmp = y + x elif a <= -4.8e-225: tmp = x elif a <= 1.52e-198: tmp = (y * z) / t elif a <= 2.25e-10: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.2e-80) tmp = Float64(y + x); elseif (a <= -4.8e-225) tmp = x; elseif (a <= 1.52e-198) tmp = Float64(Float64(y * z) / t); elseif (a <= 2.25e-10) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.2e-80) tmp = y + x; elseif (a <= -4.8e-225) tmp = x; elseif (a <= 1.52e-198) tmp = (y * z) / t; elseif (a <= 2.25e-10) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.2e-80], N[(y + x), $MachinePrecision], If[LessEqual[a, -4.8e-225], x, If[LessEqual[a, 1.52e-198], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 2.25e-10], x, N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{-80}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq -4.8 \cdot 10^{-225}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.52 \cdot 10^{-198}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{elif}\;a \leq 2.25 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -3.1999999999999999e-80 or 2.25e-10 < a Initial program 78.4%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6474.5
Applied rewrites74.5%
if -3.1999999999999999e-80 < a < -4.79999999999999992e-225 or 1.5199999999999999e-198 < a < 2.25e-10Initial program 75.2%
Taylor expanded in x around inf
Applied rewrites50.9%
if -4.79999999999999992e-225 < a < 1.5199999999999999e-198Initial program 71.3%
Taylor expanded in z around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f6445.1
Applied rewrites45.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f6441.3
Applied rewrites41.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -8.5e+185) x (if (<= t 8.8e+43) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.5e+185) {
tmp = x;
} else if (t <= 8.8e+43) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-8.5d+185)) then
tmp = x
else if (t <= 8.8d+43) then
tmp = y + x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.5e+185) {
tmp = x;
} else if (t <= 8.8e+43) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.5e+185: tmp = x elif t <= 8.8e+43: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.5e+185) tmp = x; elseif (t <= 8.8e+43) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.5e+185) tmp = x; elseif (t <= 8.8e+43) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.5e+185], x, If[LessEqual[t, 8.8e+43], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+185}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{+43}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -8.50000000000000013e185 or 8.80000000000000002e43 < t Initial program 55.2%
Taylor expanded in x around inf
Applied rewrites64.3%
if -8.50000000000000013e185 < t < 8.80000000000000002e43Initial program 86.4%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6462.7
Applied rewrites62.7%
(FPCore (x y z t a) :precision binary64 (if (<= x -4.5e-127) x (if (<= x 1.7e-91) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.5e-127) {
tmp = x;
} else if (x <= 1.7e-91) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-4.5d-127)) then
tmp = x
else if (x <= 1.7d-91) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.5e-127) {
tmp = x;
} else if (x <= 1.7e-91) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -4.5e-127: tmp = x elif x <= 1.7e-91: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -4.5e-127) tmp = x; elseif (x <= 1.7e-91) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -4.5e-127) tmp = x; elseif (x <= 1.7e-91) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -4.5e-127], x, If[LessEqual[x, 1.7e-91], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{-127}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-91}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.4999999999999999e-127 or 1.70000000000000013e-91 < x Initial program 80.3%
Taylor expanded in x around inf
Applied rewrites64.2%
if -4.4999999999999999e-127 < x < 1.70000000000000013e-91Initial program 68.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate--l+N/A
lower-+.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f6460.7
Applied rewrites60.7%
Taylor expanded in a around inf
Applied rewrites31.3%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 76.4%
Taylor expanded in x around inf
Applied rewrites50.9%
herbie shell --seed 2025120
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
(- (+ x y) (/ (* (- z t) y) (- a t))))