
(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 15 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) (+ u t1)) v) (+ u t1)))
double code(double u, double v, double t1) {
return ((-t1 / (u + t1)) * 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 / (u + t1)) * v) / (u + t1)
end function
public static double code(double u, double v, double t1) {
return ((-t1 / (u + t1)) * v) / (u + t1);
}
def code(u, v, t1): return ((-t1 / (u + t1)) * v) / (u + t1)
function code(u, v, t1) return Float64(Float64(Float64(Float64(-t1) / Float64(u + t1)) * v) / Float64(u + t1)) end
function tmp = code(u, v, t1) tmp = ((-t1 / (u + t1)) * v) / (u + t1); end
code[u_, v_, t1_] := N[(N[(N[((-t1) / N[(u + t1), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{-t1}{u + t1} \cdot v}{u + t1}
\end{array}
Initial program 71.9%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
lift-*.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
associate-*r/N/A
+-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f6498.2
Applied rewrites98.2%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (+ u t1))))
(if (<= t1 -6.5e+109)
(* (- (/ u t1) 1.0) t_1)
(if (<= t1 -9.5e-261)
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u)))
(if (<= t1 2.85e-145)
(* v (/ (/ (- t1) u) u))
(if (<= t1 6.6e+128) (* (- t1) (/ t_1 (+ u t1))) (/ (- v) t1)))))))
double code(double u, double v, double t1) {
double t_1 = v / (u + t1);
double tmp;
if (t1 <= -6.5e+109) {
tmp = ((u / t1) - 1.0) * t_1;
} else if (t1 <= -9.5e-261) {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
} else if (t1 <= 2.85e-145) {
tmp = v * ((-t1 / u) / u);
} else if (t1 <= 6.6e+128) {
tmp = -t1 * (t_1 / (u + t1));
} else {
tmp = -v / 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 = v / (u + t1)
if (t1 <= (-6.5d+109)) then
tmp = ((u / t1) - 1.0d0) * t_1
else if (t1 <= (-9.5d-261)) then
tmp = (-t1 * v) / ((t1 + u) * (t1 + u))
else if (t1 <= 2.85d-145) then
tmp = v * ((-t1 / u) / u)
else if (t1 <= 6.6d+128) then
tmp = -t1 * (t_1 / (u + t1))
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v / (u + t1);
double tmp;
if (t1 <= -6.5e+109) {
tmp = ((u / t1) - 1.0) * t_1;
} else if (t1 <= -9.5e-261) {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
} else if (t1 <= 2.85e-145) {
tmp = v * ((-t1 / u) / u);
} else if (t1 <= 6.6e+128) {
tmp = -t1 * (t_1 / (u + t1));
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): t_1 = v / (u + t1) tmp = 0 if t1 <= -6.5e+109: tmp = ((u / t1) - 1.0) * t_1 elif t1 <= -9.5e-261: tmp = (-t1 * v) / ((t1 + u) * (t1 + u)) elif t1 <= 2.85e-145: tmp = v * ((-t1 / u) / u) elif t1 <= 6.6e+128: tmp = -t1 * (t_1 / (u + t1)) else: tmp = -v / t1 return tmp
function code(u, v, t1) t_1 = Float64(v / Float64(u + t1)) tmp = 0.0 if (t1 <= -6.5e+109) tmp = Float64(Float64(Float64(u / t1) - 1.0) * t_1); elseif (t1 <= -9.5e-261) tmp = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))); elseif (t1 <= 2.85e-145) tmp = Float64(v * Float64(Float64(Float64(-t1) / u) / u)); elseif (t1 <= 6.6e+128) tmp = Float64(Float64(-t1) * Float64(t_1 / Float64(u + t1))); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v / (u + t1); tmp = 0.0; if (t1 <= -6.5e+109) tmp = ((u / t1) - 1.0) * t_1; elseif (t1 <= -9.5e-261) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); elseif (t1 <= 2.85e-145) tmp = v * ((-t1 / u) / u); elseif (t1 <= 6.6e+128) tmp = -t1 * (t_1 / (u + t1)); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -6.5e+109], N[(N[(N[(u / t1), $MachinePrecision] - 1.0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t1, -9.5e-261], N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 2.85e-145], N[(v * N[(N[((-t1) / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 6.6e+128], N[((-t1) * N[(t$95$1 / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{u + t1}\\
\mathbf{if}\;t1 \leq -6.5 \cdot 10^{+109}:\\
\;\;\;\;\left(\frac{u}{t1} - 1\right) \cdot t\_1\\
\mathbf{elif}\;t1 \leq -9.5 \cdot 10^{-261}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{elif}\;t1 \leq 2.85 \cdot 10^{-145}:\\
\;\;\;\;v \cdot \frac{\frac{-t1}{u}}{u}\\
\mathbf{elif}\;t1 \leq 6.6 \cdot 10^{+128}:\\
\;\;\;\;\left(-t1\right) \cdot \frac{t\_1}{u + t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if t1 < -6.5e109Initial program 45.6%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
lower--.f64N/A
lower-/.f6490.4
Applied rewrites90.4%
if -6.5e109 < t1 < -9.5000000000000008e-261Initial program 84.3%
if -9.5000000000000008e-261 < t1 < 2.85000000000000016e-145Initial program 77.5%
Taylor expanded in u around inf
associate-*r/N/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
unpow2N/A
times-fracN/A
mul-1-negN/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lift-neg.f6484.6
Applied rewrites84.6%
lift-*.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-frac-negN/A
mul-1-negN/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-frac-negN/A
lift-/.f64N/A
lift-neg.f6486.1
Applied rewrites86.1%
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-frac-negN/A
mul-1-negN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
mul-1-negN/A
distribute-frac-negN/A
lift-/.f64N/A
lift-neg.f6486.9
Applied rewrites86.9%
if 2.85000000000000016e-145 < t1 < 6.6000000000000001e128Initial program 87.6%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-neg.f64N/A
lower-/.f64N/A
pow2N/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f6487.3
Applied rewrites87.3%
lift-+.f64N/A
+-commutativeN/A
lower-pow.f64N/A
pow2N/A
lower-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f6487.3
Applied rewrites87.3%
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6492.9
Applied rewrites92.9%
if 6.6000000000000001e128 < t1 Initial program 45.0%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6490.9
Applied rewrites90.9%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* (- t1) (/ v (* (+ u t1) (+ u t1))))))
(if (<= t1 -5.8e+101)
(/ (- v) (+ u t1))
(if (<= t1 -5.5e-65)
t_1
(if (<= t1 4.4e-148)
(/ (* v (/ (- t1) u)) u)
(if (<= t1 6.6e+128) t_1 (/ (- v) t1)))))))
double code(double u, double v, double t1) {
double t_1 = -t1 * (v / ((u + t1) * (u + t1)));
double tmp;
if (t1 <= -5.8e+101) {
tmp = -v / (u + t1);
} else if (t1 <= -5.5e-65) {
tmp = t_1;
} else if (t1 <= 4.4e-148) {
tmp = (v * (-t1 / u)) / u;
} else if (t1 <= 6.6e+128) {
tmp = t_1;
} else {
tmp = -v / 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 * (v / ((u + t1) * (u + t1)))
if (t1 <= (-5.8d+101)) then
tmp = -v / (u + t1)
else if (t1 <= (-5.5d-65)) then
tmp = t_1
else if (t1 <= 4.4d-148) then
tmp = (v * (-t1 / u)) / u
else if (t1 <= 6.6d+128) then
tmp = t_1
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -t1 * (v / ((u + t1) * (u + t1)));
double tmp;
if (t1 <= -5.8e+101) {
tmp = -v / (u + t1);
} else if (t1 <= -5.5e-65) {
tmp = t_1;
} else if (t1 <= 4.4e-148) {
tmp = (v * (-t1 / u)) / u;
} else if (t1 <= 6.6e+128) {
tmp = t_1;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): t_1 = -t1 * (v / ((u + t1) * (u + t1))) tmp = 0 if t1 <= -5.8e+101: tmp = -v / (u + t1) elif t1 <= -5.5e-65: tmp = t_1 elif t1 <= 4.4e-148: tmp = (v * (-t1 / u)) / u elif t1 <= 6.6e+128: tmp = t_1 else: tmp = -v / t1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-t1) * Float64(v / Float64(Float64(u + t1) * Float64(u + t1)))) tmp = 0.0 if (t1 <= -5.8e+101) tmp = Float64(Float64(-v) / Float64(u + t1)); elseif (t1 <= -5.5e-65) tmp = t_1; elseif (t1 <= 4.4e-148) tmp = Float64(Float64(v * Float64(Float64(-t1) / u)) / u); elseif (t1 <= 6.6e+128) tmp = t_1; else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -t1 * (v / ((u + t1) * (u + t1))); tmp = 0.0; if (t1 <= -5.8e+101) tmp = -v / (u + t1); elseif (t1 <= -5.5e-65) tmp = t_1; elseif (t1 <= 4.4e-148) tmp = (v * (-t1 / u)) / u; elseif (t1 <= 6.6e+128) tmp = t_1; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-t1) * N[(v / N[(N[(u + t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -5.8e+101], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -5.5e-65], t$95$1, If[LessEqual[t1, 4.4e-148], N[(N[(v * N[((-t1) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[t1, 6.6e+128], t$95$1, N[((-v) / t1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-t1\right) \cdot \frac{v}{\left(u + t1\right) \cdot \left(u + t1\right)}\\
\mathbf{if}\;t1 \leq -5.8 \cdot 10^{+101}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\mathbf{elif}\;t1 \leq -5.5 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 4.4 \cdot 10^{-148}:\\
\;\;\;\;\frac{v \cdot \frac{-t1}{u}}{u}\\
\mathbf{elif}\;t1 \leq 6.6 \cdot 10^{+128}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if t1 < -5.79999999999999974e101Initial program 47.1%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
associate-*r/N/A
+-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6489.9
Applied rewrites89.9%
if -5.79999999999999974e101 < t1 < -5.4999999999999999e-65 or 4.40000000000000034e-148 < t1 < 6.6000000000000001e128Initial program 87.6%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-neg.f64N/A
lower-/.f64N/A
pow2N/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f6487.9
Applied rewrites87.9%
lift-+.f64N/A
+-commutativeN/A
lower-pow.f64N/A
pow2N/A
lower-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f6487.9
Applied rewrites87.9%
if -5.4999999999999999e-65 < t1 < 4.40000000000000034e-148Initial program 79.5%
Taylor expanded in u around inf
associate-*r/N/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
unpow2N/A
times-fracN/A
mul-1-negN/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lift-neg.f6481.6
Applied rewrites81.6%
lift-*.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-frac-negN/A
mul-1-negN/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-frac-negN/A
lift-/.f64N/A
lift-neg.f6482.6
Applied rewrites82.6%
if 6.6000000000000001e128 < t1 Initial program 45.0%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6490.9
Applied rewrites90.9%
(FPCore (u v t1) :precision binary64 (if (<= t1 -6.5e+109) (* (- (/ u t1) 1.0) (/ v (+ u t1))) (if (<= t1 1.92e+93) (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))) (/ (- v) t1))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -6.5e+109) {
tmp = ((u / t1) - 1.0) * (v / (u + t1));
} else if (t1 <= 1.92e+93) {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
} else {
tmp = -v / 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 <= (-6.5d+109)) then
tmp = ((u / t1) - 1.0d0) * (v / (u + t1))
else if (t1 <= 1.92d+93) then
tmp = (-t1 * v) / ((t1 + u) * (t1 + u))
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -6.5e+109) {
tmp = ((u / t1) - 1.0) * (v / (u + t1));
} else if (t1 <= 1.92e+93) {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -6.5e+109: tmp = ((u / t1) - 1.0) * (v / (u + t1)) elif t1 <= 1.92e+93: tmp = (-t1 * v) / ((t1 + u) * (t1 + u)) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -6.5e+109) tmp = Float64(Float64(Float64(u / t1) - 1.0) * Float64(v / Float64(u + t1))); elseif (t1 <= 1.92e+93) tmp = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -6.5e+109) tmp = ((u / t1) - 1.0) * (v / (u + t1)); elseif (t1 <= 1.92e+93) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -6.5e+109], N[(N[(N[(u / t1), $MachinePrecision] - 1.0), $MachinePrecision] * N[(v / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.92e+93], N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -6.5 \cdot 10^{+109}:\\
\;\;\;\;\left(\frac{u}{t1} - 1\right) \cdot \frac{v}{u + t1}\\
\mathbf{elif}\;t1 \leq 1.92 \cdot 10^{+93}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if t1 < -6.5e109Initial program 45.6%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
lower--.f64N/A
lower-/.f6490.4
Applied rewrites90.4%
if -6.5e109 < t1 < 1.92000000000000004e93Initial program 84.0%
if 1.92000000000000004e93 < t1 Initial program 50.3%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6488.4
Applied rewrites88.4%
(FPCore (u v t1) :precision binary64 (if (<= t1 -1.15e+109) (/ (- v) (+ u t1)) (if (<= t1 1.92e+93) (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))) (/ (- v) t1))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.15e+109) {
tmp = -v / (u + t1);
} else if (t1 <= 1.92e+93) {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
} else {
tmp = -v / 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 <= (-1.15d+109)) then
tmp = -v / (u + t1)
else if (t1 <= 1.92d+93) then
tmp = (-t1 * v) / ((t1 + u) * (t1 + u))
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.15e+109) {
tmp = -v / (u + t1);
} else if (t1 <= 1.92e+93) {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -1.15e+109: tmp = -v / (u + t1) elif t1 <= 1.92e+93: tmp = (-t1 * v) / ((t1 + u) * (t1 + u)) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.15e+109) tmp = Float64(Float64(-v) / Float64(u + t1)); elseif (t1 <= 1.92e+93) tmp = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -1.15e+109) tmp = -v / (u + t1); elseif (t1 <= 1.92e+93) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -1.15e+109], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.92e+93], N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.15 \cdot 10^{+109}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\mathbf{elif}\;t1 \leq 1.92 \cdot 10^{+93}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if t1 < -1.15000000000000005e109Initial program 45.8%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
associate-*r/N/A
+-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6490.2
Applied rewrites90.2%
if -1.15000000000000005e109 < t1 < 1.92000000000000004e93Initial program 84.1%
if 1.92000000000000004e93 < t1 Initial program 50.3%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6488.4
Applied rewrites88.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -8.8e+52)
t_1
(if (<= t1 5.2e-84) (/ (* v (/ (- t1) u)) u) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -8.8e+52) {
tmp = t_1;
} else if (t1 <= 5.2e-84) {
tmp = (v * (-t1 / u)) / 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 = -v / (u + t1)
if (t1 <= (-8.8d+52)) then
tmp = t_1
else if (t1 <= 5.2d-84) then
tmp = (v * (-t1 / u)) / u
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -8.8e+52) {
tmp = t_1;
} else if (t1 <= 5.2e-84) {
tmp = (v * (-t1 / u)) / u;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (u + t1) tmp = 0 if t1 <= -8.8e+52: tmp = t_1 elif t1 <= 5.2e-84: tmp = (v * (-t1 / u)) / u else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -8.8e+52) tmp = t_1; elseif (t1 <= 5.2e-84) tmp = Float64(Float64(v * Float64(Float64(-t1) / u)) / u); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (u + t1); tmp = 0.0; if (t1 <= -8.8e+52) tmp = t_1; elseif (t1 <= 5.2e-84) tmp = (v * (-t1 / u)) / u; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -8.8e+52], t$95$1, If[LessEqual[t1, 5.2e-84], N[(N[(v * N[((-t1) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u + t1}\\
\mathbf{if}\;t1 \leq -8.8 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 5.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{v \cdot \frac{-t1}{u}}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -8.7999999999999999e52 or 5.2e-84 < t1 Initial program 62.2%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
associate-*r/N/A
+-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6481.9
Applied rewrites81.9%
if -8.7999999999999999e52 < t1 < 5.2e-84Initial program 82.8%
Taylor expanded in u around inf
associate-*r/N/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
unpow2N/A
times-fracN/A
mul-1-negN/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lift-neg.f6474.7
Applied rewrites74.7%
lift-*.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-frac-negN/A
mul-1-negN/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-frac-negN/A
lift-/.f64N/A
lift-neg.f6475.4
Applied rewrites75.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -8.8e+52)
t_1
(if (<= t1 5.2e-84) (* (/ v u) (/ (- t1) u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -8.8e+52) {
tmp = t_1;
} else if (t1 <= 5.2e-84) {
tmp = (v / 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 = -v / (u + t1)
if (t1 <= (-8.8d+52)) then
tmp = t_1
else if (t1 <= 5.2d-84) then
tmp = (v / 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 = -v / (u + t1);
double tmp;
if (t1 <= -8.8e+52) {
tmp = t_1;
} else if (t1 <= 5.2e-84) {
tmp = (v / u) * (-t1 / u);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (u + t1) tmp = 0 if t1 <= -8.8e+52: tmp = t_1 elif t1 <= 5.2e-84: tmp = (v / u) * (-t1 / u) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -8.8e+52) tmp = t_1; elseif (t1 <= 5.2e-84) tmp = Float64(Float64(v / u) * Float64(Float64(-t1) / u)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (u + t1); tmp = 0.0; if (t1 <= -8.8e+52) tmp = t_1; elseif (t1 <= 5.2e-84) tmp = (v / u) * (-t1 / u); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -8.8e+52], t$95$1, If[LessEqual[t1, 5.2e-84], N[(N[(v / u), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u + t1}\\
\mathbf{if}\;t1 \leq -8.8 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 5.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{-t1}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -8.7999999999999999e52 or 5.2e-84 < t1 Initial program 62.2%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
associate-*r/N/A
+-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6481.9
Applied rewrites81.9%
if -8.7999999999999999e52 < t1 < 5.2e-84Initial program 82.8%
Taylor expanded in u around inf
associate-*r/N/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
unpow2N/A
times-fracN/A
mul-1-negN/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lift-neg.f6474.7
Applied rewrites74.7%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -8.8e+52)
t_1
(if (<= t1 5.2e-84) (* v (/ (/ (- t1) u) u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -8.8e+52) {
tmp = t_1;
} else if (t1 <= 5.2e-84) {
tmp = v * ((-t1 / u) / 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 = -v / (u + t1)
if (t1 <= (-8.8d+52)) then
tmp = t_1
else if (t1 <= 5.2d-84) then
tmp = v * ((-t1 / u) / u)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -8.8e+52) {
tmp = t_1;
} else if (t1 <= 5.2e-84) {
tmp = v * ((-t1 / u) / u);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (u + t1) tmp = 0 if t1 <= -8.8e+52: tmp = t_1 elif t1 <= 5.2e-84: tmp = v * ((-t1 / u) / u) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -8.8e+52) tmp = t_1; elseif (t1 <= 5.2e-84) tmp = Float64(v * Float64(Float64(Float64(-t1) / u) / u)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (u + t1); tmp = 0.0; if (t1 <= -8.8e+52) tmp = t_1; elseif (t1 <= 5.2e-84) tmp = v * ((-t1 / u) / u); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -8.8e+52], t$95$1, If[LessEqual[t1, 5.2e-84], N[(v * N[(N[((-t1) / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u + t1}\\
\mathbf{if}\;t1 \leq -8.8 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 5.2 \cdot 10^{-84}:\\
\;\;\;\;v \cdot \frac{\frac{-t1}{u}}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -8.7999999999999999e52 or 5.2e-84 < t1 Initial program 62.2%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
associate-*r/N/A
+-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6481.9
Applied rewrites81.9%
if -8.7999999999999999e52 < t1 < 5.2e-84Initial program 82.8%
Taylor expanded in u around inf
associate-*r/N/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
unpow2N/A
times-fracN/A
mul-1-negN/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lift-neg.f6474.7
Applied rewrites74.7%
lift-*.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-frac-negN/A
mul-1-negN/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-frac-negN/A
lift-/.f64N/A
lift-neg.f6475.4
Applied rewrites75.4%
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-frac-negN/A
mul-1-negN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
mul-1-negN/A
distribute-frac-negN/A
lift-/.f64N/A
lift-neg.f6472.8
Applied rewrites72.8%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -1.2e-47)
t_1
(if (<= t1 5.2e-84) (/ (* (- t1) v) (* u u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -1.2e-47) {
tmp = t_1;
} else if (t1 <= 5.2e-84) {
tmp = (-t1 * v) / (u * 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 = -v / (u + t1)
if (t1 <= (-1.2d-47)) then
tmp = t_1
else if (t1 <= 5.2d-84) then
tmp = (-t1 * v) / (u * u)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -1.2e-47) {
tmp = t_1;
} else if (t1 <= 5.2e-84) {
tmp = (-t1 * v) / (u * u);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (u + t1) tmp = 0 if t1 <= -1.2e-47: tmp = t_1 elif t1 <= 5.2e-84: tmp = (-t1 * v) / (u * u) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -1.2e-47) tmp = t_1; elseif (t1 <= 5.2e-84) tmp = Float64(Float64(Float64(-t1) * v) / Float64(u * u)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (u + t1); tmp = 0.0; if (t1 <= -1.2e-47) tmp = t_1; elseif (t1 <= 5.2e-84) tmp = (-t1 * v) / (u * u); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.2e-47], t$95$1, If[LessEqual[t1, 5.2e-84], N[(N[((-t1) * v), $MachinePrecision] / N[(u * u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u + t1}\\
\mathbf{if}\;t1 \leq -1.2 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 5.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -1.2e-47 or 5.2e-84 < t1 Initial program 65.9%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
associate-*r/N/A
+-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6479.7
Applied rewrites79.7%
if -1.2e-47 < t1 < 5.2e-84Initial program 81.2%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6473.2
Applied rewrites73.2%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -2.6e-117)
t_1
(if (<= t1 5.2e-84) (* (- t1) (/ v (* u u))) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -2.6e-117) {
tmp = t_1;
} else if (t1 <= 5.2e-84) {
tmp = -t1 * (v / (u * 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 = -v / (u + t1)
if (t1 <= (-2.6d-117)) then
tmp = t_1
else if (t1 <= 5.2d-84) then
tmp = -t1 * (v / (u * u))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -2.6e-117) {
tmp = t_1;
} else if (t1 <= 5.2e-84) {
tmp = -t1 * (v / (u * u));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (u + t1) tmp = 0 if t1 <= -2.6e-117: tmp = t_1 elif t1 <= 5.2e-84: tmp = -t1 * (v / (u * u)) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -2.6e-117) tmp = t_1; elseif (t1 <= 5.2e-84) tmp = Float64(Float64(-t1) * Float64(v / Float64(u * u))); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (u + t1); tmp = 0.0; if (t1 <= -2.6e-117) tmp = t_1; elseif (t1 <= 5.2e-84) tmp = -t1 * (v / (u * u)); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2.6e-117], t$95$1, If[LessEqual[t1, 5.2e-84], N[((-t1) * N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u + t1}\\
\mathbf{if}\;t1 \leq -2.6 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 5.2 \cdot 10^{-84}:\\
\;\;\;\;\left(-t1\right) \cdot \frac{v}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -2.59999999999999983e-117 or 5.2e-84 < t1 Initial program 67.7%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
associate-*r/N/A
+-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6477.3
Applied rewrites77.3%
if -2.59999999999999983e-117 < t1 < 5.2e-84Initial program 80.2%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-neg.f64N/A
lower-/.f64N/A
pow2N/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f6480.3
Applied rewrites80.3%
Taylor expanded in u around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6475.1
Applied rewrites75.1%
(FPCore (u v t1) :precision binary64 (/ (* (- t1) (/ v (+ u t1))) (+ u t1)))
double code(double u, double v, double t1) {
return (-t1 * (v / (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 = (-t1 * (v / (u + t1))) / (u + t1)
end function
public static double code(double u, double v, double t1) {
return (-t1 * (v / (u + t1))) / (u + t1);
}
def code(u, v, t1): return (-t1 * (v / (u + t1))) / (u + t1)
function code(u, v, t1) return Float64(Float64(Float64(-t1) * Float64(v / Float64(u + t1))) / Float64(u + t1)) end
function tmp = code(u, v, t1) tmp = (-t1 * (v / (u + t1))) / (u + t1); end
code[u_, v_, t1_] := N[(N[((-t1) * N[(v / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot \frac{v}{u + t1}}{u + t1}
\end{array}
Initial program 71.9%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
lift-*.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
associate-*l/N/A
+-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f6498.0
Applied rewrites98.0%
(FPCore (u v t1) :precision binary64 (* (/ (- t1) (+ u t1)) (/ v (+ u t1))))
double code(double u, double v, double t1) {
return (-t1 / (u + t1)) * (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 / (u + t1)) * (v / (u + t1))
end function
public static double code(double u, double v, double t1) {
return (-t1 / (u + t1)) * (v / (u + t1));
}
def code(u, v, t1): return (-t1 / (u + t1)) * (v / (u + t1))
function code(u, v, t1) return Float64(Float64(Float64(-t1) / Float64(u + t1)) * Float64(v / Float64(u + t1))) end
function tmp = code(u, v, t1) tmp = (-t1 / (u + t1)) * (v / (u + t1)); end
code[u_, v_, t1_] := N[(N[((-t1) / N[(u + t1), $MachinePrecision]), $MachinePrecision] * N[(v / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-t1}{u + t1} \cdot \frac{v}{u + t1}
\end{array}
Initial program 71.9%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
(FPCore (u v t1) :precision binary64 (if (<= u 3.8e+177) (/ (- v) t1) (* -1.0 (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= 3.8e+177) {
tmp = -v / t1;
} else {
tmp = -1.0 * (v / u);
}
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 (u <= 3.8d+177) then
tmp = -v / t1
else
tmp = (-1.0d0) * (v / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= 3.8e+177) {
tmp = -v / t1;
} else {
tmp = -1.0 * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= 3.8e+177: tmp = -v / t1 else: tmp = -1.0 * (v / u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= 3.8e+177) tmp = Float64(Float64(-v) / t1); else tmp = Float64(-1.0 * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= 3.8e+177) tmp = -v / t1; else tmp = -1.0 * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, 3.8e+177], N[((-v) / t1), $MachinePrecision], N[(-1.0 * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq 3.8 \cdot 10^{+177}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \frac{v}{u}\\
\end{array}
\end{array}
if u < 3.7999999999999998e177Initial program 71.6%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6458.3
Applied rewrites58.3%
if 3.7999999999999998e177 < u Initial program 75.0%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6499.1
Applied rewrites99.1%
Taylor expanded in u around 0
Applied rewrites50.4%
Taylor expanded in u around inf
Applied rewrites42.9%
(FPCore (u v t1) :precision binary64 (/ (- v) (+ u t1)))
double code(double u, double v, double t1) {
return -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 = -v / (u + t1)
end function
public static double code(double u, double v, double t1) {
return -v / (u + t1);
}
def code(u, v, t1): return -v / (u + t1)
function code(u, v, t1) return Float64(Float64(-v) / Float64(u + t1)) end
function tmp = code(u, v, t1) tmp = -v / (u + t1); end
code[u_, v_, t1_] := N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{u + t1}
\end{array}
Initial program 71.9%
lift-/.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
lift-*.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
associate-*r/N/A
+-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f6498.2
Applied rewrites98.2%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6462.0
Applied rewrites62.0%
(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.9%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6454.6
Applied rewrites54.6%
herbie shell --seed 2025099
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))