
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Initial program 96.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.8e+57)
(- x (* (/ (- y z) (- z)) a))
(if (<= z 2.1e+14)
(- x (* a (/ y (+ 1.0 t))))
(- x (/ (- y z) (/ (- z) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.8e+57) {
tmp = x - (((y - z) / -z) * a);
} else if (z <= 2.1e+14) {
tmp = x - (a * (y / (1.0 + t)));
} else {
tmp = x - ((y - z) / (-z / a));
}
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 (z <= (-5.8d+57)) then
tmp = x - (((y - z) / -z) * a)
else if (z <= 2.1d+14) then
tmp = x - (a * (y / (1.0d0 + t)))
else
tmp = x - ((y - z) / (-z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.8e+57) {
tmp = x - (((y - z) / -z) * a);
} else if (z <= 2.1e+14) {
tmp = x - (a * (y / (1.0 + t)));
} else {
tmp = x - ((y - z) / (-z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.8e+57: tmp = x - (((y - z) / -z) * a) elif z <= 2.1e+14: tmp = x - (a * (y / (1.0 + t))) else: tmp = x - ((y - z) / (-z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.8e+57) tmp = Float64(x - Float64(Float64(Float64(y - z) / Float64(-z)) * a)); elseif (z <= 2.1e+14) tmp = Float64(x - Float64(a * Float64(y / Float64(1.0 + t)))); else tmp = Float64(x - Float64(Float64(y - z) / Float64(Float64(-z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.8e+57) tmp = x - (((y - z) / -z) * a); elseif (z <= 2.1e+14) tmp = x - (a * (y / (1.0 + t))); else tmp = x - ((y - z) / (-z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.8e+57], N[(x - N[(N[(N[(y - z), $MachinePrecision] / (-z)), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e+14], N[(x - N[(a * N[(y / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - z), $MachinePrecision] / N[((-z) / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+57}:\\
\;\;\;\;x - \frac{y - z}{-z} \cdot a\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+14}:\\
\;\;\;\;x - a \cdot \frac{y}{1 + t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - z}{\frac{-z}{a}}\\
\end{array}
\end{array}
if z < -5.8000000000000003e57Initial program 94.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6484.8
Applied rewrites84.8%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6489.3
Applied rewrites89.3%
if -5.8000000000000003e57 < z < 2.1e14Initial program 99.0%
Taylor expanded in z around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6489.1
Applied rewrites89.1%
if 2.1e14 < z Initial program 94.6%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6483.5
Applied rewrites83.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* (/ (- y z) (- z)) a))))
(if (<= z -5.8e+57)
t_1
(if (<= z 2.1e+14) (- x (* a (/ y (+ 1.0 t)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (((y - z) / -z) * a);
double tmp;
if (z <= -5.8e+57) {
tmp = t_1;
} else if (z <= 2.1e+14) {
tmp = x - (a * (y / (1.0 + t)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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) / -z) * a)
if (z <= (-5.8d+57)) then
tmp = t_1
else if (z <= 2.1d+14) then
tmp = x - (a * (y / (1.0d0 + t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (((y - z) / -z) * a);
double tmp;
if (z <= -5.8e+57) {
tmp = t_1;
} else if (z <= 2.1e+14) {
tmp = x - (a * (y / (1.0 + t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (((y - z) / -z) * a) tmp = 0 if z <= -5.8e+57: tmp = t_1 elif z <= 2.1e+14: tmp = x - (a * (y / (1.0 + t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(Float64(y - z) / Float64(-z)) * a)) tmp = 0.0 if (z <= -5.8e+57) tmp = t_1; elseif (z <= 2.1e+14) tmp = Float64(x - Float64(a * Float64(y / Float64(1.0 + t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (((y - z) / -z) * a); tmp = 0.0; if (z <= -5.8e+57) tmp = t_1; elseif (z <= 2.1e+14) tmp = x - (a * (y / (1.0 + t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(N[(y - z), $MachinePrecision] / (-z)), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e+57], t$95$1, If[LessEqual[z, 2.1e+14], N[(x - N[(a * N[(y / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{y - z}{-z} \cdot a\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+14}:\\
\;\;\;\;x - a \cdot \frac{y}{1 + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.8000000000000003e57 or 2.1e14 < z Initial program 94.3%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6484.1
Applied rewrites84.1%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6488.3
Applied rewrites88.3%
if -5.8000000000000003e57 < z < 2.1e14Initial program 99.0%
Taylor expanded in z around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6489.1
Applied rewrites89.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.2e+84) (- x a) (if (<= z 3.6e+15) (- x (* a (/ y (+ 1.0 t)))) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e+84) {
tmp = x - a;
} else if (z <= 3.6e+15) {
tmp = x - (a * (y / (1.0 + t)));
} else {
tmp = x - a;
}
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 (z <= (-1.2d+84)) then
tmp = x - a
else if (z <= 3.6d+15) then
tmp = x - (a * (y / (1.0d0 + t)))
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e+84) {
tmp = x - a;
} else if (z <= 3.6e+15) {
tmp = x - (a * (y / (1.0 + t)));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.2e+84: tmp = x - a elif z <= 3.6e+15: tmp = x - (a * (y / (1.0 + t))) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.2e+84) tmp = Float64(x - a); elseif (z <= 3.6e+15) tmp = Float64(x - Float64(a * Float64(y / Float64(1.0 + t)))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.2e+84) tmp = x - a; elseif (z <= 3.6e+15) tmp = x - (a * (y / (1.0 + t))); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.2e+84], N[(x - a), $MachinePrecision], If[LessEqual[z, 3.6e+15], N[(x - N[(a * N[(y / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+84}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+15}:\\
\;\;\;\;x - a \cdot \frac{y}{1 + t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.2e84 or 3.6e15 < z Initial program 94.0%
Taylor expanded in z around inf
Applied rewrites79.5%
if -1.2e84 < z < 3.6e15Initial program 99.0%
Taylor expanded in z around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6487.8
Applied rewrites87.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (* (/ (- y z) t) a)))) (if (<= t -2e+15) t_1 (if (<= t 7.5e+26) (- x (* (/ y (- 1.0 z)) a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (((y - z) / t) * a);
double tmp;
if (t <= -2e+15) {
tmp = t_1;
} else if (t <= 7.5e+26) {
tmp = x - ((y / (1.0 - z)) * a);
} 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) / t) * a)
if (t <= (-2d+15)) then
tmp = t_1
else if (t <= 7.5d+26) then
tmp = x - ((y / (1.0d0 - z)) * a)
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) / t) * a);
double tmp;
if (t <= -2e+15) {
tmp = t_1;
} else if (t <= 7.5e+26) {
tmp = x - ((y / (1.0 - z)) * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (((y - z) / t) * a) tmp = 0 if t <= -2e+15: tmp = t_1 elif t <= 7.5e+26: tmp = x - ((y / (1.0 - z)) * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(Float64(y - z) / t) * a)) tmp = 0.0 if (t <= -2e+15) tmp = t_1; elseif (t <= 7.5e+26) tmp = Float64(x - Float64(Float64(y / Float64(1.0 - z)) * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (((y - z) / t) * a); tmp = 0.0; if (t <= -2e+15) tmp = t_1; elseif (t <= 7.5e+26) tmp = x - ((y / (1.0 - z)) * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e+15], t$95$1, If[LessEqual[t, 7.5e+26], N[(x - N[(N[(y / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{y - z}{t} \cdot a\\
\mathbf{if}\;t \leq -2 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+26}:\\
\;\;\;\;x - \frac{y}{1 - z} \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2e15 or 7.49999999999999941e26 < t Initial program 96.3%
Taylor expanded in t around inf
Applied rewrites82.7%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6483.4
Applied rewrites83.4%
if -2e15 < t < 7.49999999999999941e26Initial program 97.4%
Taylor expanded in t around inf
Applied rewrites28.7%
Taylor expanded in y around inf
Applied rewrites37.0%
Taylor expanded in t around 0
lower--.f6475.1
Applied rewrites75.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6475.6
Applied rewrites75.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -0.0032) (- x (/ y (/ t a))) (if (<= t 7.5e+26) (- x (* (/ y (- 1.0 z)) a)) (- x (* (/ y t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -0.0032) {
tmp = x - (y / (t / a));
} else if (t <= 7.5e+26) {
tmp = x - ((y / (1.0 - z)) * a);
} else {
tmp = x - ((y / t) * a);
}
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 <= (-0.0032d0)) then
tmp = x - (y / (t / a))
else if (t <= 7.5d+26) then
tmp = x - ((y / (1.0d0 - z)) * a)
else
tmp = x - ((y / t) * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -0.0032) {
tmp = x - (y / (t / a));
} else if (t <= 7.5e+26) {
tmp = x - ((y / (1.0 - z)) * a);
} else {
tmp = x - ((y / t) * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -0.0032: tmp = x - (y / (t / a)) elif t <= 7.5e+26: tmp = x - ((y / (1.0 - z)) * a) else: tmp = x - ((y / t) * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -0.0032) tmp = Float64(x - Float64(y / Float64(t / a))); elseif (t <= 7.5e+26) tmp = Float64(x - Float64(Float64(y / Float64(1.0 - z)) * a)); else tmp = Float64(x - Float64(Float64(y / t) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -0.0032) tmp = x - (y / (t / a)); elseif (t <= 7.5e+26) tmp = x - ((y / (1.0 - z)) * a); else tmp = x - ((y / t) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -0.0032], N[(x - N[(y / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e+26], N[(x - N[(N[(y / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0032:\\
\;\;\;\;x - \frac{y}{\frac{t}{a}}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+26}:\\
\;\;\;\;x - \frac{y}{1 - z} \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t} \cdot a\\
\end{array}
\end{array}
if t < -0.00320000000000000015Initial program 96.0%
Taylor expanded in t around inf
Applied rewrites81.0%
Taylor expanded in y around inf
Applied rewrites74.9%
if -0.00320000000000000015 < t < 7.49999999999999941e26Initial program 97.4%
Taylor expanded in t around inf
Applied rewrites27.9%
Taylor expanded in y around inf
Applied rewrites36.3%
Taylor expanded in t around 0
lower--.f6475.7
Applied rewrites75.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6476.3
Applied rewrites76.3%
if 7.49999999999999941e26 < t Initial program 96.8%
Taylor expanded in t around inf
Applied rewrites82.8%
Taylor expanded in y around inf
Applied rewrites77.9%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6478.5
Applied rewrites78.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -0.0032) (- x (/ y (/ t a))) (if (<= t 1.0) (- x (* a y)) (- x (* (/ y t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -0.0032) {
tmp = x - (y / (t / a));
} else if (t <= 1.0) {
tmp = x - (a * y);
} else {
tmp = x - ((y / t) * a);
}
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 <= (-0.0032d0)) then
tmp = x - (y / (t / a))
else if (t <= 1.0d0) then
tmp = x - (a * y)
else
tmp = x - ((y / t) * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -0.0032) {
tmp = x - (y / (t / a));
} else if (t <= 1.0) {
tmp = x - (a * y);
} else {
tmp = x - ((y / t) * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -0.0032: tmp = x - (y / (t / a)) elif t <= 1.0: tmp = x - (a * y) else: tmp = x - ((y / t) * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -0.0032) tmp = Float64(x - Float64(y / Float64(t / a))); elseif (t <= 1.0) tmp = Float64(x - Float64(a * y)); else tmp = Float64(x - Float64(Float64(y / t) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -0.0032) tmp = x - (y / (t / a)); elseif (t <= 1.0) tmp = x - (a * y); else tmp = x - ((y / t) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -0.0032], N[(x - N[(y / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.0], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0032:\\
\;\;\;\;x - \frac{y}{\frac{t}{a}}\\
\mathbf{elif}\;t \leq 1:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t} \cdot a\\
\end{array}
\end{array}
if t < -0.00320000000000000015Initial program 96.0%
Taylor expanded in t around inf
Applied rewrites81.0%
Taylor expanded in y around inf
Applied rewrites74.9%
if -0.00320000000000000015 < t < 1Initial program 97.4%
Taylor expanded in z around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6467.3
Applied rewrites67.3%
Taylor expanded in t around 0
Applied rewrites67.2%
if 1 < t Initial program 96.7%
Taylor expanded in t around inf
Applied rewrites80.9%
Taylor expanded in y around inf
Applied rewrites76.3%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6476.8
Applied rewrites76.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (* (/ y t) a)))) (if (<= t -0.0032) t_1 (if (<= t 1.0) (- x (* a y)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((y / t) * a);
double tmp;
if (t <= -0.0032) {
tmp = t_1;
} else if (t <= 1.0) {
tmp = x - (a * 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)
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 / t) * a)
if (t <= (-0.0032d0)) then
tmp = t_1
else if (t <= 1.0d0) then
tmp = x - (a * 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 t_1 = x - ((y / t) * a);
double tmp;
if (t <= -0.0032) {
tmp = t_1;
} else if (t <= 1.0) {
tmp = x - (a * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((y / t) * a) tmp = 0 if t <= -0.0032: tmp = t_1 elif t <= 1.0: tmp = x - (a * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(y / t) * a)) tmp = 0.0 if (t <= -0.0032) tmp = t_1; elseif (t <= 1.0) tmp = Float64(x - Float64(a * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((y / t) * a); tmp = 0.0; if (t <= -0.0032) tmp = t_1; elseif (t <= 1.0) tmp = x - (a * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(y / t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -0.0032], t$95$1, If[LessEqual[t, 1.0], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{y}{t} \cdot a\\
\mathbf{if}\;t \leq -0.0032:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -0.00320000000000000015 or 1 < t Initial program 96.4%
Taylor expanded in t around inf
Applied rewrites81.0%
Taylor expanded in y around inf
Applied rewrites75.6%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6476.5
Applied rewrites76.5%
if -0.00320000000000000015 < t < 1Initial program 97.4%
Taylor expanded in z around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6467.3
Applied rewrites67.3%
Taylor expanded in t around 0
Applied rewrites67.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.3e+83) (- x a) (if (<= z 1.02e-100) (- x (* a y)) (if (<= z 4.2e+49) x (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.3e+83) {
tmp = x - a;
} else if (z <= 1.02e-100) {
tmp = x - (a * y);
} else if (z <= 4.2e+49) {
tmp = x;
} else {
tmp = x - a;
}
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 (z <= (-4.3d+83)) then
tmp = x - a
else if (z <= 1.02d-100) then
tmp = x - (a * y)
else if (z <= 4.2d+49) then
tmp = x
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.3e+83) {
tmp = x - a;
} else if (z <= 1.02e-100) {
tmp = x - (a * y);
} else if (z <= 4.2e+49) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.3e+83: tmp = x - a elif z <= 1.02e-100: tmp = x - (a * y) elif z <= 4.2e+49: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.3e+83) tmp = Float64(x - a); elseif (z <= 1.02e-100) tmp = Float64(x - Float64(a * y)); elseif (z <= 4.2e+49) tmp = x; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.3e+83) tmp = x - a; elseif (z <= 1.02e-100) tmp = x - (a * y); elseif (z <= 4.2e+49) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.3e+83], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.02e-100], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+49], x, N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+83}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-100}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+49}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.3e83 or 4.20000000000000022e49 < z Initial program 93.8%
Taylor expanded in z around inf
Applied rewrites80.8%
if -4.3e83 < z < 1.02e-100Initial program 98.9%
Taylor expanded in z around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6488.8
Applied rewrites88.8%
Taylor expanded in t around 0
Applied rewrites69.2%
if 1.02e-100 < z < 4.20000000000000022e49Initial program 99.2%
Taylor expanded in x around inf
Applied rewrites54.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -450000000.0) (- x a) (if (<= z 4.2e+49) x (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -450000000.0) {
tmp = x - a;
} else if (z <= 4.2e+49) {
tmp = x;
} else {
tmp = x - a;
}
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 (z <= (-450000000.0d0)) then
tmp = x - a
else if (z <= 4.2d+49) then
tmp = x
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -450000000.0) {
tmp = x - a;
} else if (z <= 4.2e+49) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -450000000.0: tmp = x - a elif z <= 4.2e+49: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -450000000.0) tmp = Float64(x - a); elseif (z <= 4.2e+49) tmp = x; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -450000000.0) tmp = x - a; elseif (z <= 4.2e+49) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -450000000.0], N[(x - a), $MachinePrecision], If[LessEqual[z, 4.2e+49], x, N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -450000000:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+49}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.5e8 or 4.20000000000000022e49 < z Initial program 94.5%
Taylor expanded in z around inf
Applied rewrites78.0%
if -4.5e8 < z < 4.20000000000000022e49Initial program 99.0%
Taylor expanded in x around inf
Applied rewrites57.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 96.9%
Taylor expanded in x around inf
Applied rewrites54.1%
herbie shell --seed 2025112
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))