
(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 16 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 (* y (* -1.0 (/ (- a z) t))))))
(if (<= t -9.5e+187)
t_1
(if (<= t 1.45e+190)
(+ x (* y (- (+ 1.0 (/ t (- a t))) (/ z (- a t)))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (-1.0 * ((a - z) / t)));
double tmp;
if (t <= -9.5e+187) {
tmp = t_1;
} else if (t <= 1.45e+190) {
tmp = x + (y * ((1.0 + (t / (a - t))) - (z / (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 * ((-1.0d0) * ((a - z) / t)))
if (t <= (-9.5d+187)) then
tmp = t_1
else if (t <= 1.45d+190) then
tmp = x + (y * ((1.0d0 + (t / (a - t))) - (z / (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 * (-1.0 * ((a - z) / t)));
double tmp;
if (t <= -9.5e+187) {
tmp = t_1;
} else if (t <= 1.45e+190) {
tmp = x + (y * ((1.0 + (t / (a - t))) - (z / (a - t))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (-1.0 * ((a - z) / t))) tmp = 0 if t <= -9.5e+187: tmp = t_1 elif t <= 1.45e+190: tmp = x + (y * ((1.0 + (t / (a - t))) - (z / (a - t)))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(-1.0 * Float64(Float64(a - z) / t)))) tmp = 0.0 if (t <= -9.5e+187) tmp = t_1; elseif (t <= 1.45e+190) tmp = Float64(x + Float64(y * Float64(Float64(1.0 + Float64(t / Float64(a - t))) - Float64(z / Float64(a - t))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (-1.0 * ((a - z) / t))); tmp = 0.0; if (t <= -9.5e+187) tmp = t_1; elseif (t <= 1.45e+190) tmp = x + (y * ((1.0 + (t / (a - t))) - (z / (a - t)))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(-1.0 * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.5e+187], t$95$1, If[LessEqual[t, 1.45e+190], N[(x + N[(y * N[(N[(1.0 + N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(-1 \cdot \frac{a - z}{t}\right)\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{+187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{+190}:\\
\;\;\;\;x + y \cdot \left(\left(1 + \frac{t}{a - t}\right) - \frac{z}{a - t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.4999999999999996e187 or 1.44999999999999995e190 < t Initial program 76.8%
Taylor expanded in y around 0
Applied rewrites93.6%
Taylor expanded in t around -inf
Applied rewrites60.2%
if -9.4999999999999996e187 < t < 1.44999999999999995e190Initial program 76.8%
Taylor expanded in y around 0
Applied rewrites93.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (* -1.0 (/ (- a z) t))))))
(if (<= t -2.3e+57)
t_1
(if (<= t 8.2e+164) (- (+ x y) (* (/ (- z t) (- a t)) y)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (-1.0 * ((a - z) / t)));
double tmp;
if (t <= -2.3e+57) {
tmp = t_1;
} else if (t <= 8.2e+164) {
tmp = (x + y) - (((z - t) / (a - t)) * 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 * ((-1.0d0) * ((a - z) / t)))
if (t <= (-2.3d+57)) then
tmp = t_1
else if (t <= 8.2d+164) then
tmp = (x + y) - (((z - t) / (a - t)) * 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 * (-1.0 * ((a - z) / t)));
double tmp;
if (t <= -2.3e+57) {
tmp = t_1;
} else if (t <= 8.2e+164) {
tmp = (x + y) - (((z - t) / (a - t)) * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (-1.0 * ((a - z) / t))) tmp = 0 if t <= -2.3e+57: tmp = t_1 elif t <= 8.2e+164: tmp = (x + y) - (((z - t) / (a - t)) * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(-1.0 * Float64(Float64(a - z) / t)))) tmp = 0.0 if (t <= -2.3e+57) tmp = t_1; elseif (t <= 8.2e+164) tmp = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) / Float64(a - t)) * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (-1.0 * ((a - z) / t))); tmp = 0.0; if (t <= -2.3e+57) tmp = t_1; elseif (t <= 8.2e+164) tmp = (x + y) - (((z - t) / (a - t)) * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(-1.0 * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.3e+57], t$95$1, If[LessEqual[t, 8.2e+164], N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(-1 \cdot \frac{a - z}{t}\right)\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{+164}:\\
\;\;\;\;\left(x + y\right) - \frac{z - t}{a - t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.2999999999999999e57 or 8.20000000000000032e164 < t Initial program 76.8%
Taylor expanded in y around 0
Applied rewrites93.6%
Taylor expanded in t around -inf
Applied rewrites60.2%
if -2.2999999999999999e57 < t < 8.20000000000000032e164Initial program 76.8%
Applied rewrites83.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (* -1.0 (/ (- a z) t))))))
(if (<= t -2.3e+57)
t_1
(if (<= t 8.2e+164) (- (+ x y) (* (/ y (- a t)) (- z t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (-1.0 * ((a - z) / t)));
double tmp;
if (t <= -2.3e+57) {
tmp = t_1;
} else if (t <= 8.2e+164) {
tmp = (x + y) - ((y / (a - t)) * (z - t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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 * ((-1.0d0) * ((a - z) / t)))
if (t <= (-2.3d+57)) then
tmp = t_1
else if (t <= 8.2d+164) then
tmp = (x + y) - ((y / (a - t)) * (z - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (-1.0 * ((a - z) / t)));
double tmp;
if (t <= -2.3e+57) {
tmp = t_1;
} else if (t <= 8.2e+164) {
tmp = (x + y) - ((y / (a - t)) * (z - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (-1.0 * ((a - z) / t))) tmp = 0 if t <= -2.3e+57: tmp = t_1 elif t <= 8.2e+164: tmp = (x + y) - ((y / (a - t)) * (z - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(-1.0 * Float64(Float64(a - z) / t)))) tmp = 0.0 if (t <= -2.3e+57) tmp = t_1; elseif (t <= 8.2e+164) tmp = Float64(Float64(x + y) - Float64(Float64(y / Float64(a - t)) * Float64(z - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (-1.0 * ((a - z) / t))); tmp = 0.0; if (t <= -2.3e+57) tmp = t_1; elseif (t <= 8.2e+164) tmp = (x + y) - ((y / (a - t)) * (z - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(-1.0 * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.3e+57], t$95$1, If[LessEqual[t, 8.2e+164], N[(N[(x + y), $MachinePrecision] - N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(-1 \cdot \frac{a - z}{t}\right)\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{+164}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{a - t} \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.2999999999999999e57 or 8.20000000000000032e164 < t Initial program 76.8%
Taylor expanded in y around 0
Applied rewrites93.6%
Taylor expanded in t around -inf
Applied rewrites60.2%
if -2.2999999999999999e57 < t < 8.20000000000000032e164Initial program 76.8%
Applied rewrites83.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (* -1.0 (/ (- a z) t))))))
(if (<= t -1.6e-28)
t_1
(if (<= t 8.2e+164) (- (+ x y) (/ (* y z) (- a t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (-1.0 * ((a - z) / t)));
double tmp;
if (t <= -1.6e-28) {
tmp = t_1;
} else if (t <= 8.2e+164) {
tmp = (x + y) - ((y * z) / (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 * ((-1.0d0) * ((a - z) / t)))
if (t <= (-1.6d-28)) then
tmp = t_1
else if (t <= 8.2d+164) then
tmp = (x + y) - ((y * z) / (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 * (-1.0 * ((a - z) / t)));
double tmp;
if (t <= -1.6e-28) {
tmp = t_1;
} else if (t <= 8.2e+164) {
tmp = (x + y) - ((y * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (-1.0 * ((a - z) / t))) tmp = 0 if t <= -1.6e-28: tmp = t_1 elif t <= 8.2e+164: tmp = (x + y) - ((y * z) / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(-1.0 * Float64(Float64(a - z) / t)))) tmp = 0.0 if (t <= -1.6e-28) tmp = t_1; elseif (t <= 8.2e+164) tmp = Float64(Float64(x + y) - Float64(Float64(y * z) / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (-1.0 * ((a - z) / t))); tmp = 0.0; if (t <= -1.6e-28) tmp = t_1; elseif (t <= 8.2e+164) tmp = (x + y) - ((y * z) / (a - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(-1.0 * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e-28], t$95$1, If[LessEqual[t, 8.2e+164], N[(N[(x + y), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(-1 \cdot \frac{a - z}{t}\right)\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{+164}:\\
\;\;\;\;\left(x + y\right) - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.59999999999999991e-28 or 8.20000000000000032e164 < t Initial program 76.8%
Taylor expanded in y around 0
Applied rewrites93.6%
Taylor expanded in t around -inf
Applied rewrites60.2%
if -1.59999999999999991e-28 < t < 8.20000000000000032e164Initial program 76.8%
Taylor expanded in z around inf
Applied rewrites78.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- (- a z)) (/ y t)))))
(if (<= t -1.6e-28)
t_1
(if (<= t 3.7e+164) (- (+ x y) (/ (* y z) (- a t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (-(a - z) * (y / t));
double tmp;
if (t <= -1.6e-28) {
tmp = t_1;
} else if (t <= 3.7e+164) {
tmp = (x + y) - ((y * z) / (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 + (-(a - z) * (y / t))
if (t <= (-1.6d-28)) then
tmp = t_1
else if (t <= 3.7d+164) then
tmp = (x + y) - ((y * z) / (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 + (-(a - z) * (y / t));
double tmp;
if (t <= -1.6e-28) {
tmp = t_1;
} else if (t <= 3.7e+164) {
tmp = (x + y) - ((y * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (-(a - z) * (y / t)) tmp = 0 if t <= -1.6e-28: tmp = t_1 elif t <= 3.7e+164: tmp = (x + y) - ((y * z) / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(-Float64(a - z)) * Float64(y / t))) tmp = 0.0 if (t <= -1.6e-28) tmp = t_1; elseif (t <= 3.7e+164) tmp = Float64(Float64(x + y) - Float64(Float64(y * z) / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (-(a - z) * (y / t)); tmp = 0.0; if (t <= -1.6e-28) tmp = t_1; elseif (t <= 3.7e+164) tmp = (x + y) - ((y * z) / (a - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[((-N[(a - z), $MachinePrecision]) * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e-28], t$95$1, If[LessEqual[t, 3.7e+164], N[(N[(x + y), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(-\left(a - z\right)\right) \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+164}:\\
\;\;\;\;\left(x + y\right) - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.59999999999999991e-28 or 3.7000000000000001e164 < t Initial program 76.8%
Taylor expanded in y around 0
Applied rewrites93.6%
Taylor expanded in t around -inf
Applied rewrites57.6%
Applied rewrites60.7%
if -1.59999999999999991e-28 < t < 3.7000000000000001e164Initial program 76.8%
Taylor expanded in z around inf
Applied rewrites78.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (* (- (- a z)) (/ y t))))) (if (<= t -9.5e-30) t_1 (if (<= t 5.6e+16) (- (+ x y) (* (/ z a) y)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (-(a - z) * (y / t));
double tmp;
if (t <= -9.5e-30) {
tmp = t_1;
} else if (t <= 5.6e+16) {
tmp = (x + y) - ((z / 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 + (-(a - z) * (y / t))
if (t <= (-9.5d-30)) then
tmp = t_1
else if (t <= 5.6d+16) then
tmp = (x + y) - ((z / 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 + (-(a - z) * (y / t));
double tmp;
if (t <= -9.5e-30) {
tmp = t_1;
} else if (t <= 5.6e+16) {
tmp = (x + y) - ((z / a) * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (-(a - z) * (y / t)) tmp = 0 if t <= -9.5e-30: tmp = t_1 elif t <= 5.6e+16: tmp = (x + y) - ((z / a) * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(-Float64(a - z)) * Float64(y / t))) tmp = 0.0 if (t <= -9.5e-30) tmp = t_1; elseif (t <= 5.6e+16) tmp = Float64(Float64(x + y) - Float64(Float64(z / a) * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (-(a - z) * (y / t)); tmp = 0.0; if (t <= -9.5e-30) tmp = t_1; elseif (t <= 5.6e+16) tmp = (x + y) - ((z / 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[(a - z), $MachinePrecision]) * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.5e-30], t$95$1, If[LessEqual[t, 5.6e+16], N[(N[(x + y), $MachinePrecision] - N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(-\left(a - z\right)\right) \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+16}:\\
\;\;\;\;\left(x + y\right) - \frac{z}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.49999999999999939e-30 or 5.6e16 < t Initial program 76.8%
Taylor expanded in y around 0
Applied rewrites93.6%
Taylor expanded in t around -inf
Applied rewrites57.6%
Applied rewrites60.7%
if -9.49999999999999939e-30 < t < 5.6e16Initial program 76.8%
Taylor expanded in t around 0
Applied rewrites65.2%
Applied rewrites67.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- (+ x y) (* (/ z a) y)))) (if (<= a -3.25e-108) t_1 (if (<= a 1.45e-17) (+ x (* y (/ z t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((z / a) * y);
double tmp;
if (a <= -3.25e-108) {
tmp = t_1;
} else if (a <= 1.45e-17) {
tmp = x + (y * (z / t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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 / a) * y)
if (a <= (-3.25d-108)) then
tmp = t_1
else if (a <= 1.45d-17) then
tmp = x + (y * (z / t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((z / a) * y);
double tmp;
if (a <= -3.25e-108) {
tmp = t_1;
} else if (a <= 1.45e-17) {
tmp = x + (y * (z / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - ((z / a) * y) tmp = 0 if a <= -3.25e-108: tmp = t_1 elif a <= 1.45e-17: tmp = x + (y * (z / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(z / a) * y)) tmp = 0.0 if (a <= -3.25e-108) tmp = t_1; elseif (a <= 1.45e-17) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - ((z / a) * y); tmp = 0.0; if (a <= -3.25e-108) tmp = t_1; elseif (a <= 1.45e-17) tmp = x + (y * (z / 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[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.25e-108], t$95$1, If[LessEqual[a, 1.45e-17], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{z}{a} \cdot y\\
\mathbf{if}\;a \leq -3.25 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{-17}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.2500000000000001e-108 or 1.4500000000000001e-17 < a Initial program 76.8%
Taylor expanded in t around 0
Applied rewrites65.2%
Applied rewrites67.1%
if -3.2500000000000001e-108 < a < 1.4500000000000001e-17Initial program 76.8%
Taylor expanded in y around 0
Applied rewrites93.6%
Taylor expanded in a around 0
Applied rewrites61.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- (+ x y) (* (/ y a) z)))) (if (<= a -3.05e-108) t_1 (if (<= a 1.05e-17) (+ x (* y (/ z t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((y / a) * z);
double tmp;
if (a <= -3.05e-108) {
tmp = t_1;
} else if (a <= 1.05e-17) {
tmp = x + (y * (z / t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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) - ((y / a) * z)
if (a <= (-3.05d-108)) then
tmp = t_1
else if (a <= 1.05d-17) then
tmp = x + (y * (z / t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((y / a) * z);
double tmp;
if (a <= -3.05e-108) {
tmp = t_1;
} else if (a <= 1.05e-17) {
tmp = x + (y * (z / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - ((y / a) * z) tmp = 0 if a <= -3.05e-108: tmp = t_1 elif a <= 1.05e-17: tmp = x + (y * (z / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(y / a) * z)) tmp = 0.0 if (a <= -3.05e-108) tmp = t_1; elseif (a <= 1.05e-17) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - ((y / a) * z); tmp = 0.0; if (a <= -3.05e-108) tmp = t_1; elseif (a <= 1.05e-17) tmp = x + (y * (z / 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[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.05e-108], t$95$1, If[LessEqual[a, 1.05e-17], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{y}{a} \cdot z\\
\mathbf{if}\;a \leq -3.05 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-17}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.05000000000000004e-108 or 1.04999999999999996e-17 < a Initial program 76.8%
Taylor expanded in t around 0
Applied rewrites65.2%
Applied rewrites67.3%
if -3.05000000000000004e-108 < a < 1.04999999999999996e-17Initial program 76.8%
Taylor expanded in y around 0
Applied rewrites93.6%
Taylor expanded in a around 0
Applied rewrites61.3%
(FPCore (x y z t a) :precision binary64 (if (<= y -9e+133) (- y (* (/ y a) z)) (if (<= y 1.2e+224) (+ x (* (/ y t) z)) (- y (* (/ z a) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -9e+133) {
tmp = y - ((y / a) * z);
} else if (y <= 1.2e+224) {
tmp = x + ((y / t) * z);
} else {
tmp = y - ((z / a) * y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 (y <= (-9d+133)) then
tmp = y - ((y / a) * z)
else if (y <= 1.2d+224) then
tmp = x + ((y / t) * z)
else
tmp = y - ((z / a) * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -9e+133) {
tmp = y - ((y / a) * z);
} else if (y <= 1.2e+224) {
tmp = x + ((y / t) * z);
} else {
tmp = y - ((z / a) * y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -9e+133: tmp = y - ((y / a) * z) elif y <= 1.2e+224: tmp = x + ((y / t) * z) else: tmp = y - ((z / a) * y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -9e+133) tmp = Float64(y - Float64(Float64(y / a) * z)); elseif (y <= 1.2e+224) tmp = Float64(x + Float64(Float64(y / t) * z)); else tmp = Float64(y - Float64(Float64(z / a) * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -9e+133) tmp = y - ((y / a) * z); elseif (y <= 1.2e+224) tmp = x + ((y / t) * z); else tmp = y - ((z / a) * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -9e+133], N[(y - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+224], N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(y - N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+133}:\\
\;\;\;\;y - \frac{y}{a} \cdot z\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+224}:\\
\;\;\;\;x + \frac{y}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;y - \frac{z}{a} \cdot y\\
\end{array}
\end{array}
if y < -8.9999999999999997e133Initial program 76.8%
Taylor expanded in t around 0
Applied rewrites65.2%
Applied rewrites67.3%
Taylor expanded in x around 0
Applied rewrites31.6%
if -8.9999999999999997e133 < y < 1.2e224Initial program 76.8%
Taylor expanded in y around 0
Applied rewrites93.6%
Taylor expanded in a around 0
Applied rewrites59.9%
Applied rewrites61.2%
if 1.2e224 < y Initial program 76.8%
Taylor expanded in t around 0
Applied rewrites65.2%
Applied rewrites67.3%
Taylor expanded in x around 0
Applied rewrites31.6%
Applied rewrites31.9%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.52e+134) (- y (* (/ y a) z)) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.52e+134) {
tmp = y - ((y / a) * z);
} else {
tmp = x + (y * (z / t));
}
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 (y <= (-1.52d+134)) then
tmp = y - ((y / a) * z)
else
tmp = x + (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.52e+134) {
tmp = y - ((y / a) * z);
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.52e+134: tmp = y - ((y / a) * z) else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.52e+134) tmp = Float64(y - Float64(Float64(y / a) * z)); else tmp = Float64(x + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.52e+134) tmp = y - ((y / a) * z); else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.52e+134], N[(y - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.52 \cdot 10^{+134}:\\
\;\;\;\;y - \frac{y}{a} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if y < -1.5200000000000001e134Initial program 76.8%
Taylor expanded in t around 0
Applied rewrites65.2%
Applied rewrites67.3%
Taylor expanded in x around 0
Applied rewrites31.6%
if -1.5200000000000001e134 < y Initial program 76.8%
Taylor expanded in y around 0
Applied rewrites93.6%
Taylor expanded in a around 0
Applied rewrites61.3%
(FPCore (x y z t a) :precision binary64 (if (<= y -3e+112) (- y (* (/ y a) z)) (if (<= y 1.15e+26) (- (+ x y) (* 1.0 y)) (- y (* (/ z a) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3e+112) {
tmp = y - ((y / a) * z);
} else if (y <= 1.15e+26) {
tmp = (x + y) - (1.0 * y);
} else {
tmp = y - ((z / a) * y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 (y <= (-3d+112)) then
tmp = y - ((y / a) * z)
else if (y <= 1.15d+26) then
tmp = (x + y) - (1.0d0 * y)
else
tmp = y - ((z / a) * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3e+112) {
tmp = y - ((y / a) * z);
} else if (y <= 1.15e+26) {
tmp = (x + y) - (1.0 * y);
} else {
tmp = y - ((z / a) * y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3e+112: tmp = y - ((y / a) * z) elif y <= 1.15e+26: tmp = (x + y) - (1.0 * y) else: tmp = y - ((z / a) * y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3e+112) tmp = Float64(y - Float64(Float64(y / a) * z)); elseif (y <= 1.15e+26) tmp = Float64(Float64(x + y) - Float64(1.0 * y)); else tmp = Float64(y - Float64(Float64(z / a) * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3e+112) tmp = y - ((y / a) * z); elseif (y <= 1.15e+26) tmp = (x + y) - (1.0 * y); else tmp = y - ((z / a) * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3e+112], N[(y - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+26], N[(N[(x + y), $MachinePrecision] - N[(1.0 * y), $MachinePrecision]), $MachinePrecision], N[(y - N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+112}:\\
\;\;\;\;y - \frac{y}{a} \cdot z\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+26}:\\
\;\;\;\;\left(x + y\right) - 1 \cdot y\\
\mathbf{else}:\\
\;\;\;\;y - \frac{z}{a} \cdot y\\
\end{array}
\end{array}
if y < -2.99999999999999979e112Initial program 76.8%
Taylor expanded in t around 0
Applied rewrites65.2%
Applied rewrites67.3%
Taylor expanded in x around 0
Applied rewrites31.6%
if -2.99999999999999979e112 < y < 1.15e26Initial program 76.8%
Applied rewrites83.5%
Applied rewrites75.9%
Taylor expanded in t around inf
Applied rewrites44.3%
if 1.15e26 < y Initial program 76.8%
Taylor expanded in t around 0
Applied rewrites65.2%
Applied rewrites67.3%
Taylor expanded in x around 0
Applied rewrites31.6%
Applied rewrites31.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- y (* (/ y a) z)))) (if (<= y -3e+112) t_1 (if (<= y 1.15e+26) (- (+ x y) (* 1.0 y)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y - ((y / a) * z);
double tmp;
if (y <= -3e+112) {
tmp = t_1;
} else if (y <= 1.15e+26) {
tmp = (x + y) - (1.0 * 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 = y - ((y / a) * z)
if (y <= (-3d+112)) then
tmp = t_1
else if (y <= 1.15d+26) then
tmp = (x + y) - (1.0d0 * 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 = y - ((y / a) * z);
double tmp;
if (y <= -3e+112) {
tmp = t_1;
} else if (y <= 1.15e+26) {
tmp = (x + y) - (1.0 * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y - ((y / a) * z) tmp = 0 if y <= -3e+112: tmp = t_1 elif y <= 1.15e+26: tmp = (x + y) - (1.0 * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y - Float64(Float64(y / a) * z)) tmp = 0.0 if (y <= -3e+112) tmp = t_1; elseif (y <= 1.15e+26) tmp = Float64(Float64(x + y) - Float64(1.0 * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y - ((y / a) * z); tmp = 0.0; if (y <= -3e+112) tmp = t_1; elseif (y <= 1.15e+26) tmp = (x + y) - (1.0 * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3e+112], t$95$1, If[LessEqual[y, 1.15e+26], N[(N[(x + y), $MachinePrecision] - N[(1.0 * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \frac{y}{a} \cdot z\\
\mathbf{if}\;y \leq -3 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+26}:\\
\;\;\;\;\left(x + y\right) - 1 \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.99999999999999979e112 or 1.15e26 < y Initial program 76.8%
Taylor expanded in t around 0
Applied rewrites65.2%
Applied rewrites67.3%
Taylor expanded in x around 0
Applied rewrites31.6%
if -2.99999999999999979e112 < y < 1.15e26Initial program 76.8%
Applied rewrites83.5%
Applied rewrites75.9%
Taylor expanded in t around inf
Applied rewrites44.3%
(FPCore (x y z t a) :precision binary64 (if (<= y -6e+172) (* (/ z a) (- y)) (if (<= y 8.6e+170) (- (+ x y) (* 1.0 y)) (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -6e+172) {
tmp = (z / a) * -y;
} else if (y <= 8.6e+170) {
tmp = (x + y) - (1.0 * y);
} else {
tmp = (y * z) / t;
}
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 (y <= (-6d+172)) then
tmp = (z / a) * -y
else if (y <= 8.6d+170) then
tmp = (x + y) - (1.0d0 * y)
else
tmp = (y * z) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -6e+172) {
tmp = (z / a) * -y;
} else if (y <= 8.6e+170) {
tmp = (x + y) - (1.0 * y);
} else {
tmp = (y * z) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -6e+172: tmp = (z / a) * -y elif y <= 8.6e+170: tmp = (x + y) - (1.0 * y) else: tmp = (y * z) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -6e+172) tmp = Float64(Float64(z / a) * Float64(-y)); elseif (y <= 8.6e+170) tmp = Float64(Float64(x + y) - Float64(1.0 * y)); else tmp = Float64(Float64(y * z) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -6e+172) tmp = (z / a) * -y; elseif (y <= 8.6e+170) tmp = (x + y) - (1.0 * y); else tmp = (y * z) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -6e+172], N[(N[(z / a), $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[y, 8.6e+170], N[(N[(x + y), $MachinePrecision] - N[(1.0 * y), $MachinePrecision]), $MachinePrecision], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+172}:\\
\;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{+170}:\\
\;\;\;\;\left(x + y\right) - 1 \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\end{array}
\end{array}
if y < -5.9999999999999998e172Initial program 76.8%
Taylor expanded in z around inf
Applied rewrites26.7%
Taylor expanded in t around 0
Applied rewrites15.2%
Applied rewrites15.9%
if -5.9999999999999998e172 < y < 8.5999999999999997e170Initial program 76.8%
Applied rewrites83.5%
Applied rewrites75.9%
Taylor expanded in t around inf
Applied rewrites44.3%
if 8.5999999999999997e170 < y Initial program 76.8%
Taylor expanded in z around inf
Applied rewrites26.7%
Taylor expanded in t around 0
Applied rewrites15.2%
Taylor expanded in t around inf
Applied rewrites18.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.6e+119) (* (/ y a) (- z)) (/ (* y z) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.6e+119) {
tmp = (y / a) * -z;
} else {
tmp = (y * z) / t;
}
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 (y <= (-4.6d+119)) then
tmp = (y / a) * -z
else
tmp = (y * z) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.6e+119) {
tmp = (y / a) * -z;
} else {
tmp = (y * z) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.6e+119: tmp = (y / a) * -z else: tmp = (y * z) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.6e+119) tmp = Float64(Float64(y / a) * Float64(-z)); else tmp = Float64(Float64(y * z) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.6e+119) tmp = (y / a) * -z; else tmp = (y * z) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.6e+119], N[(N[(y / a), $MachinePrecision] * (-z)), $MachinePrecision], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+119}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\end{array}
\end{array}
if y < -4.6000000000000001e119Initial program 76.8%
Taylor expanded in z around inf
Applied rewrites26.7%
Taylor expanded in t around 0
Applied rewrites15.2%
Applied rewrites16.0%
if -4.6000000000000001e119 < y Initial program 76.8%
Taylor expanded in z around inf
Applied rewrites26.7%
Taylor expanded in t around 0
Applied rewrites15.2%
Taylor expanded in t around inf
Applied rewrites18.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.6e+119) (- (/ (* y z) a)) (/ (* y z) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.6e+119) {
tmp = -((y * z) / a);
} else {
tmp = (y * z) / t;
}
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 (y <= (-4.6d+119)) then
tmp = -((y * z) / a)
else
tmp = (y * z) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.6e+119) {
tmp = -((y * z) / a);
} else {
tmp = (y * z) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.6e+119: tmp = -((y * z) / a) else: tmp = (y * z) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.6e+119) tmp = Float64(-Float64(Float64(y * z) / a)); else tmp = Float64(Float64(y * z) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.6e+119) tmp = -((y * z) / a); else tmp = (y * z) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.6e+119], (-N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+119}:\\
\;\;\;\;-\frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\end{array}
\end{array}
if y < -4.6000000000000001e119Initial program 76.8%
Taylor expanded in z around inf
Applied rewrites26.7%
Taylor expanded in t around 0
Applied rewrites15.2%
Applied rewrites15.2%
if -4.6000000000000001e119 < y Initial program 76.8%
Taylor expanded in z around inf
Applied rewrites26.7%
Taylor expanded in t around 0
Applied rewrites15.2%
Taylor expanded in t around inf
Applied rewrites18.7%
(FPCore (x y z t a) :precision binary64 (/ (* y z) t))
double code(double x, double y, double z, double t, double a) {
return (y * z) / 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 = (y * z) / t
end function
public static double code(double x, double y, double z, double t, double a) {
return (y * z) / t;
}
def code(x, y, z, t, a): return (y * z) / t
function code(x, y, z, t, a) return Float64(Float64(y * z) / t) end
function tmp = code(x, y, z, t, a) tmp = (y * z) / t; end
code[x_, y_, z_, t_, a_] := N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{y \cdot z}{t}
\end{array}
Initial program 76.8%
Taylor expanded in z around inf
Applied rewrites26.7%
Taylor expanded in t around 0
Applied rewrites15.2%
Taylor expanded in t around inf
Applied rewrites18.7%
herbie shell --seed 2025159
(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))))