
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
(FPCore (u v t1) :precision binary64 (/ (* (/ t1 (- (- t1) u)) v) (+ u t1)))
double code(double u, double v, double t1) {
return ((t1 / (-t1 - u)) * v) / (u + t1);
}
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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = ((t1 / (-t1 - u)) * v) / (u + t1)
end function
public static double code(double u, double v, double t1) {
return ((t1 / (-t1 - u)) * v) / (u + t1);
}
def code(u, v, t1): return ((t1 / (-t1 - u)) * v) / (u + t1)
function code(u, v, t1) return Float64(Float64(Float64(t1 / Float64(Float64(-t1) - u)) * v) / Float64(u + t1)) end
function tmp = code(u, v, t1) tmp = ((t1 / (-t1 - u)) * v) / (u + t1); end
code[u_, v_, t1_] := N[(N[(N[(t1 / N[((-t1) - u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t1}{\left(-t1\right) - u} \cdot v}{u + t1}
\end{array}
Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
(FPCore (u v t1) :precision binary64 (* (/ v (- (- t1) u)) (/ t1 (+ u t1))))
double code(double u, double v, double t1) {
return (v / (-t1 - u)) * (t1 / (u + t1));
}
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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (v / (-t1 - u)) * (t1 / (u + t1))
end function
public static double code(double u, double v, double t1) {
return (v / (-t1 - u)) * (t1 / (u + t1));
}
def code(u, v, t1): return (v / (-t1 - u)) * (t1 / (u + t1))
function code(u, v, t1) return Float64(Float64(v / Float64(Float64(-t1) - u)) * Float64(t1 / Float64(u + t1))) end
function tmp = code(u, v, t1) tmp = (v / (-t1 - u)) * (t1 / (u + t1)); end
code[u_, v_, t1_] := N[(N[(v / N[((-t1) - u), $MachinePrecision]), $MachinePrecision] * N[(t1 / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{\left(-t1\right) - u} \cdot \frac{t1}{u + t1}
\end{array}
Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lift-neg.f64N/A
add-flipN/A
lift-+.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6497.7
Applied rewrites97.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
mult-flip-revN/A
frac-timesN/A
*-commutativeN/A
frac-timesN/A
lower-*.f64N/A
Applied rewrites98.0%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* (/ t1 (* (- (- t1) u) (+ u t1))) v)))
(if (<= t1 -8.6e+145)
(/ (- v) t1)
(if (<= t1 -1.32e-145)
t_1
(if (<= t1 1.45e-175)
(/ (* (/ t1 (- u)) v) (+ u t1))
(if (<= t1 4e+155) t_1 (/ (* -1.0 v) (+ u t1))))))))
double code(double u, double v, double t1) {
double t_1 = (t1 / ((-t1 - u) * (u + t1))) * v;
double tmp;
if (t1 <= -8.6e+145) {
tmp = -v / t1;
} else if (t1 <= -1.32e-145) {
tmp = t_1;
} else if (t1 <= 1.45e-175) {
tmp = ((t1 / -u) * v) / (u + t1);
} else if (t1 <= 4e+155) {
tmp = t_1;
} else {
tmp = (-1.0 * v) / (u + t1);
}
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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = (t1 / ((-t1 - u) * (u + t1))) * v
if (t1 <= (-8.6d+145)) then
tmp = -v / t1
else if (t1 <= (-1.32d-145)) then
tmp = t_1
else if (t1 <= 1.45d-175) then
tmp = ((t1 / -u) * v) / (u + t1)
else if (t1 <= 4d+155) then
tmp = t_1
else
tmp = ((-1.0d0) * v) / (u + t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = (t1 / ((-t1 - u) * (u + t1))) * v;
double tmp;
if (t1 <= -8.6e+145) {
tmp = -v / t1;
} else if (t1 <= -1.32e-145) {
tmp = t_1;
} else if (t1 <= 1.45e-175) {
tmp = ((t1 / -u) * v) / (u + t1);
} else if (t1 <= 4e+155) {
tmp = t_1;
} else {
tmp = (-1.0 * v) / (u + t1);
}
return tmp;
}
def code(u, v, t1): t_1 = (t1 / ((-t1 - u) * (u + t1))) * v tmp = 0 if t1 <= -8.6e+145: tmp = -v / t1 elif t1 <= -1.32e-145: tmp = t_1 elif t1 <= 1.45e-175: tmp = ((t1 / -u) * v) / (u + t1) elif t1 <= 4e+155: tmp = t_1 else: tmp = (-1.0 * v) / (u + t1) return tmp
function code(u, v, t1) t_1 = Float64(Float64(t1 / Float64(Float64(Float64(-t1) - u) * Float64(u + t1))) * v) tmp = 0.0 if (t1 <= -8.6e+145) tmp = Float64(Float64(-v) / t1); elseif (t1 <= -1.32e-145) tmp = t_1; elseif (t1 <= 1.45e-175) tmp = Float64(Float64(Float64(t1 / Float64(-u)) * v) / Float64(u + t1)); elseif (t1 <= 4e+155) tmp = t_1; else tmp = Float64(Float64(-1.0 * v) / Float64(u + t1)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (t1 / ((-t1 - u) * (u + t1))) * v; tmp = 0.0; if (t1 <= -8.6e+145) tmp = -v / t1; elseif (t1 <= -1.32e-145) tmp = t_1; elseif (t1 <= 1.45e-175) tmp = ((t1 / -u) * v) / (u + t1); elseif (t1 <= 4e+155) tmp = t_1; else tmp = (-1.0 * v) / (u + t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(t1 / N[(N[((-t1) - u), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision]}, If[LessEqual[t1, -8.6e+145], N[((-v) / t1), $MachinePrecision], If[LessEqual[t1, -1.32e-145], t$95$1, If[LessEqual[t1, 1.45e-175], N[(N[(N[(t1 / (-u)), $MachinePrecision] * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 4e+155], t$95$1, N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t1}{\left(\left(-t1\right) - u\right) \cdot \left(u + t1\right)} \cdot v\\
\mathbf{if}\;t1 \leq -8.6 \cdot 10^{+145}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{elif}\;t1 \leq -1.32 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.45 \cdot 10^{-175}:\\
\;\;\;\;\frac{\frac{t1}{-u} \cdot v}{u + t1}\\
\mathbf{elif}\;t1 \leq 4 \cdot 10^{+155}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot v}{u + t1}\\
\end{array}
\end{array}
if t1 < -8.59999999999999996e145Initial program 71.2%
Taylor expanded in u around 0
lower-*.f64N/A
lower-/.f6453.2
Applied rewrites53.2%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6453.2
Applied rewrites53.2%
if -8.59999999999999996e145 < t1 < -1.32e-145 or 1.44999999999999999e-175 < t1 < 4.00000000000000003e155Initial program 71.2%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.7%
if -1.32e-145 < t1 < 1.44999999999999999e-175Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around inf
lower-*.f6452.2
Applied rewrites52.2%
lift-*.f64N/A
mul-1-negN/A
*-lft-identityN/A
metadata-evalN/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity52.2
Applied rewrites52.2%
if 4.00000000000000003e155 < t1 Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites60.7%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -7e-107)
(/ (* (/ t1 (- (- t1) u)) v) t1)
(if (<= t1 5.5e+58)
(/ (* (/ t1 (- u)) v) (+ u t1))
(/ (* -1.0 v) (+ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -7e-107) {
tmp = ((t1 / (-t1 - u)) * v) / t1;
} else if (t1 <= 5.5e+58) {
tmp = ((t1 / -u) * v) / (u + t1);
} else {
tmp = (-1.0 * v) / (u + t1);
}
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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (t1 <= (-7d-107)) then
tmp = ((t1 / (-t1 - u)) * v) / t1
else if (t1 <= 5.5d+58) then
tmp = ((t1 / -u) * v) / (u + t1)
else
tmp = ((-1.0d0) * v) / (u + t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -7e-107) {
tmp = ((t1 / (-t1 - u)) * v) / t1;
} else if (t1 <= 5.5e+58) {
tmp = ((t1 / -u) * v) / (u + t1);
} else {
tmp = (-1.0 * v) / (u + t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -7e-107: tmp = ((t1 / (-t1 - u)) * v) / t1 elif t1 <= 5.5e+58: tmp = ((t1 / -u) * v) / (u + t1) else: tmp = (-1.0 * v) / (u + t1) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -7e-107) tmp = Float64(Float64(Float64(t1 / Float64(Float64(-t1) - u)) * v) / t1); elseif (t1 <= 5.5e+58) tmp = Float64(Float64(Float64(t1 / Float64(-u)) * v) / Float64(u + t1)); else tmp = Float64(Float64(-1.0 * v) / Float64(u + t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -7e-107) tmp = ((t1 / (-t1 - u)) * v) / t1; elseif (t1 <= 5.5e+58) tmp = ((t1 / -u) * v) / (u + t1); else tmp = (-1.0 * v) / (u + t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -7e-107], N[(N[(N[(t1 / N[((-t1) - u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / t1), $MachinePrecision], If[LessEqual[t1, 5.5e+58], N[(N[(N[(t1 / (-u)), $MachinePrecision] * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7 \cdot 10^{-107}:\\
\;\;\;\;\frac{\frac{t1}{\left(-t1\right) - u} \cdot v}{t1}\\
\mathbf{elif}\;t1 \leq 5.5 \cdot 10^{+58}:\\
\;\;\;\;\frac{\frac{t1}{-u} \cdot v}{u + t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot v}{u + t1}\\
\end{array}
\end{array}
if t1 < -6.99999999999999971e-107Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites69.4%
if -6.99999999999999971e-107 < t1 < 5.4999999999999999e58Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around inf
lower-*.f6452.2
Applied rewrites52.2%
lift-*.f64N/A
mul-1-negN/A
*-lft-identityN/A
metadata-evalN/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity52.2
Applied rewrites52.2%
if 5.4999999999999999e58 < t1 Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites60.7%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ t1 (- (- t1) u))))
(if (<= t1 -7e-107)
(/ (* t_1 v) t1)
(if (<= t1 5.5e+58) (/ (* v t_1) (- (- u))) (/ (* -1.0 v) (+ u t1))))))
double code(double u, double v, double t1) {
double t_1 = t1 / (-t1 - u);
double tmp;
if (t1 <= -7e-107) {
tmp = (t_1 * v) / t1;
} else if (t1 <= 5.5e+58) {
tmp = (v * t_1) / -(-u);
} else {
tmp = (-1.0 * v) / (u + t1);
}
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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = t1 / (-t1 - u)
if (t1 <= (-7d-107)) then
tmp = (t_1 * v) / t1
else if (t1 <= 5.5d+58) then
tmp = (v * t_1) / -(-u)
else
tmp = ((-1.0d0) * v) / (u + t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = t1 / (-t1 - u);
double tmp;
if (t1 <= -7e-107) {
tmp = (t_1 * v) / t1;
} else if (t1 <= 5.5e+58) {
tmp = (v * t_1) / -(-u);
} else {
tmp = (-1.0 * v) / (u + t1);
}
return tmp;
}
def code(u, v, t1): t_1 = t1 / (-t1 - u) tmp = 0 if t1 <= -7e-107: tmp = (t_1 * v) / t1 elif t1 <= 5.5e+58: tmp = (v * t_1) / -(-u) else: tmp = (-1.0 * v) / (u + t1) return tmp
function code(u, v, t1) t_1 = Float64(t1 / Float64(Float64(-t1) - u)) tmp = 0.0 if (t1 <= -7e-107) tmp = Float64(Float64(t_1 * v) / t1); elseif (t1 <= 5.5e+58) tmp = Float64(Float64(v * t_1) / Float64(-Float64(-u))); else tmp = Float64(Float64(-1.0 * v) / Float64(u + t1)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = t1 / (-t1 - u); tmp = 0.0; if (t1 <= -7e-107) tmp = (t_1 * v) / t1; elseif (t1 <= 5.5e+58) tmp = (v * t_1) / -(-u); else tmp = (-1.0 * v) / (u + t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(t1 / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -7e-107], N[(N[(t$95$1 * v), $MachinePrecision] / t1), $MachinePrecision], If[LessEqual[t1, 5.5e+58], N[(N[(v * t$95$1), $MachinePrecision] / (-(-u))), $MachinePrecision], N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t1}{\left(-t1\right) - u}\\
\mathbf{if}\;t1 \leq -7 \cdot 10^{-107}:\\
\;\;\;\;\frac{t\_1 \cdot v}{t1}\\
\mathbf{elif}\;t1 \leq 5.5 \cdot 10^{+58}:\\
\;\;\;\;\frac{v \cdot t\_1}{-\left(-u\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot v}{u + t1}\\
\end{array}
\end{array}
if t1 < -6.99999999999999971e-107Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites69.4%
if -6.99999999999999971e-107 < t1 < 5.4999999999999999e58Initial program 71.2%
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6471.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6471.2
Applied rewrites71.2%
Taylor expanded in u around inf
lower-*.f6446.0
Applied rewrites46.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
frac-2negN/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites49.1%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lift-/.f64N/A
associate-*r/N/A
lift-neg.f64N/A
distribute-lft-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
remove-double-negN/A
Applied rewrites52.3%
if 5.4999999999999999e58 < t1 Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites60.7%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -7e-107)
(/ (* (/ t1 (- (- t1) u)) v) t1)
(if (<= t1 5.5e+58)
(* (/ v (- u)) (/ t1 (+ u t1)))
(/ (* -1.0 v) (+ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -7e-107) {
tmp = ((t1 / (-t1 - u)) * v) / t1;
} else if (t1 <= 5.5e+58) {
tmp = (v / -u) * (t1 / (u + t1));
} else {
tmp = (-1.0 * v) / (u + t1);
}
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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (t1 <= (-7d-107)) then
tmp = ((t1 / (-t1 - u)) * v) / t1
else if (t1 <= 5.5d+58) then
tmp = (v / -u) * (t1 / (u + t1))
else
tmp = ((-1.0d0) * v) / (u + t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -7e-107) {
tmp = ((t1 / (-t1 - u)) * v) / t1;
} else if (t1 <= 5.5e+58) {
tmp = (v / -u) * (t1 / (u + t1));
} else {
tmp = (-1.0 * v) / (u + t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -7e-107: tmp = ((t1 / (-t1 - u)) * v) / t1 elif t1 <= 5.5e+58: tmp = (v / -u) * (t1 / (u + t1)) else: tmp = (-1.0 * v) / (u + t1) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -7e-107) tmp = Float64(Float64(Float64(t1 / Float64(Float64(-t1) - u)) * v) / t1); elseif (t1 <= 5.5e+58) tmp = Float64(Float64(v / Float64(-u)) * Float64(t1 / Float64(u + t1))); else tmp = Float64(Float64(-1.0 * v) / Float64(u + t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -7e-107) tmp = ((t1 / (-t1 - u)) * v) / t1; elseif (t1 <= 5.5e+58) tmp = (v / -u) * (t1 / (u + t1)); else tmp = (-1.0 * v) / (u + t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -7e-107], N[(N[(N[(t1 / N[((-t1) - u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / t1), $MachinePrecision], If[LessEqual[t1, 5.5e+58], N[(N[(v / (-u)), $MachinePrecision] * N[(t1 / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7 \cdot 10^{-107}:\\
\;\;\;\;\frac{\frac{t1}{\left(-t1\right) - u} \cdot v}{t1}\\
\mathbf{elif}\;t1 \leq 5.5 \cdot 10^{+58}:\\
\;\;\;\;\frac{v}{-u} \cdot \frac{t1}{u + t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot v}{u + t1}\\
\end{array}
\end{array}
if t1 < -6.99999999999999971e-107Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites69.4%
if -6.99999999999999971e-107 < t1 < 5.4999999999999999e58Initial program 71.2%
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6471.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6471.2
Applied rewrites71.2%
Taylor expanded in u around inf
lower-*.f6446.0
Applied rewrites46.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
mul-1-negN/A
*-lft-identityN/A
metadata-evalN/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identityN/A
*-lft-identityN/A
Applied rewrites52.5%
if 5.4999999999999999e58 < t1 Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites60.7%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- (- t1) u)))
(if (<= t1 -7e-107)
(/ (* (/ t1 t_1) v) t1)
(if (<= t1 5.5e+58) (* (/ v t_1) (/ t1 u)) (/ (* -1.0 v) (+ u t1))))))
double code(double u, double v, double t1) {
double t_1 = -t1 - u;
double tmp;
if (t1 <= -7e-107) {
tmp = ((t1 / t_1) * v) / t1;
} else if (t1 <= 5.5e+58) {
tmp = (v / t_1) * (t1 / u);
} else {
tmp = (-1.0 * v) / (u + t1);
}
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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = -t1 - u
if (t1 <= (-7d-107)) then
tmp = ((t1 / t_1) * v) / t1
else if (t1 <= 5.5d+58) then
tmp = (v / t_1) * (t1 / u)
else
tmp = ((-1.0d0) * v) / (u + t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -t1 - u;
double tmp;
if (t1 <= -7e-107) {
tmp = ((t1 / t_1) * v) / t1;
} else if (t1 <= 5.5e+58) {
tmp = (v / t_1) * (t1 / u);
} else {
tmp = (-1.0 * v) / (u + t1);
}
return tmp;
}
def code(u, v, t1): t_1 = -t1 - u tmp = 0 if t1 <= -7e-107: tmp = ((t1 / t_1) * v) / t1 elif t1 <= 5.5e+58: tmp = (v / t_1) * (t1 / u) else: tmp = (-1.0 * v) / (u + t1) return tmp
function code(u, v, t1) t_1 = Float64(Float64(-t1) - u) tmp = 0.0 if (t1 <= -7e-107) tmp = Float64(Float64(Float64(t1 / t_1) * v) / t1); elseif (t1 <= 5.5e+58) tmp = Float64(Float64(v / t_1) * Float64(t1 / u)); else tmp = Float64(Float64(-1.0 * v) / Float64(u + t1)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -t1 - u; tmp = 0.0; if (t1 <= -7e-107) tmp = ((t1 / t_1) * v) / t1; elseif (t1 <= 5.5e+58) tmp = (v / t_1) * (t1 / u); else tmp = (-1.0 * v) / (u + t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-t1) - u), $MachinePrecision]}, If[LessEqual[t1, -7e-107], N[(N[(N[(t1 / t$95$1), $MachinePrecision] * v), $MachinePrecision] / t1), $MachinePrecision], If[LessEqual[t1, 5.5e+58], N[(N[(v / t$95$1), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-t1\right) - u\\
\mathbf{if}\;t1 \leq -7 \cdot 10^{-107}:\\
\;\;\;\;\frac{\frac{t1}{t\_1} \cdot v}{t1}\\
\mathbf{elif}\;t1 \leq 5.5 \cdot 10^{+58}:\\
\;\;\;\;\frac{v}{t\_1} \cdot \frac{t1}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot v}{u + t1}\\
\end{array}
\end{array}
if t1 < -6.99999999999999971e-107Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites69.4%
if -6.99999999999999971e-107 < t1 < 5.4999999999999999e58Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lift-neg.f64N/A
add-flipN/A
lift-+.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6497.7
Applied rewrites97.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
mult-flip-revN/A
frac-timesN/A
*-commutativeN/A
frac-timesN/A
lower-*.f64N/A
Applied rewrites98.0%
Taylor expanded in u around inf
lower-/.f6455.6
Applied rewrites55.6%
if 5.4999999999999999e58 < t1 Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites60.7%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* -1.0 v) (+ u t1))))
(if (<= t1 -3.2e-51)
t_1
(if (<= t1 5.5e+58) (* (/ v (- (- t1) u)) (/ t1 u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = (-1.0 * v) / (u + t1);
double tmp;
if (t1 <= -3.2e-51) {
tmp = t_1;
} else if (t1 <= 5.5e+58) {
tmp = (v / (-t1 - u)) * (t1 / u);
} 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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = ((-1.0d0) * v) / (u + t1)
if (t1 <= (-3.2d-51)) then
tmp = t_1
else if (t1 <= 5.5d+58) then
tmp = (v / (-t1 - u)) * (t1 / u)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = (-1.0 * v) / (u + t1);
double tmp;
if (t1 <= -3.2e-51) {
tmp = t_1;
} else if (t1 <= 5.5e+58) {
tmp = (v / (-t1 - u)) * (t1 / u);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (-1.0 * v) / (u + t1) tmp = 0 if t1 <= -3.2e-51: tmp = t_1 elif t1 <= 5.5e+58: tmp = (v / (-t1 - u)) * (t1 / u) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-1.0 * v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -3.2e-51) tmp = t_1; elseif (t1 <= 5.5e+58) tmp = Float64(Float64(v / Float64(Float64(-t1) - u)) * Float64(t1 / u)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (-1.0 * v) / (u + t1); tmp = 0.0; if (t1 <= -3.2e-51) tmp = t_1; elseif (t1 <= 5.5e+58) tmp = (v / (-t1 - u)) * (t1 / u); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.2e-51], t$95$1, If[LessEqual[t1, 5.5e+58], N[(N[(v / N[((-t1) - u), $MachinePrecision]), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-1 \cdot v}{u + t1}\\
\mathbf{if}\;t1 \leq -3.2 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 5.5 \cdot 10^{+58}:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u} \cdot \frac{t1}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.2e-51 or 5.4999999999999999e58 < t1 Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites60.7%
if -3.2e-51 < t1 < 5.4999999999999999e58Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lift-neg.f64N/A
add-flipN/A
lift-+.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6497.7
Applied rewrites97.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
mult-flip-revN/A
frac-timesN/A
*-commutativeN/A
frac-timesN/A
lower-*.f64N/A
Applied rewrites98.0%
Taylor expanded in u around inf
lower-/.f6455.6
Applied rewrites55.6%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* -1.0 v) (+ u t1))))
(if (<= t1 -3.2e-51)
t_1
(if (<= t1 2.4e-132) (/ (* v t1) (* (+ u t1) (- u))) t_1))))
double code(double u, double v, double t1) {
double t_1 = (-1.0 * v) / (u + t1);
double tmp;
if (t1 <= -3.2e-51) {
tmp = t_1;
} else if (t1 <= 2.4e-132) {
tmp = (v * t1) / ((u + t1) * -u);
} 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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = ((-1.0d0) * v) / (u + t1)
if (t1 <= (-3.2d-51)) then
tmp = t_1
else if (t1 <= 2.4d-132) then
tmp = (v * t1) / ((u + t1) * -u)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = (-1.0 * v) / (u + t1);
double tmp;
if (t1 <= -3.2e-51) {
tmp = t_1;
} else if (t1 <= 2.4e-132) {
tmp = (v * t1) / ((u + t1) * -u);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (-1.0 * v) / (u + t1) tmp = 0 if t1 <= -3.2e-51: tmp = t_1 elif t1 <= 2.4e-132: tmp = (v * t1) / ((u + t1) * -u) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-1.0 * v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -3.2e-51) tmp = t_1; elseif (t1 <= 2.4e-132) tmp = Float64(Float64(v * t1) / Float64(Float64(u + t1) * Float64(-u))); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (-1.0 * v) / (u + t1); tmp = 0.0; if (t1 <= -3.2e-51) tmp = t_1; elseif (t1 <= 2.4e-132) tmp = (v * t1) / ((u + t1) * -u); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.2e-51], t$95$1, If[LessEqual[t1, 2.4e-132], N[(N[(v * t1), $MachinePrecision] / N[(N[(u + t1), $MachinePrecision] * (-u)), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-1 \cdot v}{u + t1}\\
\mathbf{if}\;t1 \leq -3.2 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.4 \cdot 10^{-132}:\\
\;\;\;\;\frac{v \cdot t1}{\left(u + t1\right) \cdot \left(-u\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.2e-51 or 2.40000000000000015e-132 < t1 Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites60.7%
if -3.2e-51 < t1 < 2.40000000000000015e-132Initial program 71.2%
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6471.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6471.2
Applied rewrites71.2%
Taylor expanded in u around inf
lower-*.f6446.0
Applied rewrites46.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6446.0
lift-*.f64N/A
mul-1-negN/A
*-lft-identityN/A
metadata-evalN/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity46.0
Applied rewrites46.0%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* -1.0 v) (+ u t1))))
(if (<= t1 -3.2e-51)
t_1
(if (<= t1 2.1e-55) (* (/ t1 (* (- u) (+ u t1))) v) t_1))))
double code(double u, double v, double t1) {
double t_1 = (-1.0 * v) / (u + t1);
double tmp;
if (t1 <= -3.2e-51) {
tmp = t_1;
} else if (t1 <= 2.1e-55) {
tmp = (t1 / (-u * (u + t1))) * v;
} 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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = ((-1.0d0) * v) / (u + t1)
if (t1 <= (-3.2d-51)) then
tmp = t_1
else if (t1 <= 2.1d-55) then
tmp = (t1 / (-u * (u + t1))) * v
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = (-1.0 * v) / (u + t1);
double tmp;
if (t1 <= -3.2e-51) {
tmp = t_1;
} else if (t1 <= 2.1e-55) {
tmp = (t1 / (-u * (u + t1))) * v;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (-1.0 * v) / (u + t1) tmp = 0 if t1 <= -3.2e-51: tmp = t_1 elif t1 <= 2.1e-55: tmp = (t1 / (-u * (u + t1))) * v else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-1.0 * v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -3.2e-51) tmp = t_1; elseif (t1 <= 2.1e-55) tmp = Float64(Float64(t1 / Float64(Float64(-u) * Float64(u + t1))) * v); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (-1.0 * v) / (u + t1); tmp = 0.0; if (t1 <= -3.2e-51) tmp = t_1; elseif (t1 <= 2.1e-55) tmp = (t1 / (-u * (u + t1))) * v; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.2e-51], t$95$1, If[LessEqual[t1, 2.1e-55], N[(N[(t1 / N[((-u) * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-1 \cdot v}{u + t1}\\
\mathbf{if}\;t1 \leq -3.2 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.1 \cdot 10^{-55}:\\
\;\;\;\;\frac{t1}{\left(-u\right) \cdot \left(u + t1\right)} \cdot v\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.2e-51 or 2.1000000000000002e-55 < t1 Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites60.7%
if -3.2e-51 < t1 < 2.1000000000000002e-55Initial program 71.2%
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6471.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6471.2
Applied rewrites71.2%
Taylor expanded in u around inf
lower-*.f6446.0
Applied rewrites46.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites46.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* -1.0 v) (+ u t1))))
(if (<= t1 -2e-146)
t_1
(if (<= t1 7.5e-179) (/ (* (* -1.0 (/ t1 u)) v) t1) t_1))))
double code(double u, double v, double t1) {
double t_1 = (-1.0 * v) / (u + t1);
double tmp;
if (t1 <= -2e-146) {
tmp = t_1;
} else if (t1 <= 7.5e-179) {
tmp = ((-1.0 * (t1 / u)) * v) / t1;
} 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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = ((-1.0d0) * v) / (u + t1)
if (t1 <= (-2d-146)) then
tmp = t_1
else if (t1 <= 7.5d-179) then
tmp = (((-1.0d0) * (t1 / u)) * v) / t1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = (-1.0 * v) / (u + t1);
double tmp;
if (t1 <= -2e-146) {
tmp = t_1;
} else if (t1 <= 7.5e-179) {
tmp = ((-1.0 * (t1 / u)) * v) / t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (-1.0 * v) / (u + t1) tmp = 0 if t1 <= -2e-146: tmp = t_1 elif t1 <= 7.5e-179: tmp = ((-1.0 * (t1 / u)) * v) / t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-1.0 * v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -2e-146) tmp = t_1; elseif (t1 <= 7.5e-179) tmp = Float64(Float64(Float64(-1.0 * Float64(t1 / u)) * v) / t1); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (-1.0 * v) / (u + t1); tmp = 0.0; if (t1 <= -2e-146) tmp = t_1; elseif (t1 <= 7.5e-179) tmp = ((-1.0 * (t1 / u)) * v) / t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2e-146], t$95$1, If[LessEqual[t1, 7.5e-179], N[(N[(N[(-1.0 * N[(t1 / u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / t1), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-1 \cdot v}{u + t1}\\
\mathbf{if}\;t1 \leq -2 \cdot 10^{-146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 7.5 \cdot 10^{-179}:\\
\;\;\;\;\frac{\left(-1 \cdot \frac{t1}{u}\right) \cdot v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -2.00000000000000005e-146 or 7.4999999999999996e-179 < t1 Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites60.7%
if -2.00000000000000005e-146 < t1 < 7.4999999999999996e-179Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites69.4%
Taylor expanded in u around inf
lower-*.f64N/A
lower-/.f6425.3
Applied rewrites25.3%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* -1.0 v) (+ u t1))))
(if (<= t1 -2.6e-189)
t_1
(if (<= t1 5.8e-251) (/ (* -1.0 (/ (* t1 v) u)) t1) t_1))))
double code(double u, double v, double t1) {
double t_1 = (-1.0 * v) / (u + t1);
double tmp;
if (t1 <= -2.6e-189) {
tmp = t_1;
} else if (t1 <= 5.8e-251) {
tmp = (-1.0 * ((t1 * v) / u)) / t1;
} 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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = ((-1.0d0) * v) / (u + t1)
if (t1 <= (-2.6d-189)) then
tmp = t_1
else if (t1 <= 5.8d-251) then
tmp = ((-1.0d0) * ((t1 * v) / u)) / t1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = (-1.0 * v) / (u + t1);
double tmp;
if (t1 <= -2.6e-189) {
tmp = t_1;
} else if (t1 <= 5.8e-251) {
tmp = (-1.0 * ((t1 * v) / u)) / t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (-1.0 * v) / (u + t1) tmp = 0 if t1 <= -2.6e-189: tmp = t_1 elif t1 <= 5.8e-251: tmp = (-1.0 * ((t1 * v) / u)) / t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-1.0 * v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -2.6e-189) tmp = t_1; elseif (t1 <= 5.8e-251) tmp = Float64(Float64(-1.0 * Float64(Float64(t1 * v) / u)) / t1); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (-1.0 * v) / (u + t1); tmp = 0.0; if (t1 <= -2.6e-189) tmp = t_1; elseif (t1 <= 5.8e-251) tmp = (-1.0 * ((t1 * v) / u)) / t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2.6e-189], t$95$1, If[LessEqual[t1, 5.8e-251], N[(N[(-1.0 * N[(N[(t1 * v), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision] / t1), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-1 \cdot v}{u + t1}\\
\mathbf{if}\;t1 \leq -2.6 \cdot 10^{-189}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 5.8 \cdot 10^{-251}:\\
\;\;\;\;\frac{-1 \cdot \frac{t1 \cdot v}{u}}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -2.5999999999999999e-189 or 5.8000000000000001e-251 < t1 Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites60.7%
if -2.5999999999999999e-189 < t1 < 5.8000000000000001e-251Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites69.4%
Taylor expanded in u around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
(FPCore (u v t1) :precision binary64 (/ (* -1.0 v) (+ u t1)))
double code(double u, double v, double t1) {
return (-1.0 * v) / (u + t1);
}
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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = ((-1.0d0) * v) / (u + t1)
end function
public static double code(double u, double v, double t1) {
return (-1.0 * v) / (u + t1);
}
def code(u, v, t1): return (-1.0 * v) / (u + t1)
function code(u, v, t1) return Float64(Float64(-1.0 * v) / Float64(u + t1)) end
function tmp = code(u, v, t1) tmp = (-1.0 * v) / (u + t1); end
code[u_, v_, t1_] := N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1 \cdot v}{u + t1}
\end{array}
Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6497.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in u around 0
Applied rewrites60.7%
(FPCore (u v t1) :precision binary64 (/ (- v) t1))
double code(double u, double v, double t1) {
return -v / t1;
}
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(u, v, t1)
use fmin_fmax_functions
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = -v / t1
end function
public static double code(double u, double v, double t1) {
return -v / t1;
}
def code(u, v, t1): return -v / t1
function code(u, v, t1) return Float64(Float64(-v) / t1) end
function tmp = code(u, v, t1) tmp = -v / t1; end
code[u_, v_, t1_] := N[((-v) / t1), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{t1}
\end{array}
Initial program 71.2%
Taylor expanded in u around 0
lower-*.f64N/A
lower-/.f6453.2
Applied rewrites53.2%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6453.2
Applied rewrites53.2%
herbie shell --seed 2025155
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))