
(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 12 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 (/ (* (/ 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(Float64(v / Float64(Float64(-t1) - u)) * 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[(N[(v / N[((-t1) - u), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{\left(-t1\right) - u} \cdot t1}{u + t1}
\end{array}
Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6497.8
Applied rewrites97.8%
(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 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
(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 73.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
sqr-neg-revN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f64N/A
lift-neg.f64N/A
frac-2neg-revN/A
lower-/.f6498.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.0
Applied rewrites98.0%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- (- t1) u)))
(if (<= t1 -3.3e+146)
(/ (* -1.0 v) (+ u t1))
(if (<= t1 7e+88)
(* (/ t1 (* t_1 (+ u t1))) v)
(/ (* (/ t1 t_1) v) t1)))))
double code(double u, double v, double t1) {
double t_1 = -t1 - u;
double tmp;
if (t1 <= -3.3e+146) {
tmp = (-1.0 * v) / (u + t1);
} else if (t1 <= 7e+88) {
tmp = (t1 / (t_1 * (u + t1))) * v;
} else {
tmp = ((t1 / t_1) * 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 - u
if (t1 <= (-3.3d+146)) then
tmp = ((-1.0d0) * v) / (u + t1)
else if (t1 <= 7d+88) then
tmp = (t1 / (t_1 * (u + t1))) * v
else
tmp = ((t1 / t_1) * v) / 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 <= -3.3e+146) {
tmp = (-1.0 * v) / (u + t1);
} else if (t1 <= 7e+88) {
tmp = (t1 / (t_1 * (u + t1))) * v;
} else {
tmp = ((t1 / t_1) * v) / t1;
}
return tmp;
}
def code(u, v, t1): t_1 = -t1 - u tmp = 0 if t1 <= -3.3e+146: tmp = (-1.0 * v) / (u + t1) elif t1 <= 7e+88: tmp = (t1 / (t_1 * (u + t1))) * v else: tmp = ((t1 / t_1) * v) / t1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-t1) - u) tmp = 0.0 if (t1 <= -3.3e+146) tmp = Float64(Float64(-1.0 * v) / Float64(u + t1)); elseif (t1 <= 7e+88) tmp = Float64(Float64(t1 / Float64(t_1 * Float64(u + t1))) * v); else tmp = Float64(Float64(Float64(t1 / t_1) * v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -t1 - u; tmp = 0.0; if (t1 <= -3.3e+146) tmp = (-1.0 * v) / (u + t1); elseif (t1 <= 7e+88) tmp = (t1 / (t_1 * (u + t1))) * v; else tmp = ((t1 / t_1) * v) / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-t1) - u), $MachinePrecision]}, If[LessEqual[t1, -3.3e+146], N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 7e+88], N[(N[(t1 / N[(t$95$1 * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision], N[(N[(N[(t1 / t$95$1), $MachinePrecision] * v), $MachinePrecision] / t1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-t1\right) - u\\
\mathbf{if}\;t1 \leq -3.3 \cdot 10^{+146}:\\
\;\;\;\;\frac{-1 \cdot v}{u + t1}\\
\mathbf{elif}\;t1 \leq 7 \cdot 10^{+88}:\\
\;\;\;\;\frac{t1}{t\_1 \cdot \left(u + t1\right)} \cdot v\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t1}{t\_1} \cdot v}{t1}\\
\end{array}
\end{array}
if t1 < -3.30000000000000016e146Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
Taylor expanded in u around 0
Applied rewrites61.5%
if -3.30000000000000016e146 < t1 < 6.9999999999999995e88Initial program 73.0%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.9%
if 6.9999999999999995e88 < t1 Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
Taylor expanded in u around 0
Applied rewrites70.8%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (- u))))
(if (<= u -5e+24)
(/ (* t_1 t1) (+ u t1))
(if (<= u 1.3e-63) (/ (- v) t1) (* (- t1) (/ t_1 (- (- t1) u)))))))
double code(double u, double v, double t1) {
double t_1 = v / -u;
double tmp;
if (u <= -5e+24) {
tmp = (t_1 * t1) / (u + t1);
} else if (u <= 1.3e-63) {
tmp = -v / t1;
} else {
tmp = -t1 * (t_1 / (-t1 - 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) :: t_1
real(8) :: tmp
t_1 = v / -u
if (u <= (-5d+24)) then
tmp = (t_1 * t1) / (u + t1)
else if (u <= 1.3d-63) then
tmp = -v / t1
else
tmp = -t1 * (t_1 / (-t1 - u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v / -u;
double tmp;
if (u <= -5e+24) {
tmp = (t_1 * t1) / (u + t1);
} else if (u <= 1.3e-63) {
tmp = -v / t1;
} else {
tmp = -t1 * (t_1 / (-t1 - u));
}
return tmp;
}
def code(u, v, t1): t_1 = v / -u tmp = 0 if u <= -5e+24: tmp = (t_1 * t1) / (u + t1) elif u <= 1.3e-63: tmp = -v / t1 else: tmp = -t1 * (t_1 / (-t1 - u)) return tmp
function code(u, v, t1) t_1 = Float64(v / Float64(-u)) tmp = 0.0 if (u <= -5e+24) tmp = Float64(Float64(t_1 * t1) / Float64(u + t1)); elseif (u <= 1.3e-63) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(-t1) * Float64(t_1 / Float64(Float64(-t1) - u))); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v / -u; tmp = 0.0; if (u <= -5e+24) tmp = (t_1 * t1) / (u + t1); elseif (u <= 1.3e-63) tmp = -v / t1; else tmp = -t1 * (t_1 / (-t1 - u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / (-u)), $MachinePrecision]}, If[LessEqual[u, -5e+24], N[(N[(t$95$1 * t1), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.3e-63], N[((-v) / t1), $MachinePrecision], N[((-t1) * N[(t$95$1 / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{-u}\\
\mathbf{if}\;u \leq -5 \cdot 10^{+24}:\\
\;\;\;\;\frac{t\_1 \cdot t1}{u + t1}\\
\mathbf{elif}\;u \leq 1.3 \cdot 10^{-63}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\left(-t1\right) \cdot \frac{t\_1}{\left(-t1\right) - u}\\
\end{array}
\end{array}
if u < -5.00000000000000045e24Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6497.8
Applied rewrites97.8%
Taylor expanded in u around inf
lower-*.f6451.4
Applied rewrites51.4%
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-identity51.4
Applied rewrites51.4%
if -5.00000000000000045e24 < u < 1.3000000000000001e-63Initial program 73.0%
Taylor expanded in u around 0
lower-*.f64N/A
lower-/.f6453.8
Applied rewrites53.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6453.8
Applied rewrites53.8%
if 1.3000000000000001e-63 < u Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6497.8
Applied rewrites97.8%
Taylor expanded in u around inf
lower-*.f6451.4
Applied rewrites51.4%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites52.6%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -1.25e+43)
(/ (* -1.0 v) (+ u t1))
(if (<= t1 5.3e-169)
(/ (* (/ v (- u)) t1) (+ u t1))
(/ (* (/ t1 (- (- t1) u)) v) t1))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.25e+43) {
tmp = (-1.0 * v) / (u + t1);
} else if (t1 <= 5.3e-169) {
tmp = ((v / -u) * t1) / (u + t1);
} else {
tmp = ((t1 / (-t1 - u)) * 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.25d+43)) then
tmp = ((-1.0d0) * v) / (u + t1)
else if (t1 <= 5.3d-169) then
tmp = ((v / -u) * t1) / (u + t1)
else
tmp = ((t1 / (-t1 - u)) * v) / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.25e+43) {
tmp = (-1.0 * v) / (u + t1);
} else if (t1 <= 5.3e-169) {
tmp = ((v / -u) * t1) / (u + t1);
} else {
tmp = ((t1 / (-t1 - u)) * v) / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -1.25e+43: tmp = (-1.0 * v) / (u + t1) elif t1 <= 5.3e-169: tmp = ((v / -u) * t1) / (u + t1) else: tmp = ((t1 / (-t1 - u)) * v) / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.25e+43) tmp = Float64(Float64(-1.0 * v) / Float64(u + t1)); elseif (t1 <= 5.3e-169) tmp = Float64(Float64(Float64(v / Float64(-u)) * t1) / Float64(u + t1)); else tmp = Float64(Float64(Float64(t1 / Float64(Float64(-t1) - u)) * v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -1.25e+43) tmp = (-1.0 * v) / (u + t1); elseif (t1 <= 5.3e-169) tmp = ((v / -u) * t1) / (u + t1); else tmp = ((t1 / (-t1 - u)) * v) / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -1.25e+43], N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 5.3e-169], N[(N[(N[(v / (-u)), $MachinePrecision] * t1), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t1 / N[((-t1) - u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / t1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.25 \cdot 10^{+43}:\\
\;\;\;\;\frac{-1 \cdot v}{u + t1}\\
\mathbf{elif}\;t1 \leq 5.3 \cdot 10^{-169}:\\
\;\;\;\;\frac{\frac{v}{-u} \cdot t1}{u + t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t1}{\left(-t1\right) - u} \cdot v}{t1}\\
\end{array}
\end{array}
if t1 < -1.2500000000000001e43Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
Taylor expanded in u around 0
Applied rewrites61.5%
if -1.2500000000000001e43 < t1 < 5.3e-169Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6497.8
Applied rewrites97.8%
Taylor expanded in u around inf
lower-*.f6451.4
Applied rewrites51.4%
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-identity51.4
Applied rewrites51.4%
if 5.3e-169 < t1 Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
Taylor expanded in u around 0
Applied rewrites70.8%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -1.25e+43)
(/ (* -1.0 v) (+ u t1))
(if (<= t1 2.6e-171)
(/ (* (/ t1 (+ u t1)) v) (- u))
(/ (* (/ t1 (- (- t1) u)) v) t1))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.25e+43) {
tmp = (-1.0 * v) / (u + t1);
} else if (t1 <= 2.6e-171) {
tmp = ((t1 / (u + t1)) * v) / -u;
} else {
tmp = ((t1 / (-t1 - u)) * 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.25d+43)) then
tmp = ((-1.0d0) * v) / (u + t1)
else if (t1 <= 2.6d-171) then
tmp = ((t1 / (u + t1)) * v) / -u
else
tmp = ((t1 / (-t1 - u)) * v) / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.25e+43) {
tmp = (-1.0 * v) / (u + t1);
} else if (t1 <= 2.6e-171) {
tmp = ((t1 / (u + t1)) * v) / -u;
} else {
tmp = ((t1 / (-t1 - u)) * v) / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -1.25e+43: tmp = (-1.0 * v) / (u + t1) elif t1 <= 2.6e-171: tmp = ((t1 / (u + t1)) * v) / -u else: tmp = ((t1 / (-t1 - u)) * v) / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.25e+43) tmp = Float64(Float64(-1.0 * v) / Float64(u + t1)); elseif (t1 <= 2.6e-171) tmp = Float64(Float64(Float64(t1 / Float64(u + t1)) * v) / Float64(-u)); else tmp = Float64(Float64(Float64(t1 / Float64(Float64(-t1) - u)) * v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -1.25e+43) tmp = (-1.0 * v) / (u + t1); elseif (t1 <= 2.6e-171) tmp = ((t1 / (u + t1)) * v) / -u; else tmp = ((t1 / (-t1 - u)) * v) / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -1.25e+43], N[(N[(-1.0 * v), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 2.6e-171], N[(N[(N[(t1 / N[(u + t1), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / (-u)), $MachinePrecision], N[(N[(N[(t1 / N[((-t1) - u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / t1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.25 \cdot 10^{+43}:\\
\;\;\;\;\frac{-1 \cdot v}{u + t1}\\
\mathbf{elif}\;t1 \leq 2.6 \cdot 10^{-171}:\\
\;\;\;\;\frac{\frac{t1}{u + t1} \cdot v}{-u}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t1}{\left(-t1\right) - u} \cdot v}{t1}\\
\end{array}
\end{array}
if t1 < -1.2500000000000001e43Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
Taylor expanded in u around 0
Applied rewrites61.5%
if -1.2500000000000001e43 < t1 < 2.60000000000000005e-171Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6497.8
Applied rewrites97.8%
Taylor expanded in u around inf
lower-*.f6451.4
Applied rewrites51.4%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*r/N/A
remove-double-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
associate-*l/N/A
Applied rewrites51.9%
if 2.60000000000000005e-171 < t1 Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
Taylor expanded in u around 0
Applied rewrites70.8%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* (/ v (* (- u) (+ u t1))) t1))) (if (<= u -2.2e+24) t_1 (if (<= u 1.3e-63) (/ (- v) t1) t_1))))
double code(double u, double v, double t1) {
double t_1 = (v / (-u * (u + t1))) * t1;
double tmp;
if (u <= -2.2e+24) {
tmp = t_1;
} else if (u <= 1.3e-63) {
tmp = -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 = (v / (-u * (u + t1))) * t1
if (u <= (-2.2d+24)) then
tmp = t_1
else if (u <= 1.3d-63) then
tmp = -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 = (v / (-u * (u + t1))) * t1;
double tmp;
if (u <= -2.2e+24) {
tmp = t_1;
} else if (u <= 1.3e-63) {
tmp = -v / t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (v / (-u * (u + t1))) * t1 tmp = 0 if u <= -2.2e+24: tmp = t_1 elif u <= 1.3e-63: tmp = -v / t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(v / Float64(Float64(-u) * Float64(u + t1))) * t1) tmp = 0.0 if (u <= -2.2e+24) tmp = t_1; elseif (u <= 1.3e-63) tmp = Float64(Float64(-v) / t1); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (v / (-u * (u + t1))) * t1; tmp = 0.0; if (u <= -2.2e+24) tmp = t_1; elseif (u <= 1.3e-63) tmp = -v / t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(v / N[((-u) * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision]}, If[LessEqual[u, -2.2e+24], t$95$1, If[LessEqual[u, 1.3e-63], N[((-v) / t1), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{\left(-u\right) \cdot \left(u + t1\right)} \cdot t1\\
\mathbf{if}\;u \leq -2.2 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 1.3 \cdot 10^{-63}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -2.20000000000000002e24 or 1.3000000000000001e-63 < u Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6497.8
Applied rewrites97.8%
Taylor expanded in u around inf
lower-*.f6451.4
Applied rewrites51.4%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites48.5%
if -2.20000000000000002e24 < u < 1.3000000000000001e-63Initial program 73.0%
Taylor expanded in u around 0
lower-*.f64N/A
lower-/.f6453.8
Applied rewrites53.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6453.8
Applied rewrites53.8%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* -1.0 v) (+ u t1))))
(if (<= t1 -5.2e+42)
t_1
(if (<= t1 2.3e-131) (* (/ 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 <= -5.2e+42) {
tmp = t_1;
} else if (t1 <= 2.3e-131) {
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 <= (-5.2d+42)) then
tmp = t_1
else if (t1 <= 2.3d-131) 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 <= -5.2e+42) {
tmp = t_1;
} else if (t1 <= 2.3e-131) {
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 <= -5.2e+42: tmp = t_1 elif t1 <= 2.3e-131: 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 <= -5.2e+42) tmp = t_1; elseif (t1 <= 2.3e-131) 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 <= -5.2e+42) tmp = t_1; elseif (t1 <= 2.3e-131) 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, -5.2e+42], t$95$1, If[LessEqual[t1, 2.3e-131], 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 -5.2 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.3 \cdot 10^{-131}:\\
\;\;\;\;\frac{t1}{\left(-u\right) \cdot \left(u + t1\right)} \cdot v\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -5.1999999999999998e42 or 2.30000000000000022e-131 < t1 Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
Taylor expanded in u around 0
Applied rewrites61.5%
if -5.1999999999999998e42 < t1 < 2.30000000000000022e-131Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6497.8
Applied rewrites97.8%
Taylor expanded in u around inf
lower-*.f6451.4
Applied rewrites51.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites46.3%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* -1.0 v) (+ u t1))))
(if (<= t1 -2.55e-161)
t_1
(if (<= t1 7.2e-154) (/ (* (/ 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 <= -2.55e-161) {
tmp = t_1;
} else if (t1 <= 7.2e-154) {
tmp = ((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 <= (-2.55d-161)) then
tmp = t_1
else if (t1 <= 7.2d-154) then
tmp = ((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 <= -2.55e-161) {
tmp = t_1;
} else if (t1 <= 7.2e-154) {
tmp = ((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 <= -2.55e-161: tmp = t_1 elif t1 <= 7.2e-154: tmp = ((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 <= -2.55e-161) tmp = t_1; elseif (t1 <= 7.2e-154) tmp = Float64(Float64(Float64(t1 / u) * Float64(-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 <= -2.55e-161) tmp = t_1; elseif (t1 <= 7.2e-154) tmp = ((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, -2.55e-161], t$95$1, If[LessEqual[t1, 7.2e-154], N[(N[(N[(t1 / u), $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.55 \cdot 10^{-161}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 7.2 \cdot 10^{-154}:\\
\;\;\;\;\frac{\frac{t1}{u} \cdot \left(-v\right)}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -2.5500000000000002e-161 or 7.2000000000000006e-154 < t1 Initial program 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
Taylor expanded in u around 0
Applied rewrites61.5%
if -2.5500000000000002e-161 < t1 < 7.2000000000000006e-154Initial program 73.0%
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
*-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites83.0%
Taylor expanded in u around 0
Applied rewrites52.4%
Taylor expanded in u around 0
Applied rewrites48.4%
lift-*.f64N/A
remove-double-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
distribute-rgt-neg-inN/A
lift-neg.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6453.8
Applied rewrites53.8%
Taylor expanded in u around inf
lower-/.f6425.8
Applied rewrites25.8%
(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 73.0%
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--.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
Taylor expanded in u around 0
Applied rewrites61.5%
(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 73.0%
Taylor expanded in u around 0
lower-*.f64N/A
lower-/.f6453.8
Applied rewrites53.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6453.8
Applied rewrites53.8%
herbie shell --seed 2025159
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))