
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- y (* (/ (- t z) (- t a)) y)) x)))
(if (<= a -1.6e-121)
t_1
(if (<= a 1.35e-156) (- x (* -1.0 (/ (- (* y z) (* a y)) t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (((t - z) / (t - a)) * y)) + x;
double tmp;
if (a <= -1.6e-121) {
tmp = t_1;
} else if (a <= 1.35e-156) {
tmp = x - (-1.0 * (((y * z) - (a * y)) / t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y - (((t - z) / (t - a)) * y)) + x
if (a <= (-1.6d-121)) then
tmp = t_1
else if (a <= 1.35d-156) then
tmp = x - ((-1.0d0) * (((y * z) - (a * y)) / t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (((t - z) / (t - a)) * y)) + x;
double tmp;
if (a <= -1.6e-121) {
tmp = t_1;
} else if (a <= 1.35e-156) {
tmp = x - (-1.0 * (((y * z) - (a * y)) / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (((t - z) / (t - a)) * y)) + x tmp = 0 if a <= -1.6e-121: tmp = t_1 elif a <= 1.35e-156: tmp = x - (-1.0 * (((y * z) - (a * y)) / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(Float64(Float64(t - z) / Float64(t - a)) * y)) + x) tmp = 0.0 if (a <= -1.6e-121) tmp = t_1; elseif (a <= 1.35e-156) tmp = Float64(x - Float64(-1.0 * Float64(Float64(Float64(y * z) - Float64(a * y)) / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (((t - z) / (t - a)) * y)) + x; tmp = 0.0; if (a <= -1.6e-121) tmp = t_1; elseif (a <= 1.35e-156) tmp = x - (-1.0 * (((y * z) - (a * y)) / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.6e-121], t$95$1, If[LessEqual[a, 1.35e-156], N[(x - N[(-1.0 * N[(N[(N[(y * z), $MachinePrecision] - N[(a * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - \frac{t - z}{t - a} \cdot y\right) + x\\
\mathbf{if}\;a \leq -1.6 \cdot 10^{-121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-156}:\\
\;\;\;\;x - -1 \cdot \frac{y \cdot z - a \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.60000000000000009e-121 or 1.35000000000000006e-156 < a Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6489.8
Applied rewrites89.8%
if -1.60000000000000009e-121 < a < 1.35000000000000006e-156Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.2
Applied rewrites57.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- y (* (/ (- t z) (- t a)) y)) x)))
(if (<= a -5.1e-120)
t_1
(if (<= a 1.7e-62) (- x (/ (* y z) (- a t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (((t - z) / (t - a)) * y)) + x;
double tmp;
if (a <= -5.1e-120) {
tmp = t_1;
} else if (a <= 1.7e-62) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y - (((t - z) / (t - a)) * y)) + x
if (a <= (-5.1d-120)) then
tmp = t_1
else if (a <= 1.7d-62) then
tmp = x - ((y * z) / (a - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (((t - z) / (t - a)) * y)) + x;
double tmp;
if (a <= -5.1e-120) {
tmp = t_1;
} else if (a <= 1.7e-62) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (((t - z) / (t - a)) * y)) + x tmp = 0 if a <= -5.1e-120: tmp = t_1 elif a <= 1.7e-62: tmp = x - ((y * z) / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(Float64(Float64(t - z) / Float64(t - a)) * y)) + x) tmp = 0.0 if (a <= -5.1e-120) tmp = t_1; elseif (a <= 1.7e-62) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (((t - z) / (t - a)) * y)) + x; tmp = 0.0; if (a <= -5.1e-120) tmp = t_1; elseif (a <= 1.7e-62) tmp = x - ((y * z) / (a - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -5.1e-120], t$95$1, If[LessEqual[a, 1.7e-62], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - \frac{t - z}{t - a} \cdot y\right) + x\\
\mathbf{if}\;a \leq -5.1 \cdot 10^{-120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-62}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.0999999999999998e-120 or 1.69999999999999994e-62 < a Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6489.8
Applied rewrites89.8%
if -5.0999999999999998e-120 < a < 1.69999999999999994e-62Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6474.1
Applied rewrites74.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -7e-118) (- x (- (* (- z t) (/ y (- a t))) y)) (if (<= a 1.4e-43) (- x (/ (* y z) (- a t))) (- (+ x y) (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7e-118) {
tmp = x - (((z - t) * (y / (a - t))) - y);
} else if (a <= 1.4e-43) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-7d-118)) then
tmp = x - (((z - t) * (y / (a - t))) - y)
else if (a <= 1.4d-43) then
tmp = x - ((y * z) / (a - t))
else
tmp = (x + y) - (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7e-118) {
tmp = x - (((z - t) * (y / (a - t))) - y);
} else if (a <= 1.4e-43) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7e-118: tmp = x - (((z - t) * (y / (a - t))) - y) elif a <= 1.4e-43: tmp = x - ((y * z) / (a - t)) else: tmp = (x + y) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7e-118) tmp = Float64(x - Float64(Float64(Float64(z - t) * Float64(y / Float64(a - t))) - y)); elseif (a <= 1.4e-43) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -7e-118) tmp = x - (((z - t) * (y / (a - t))) - y); elseif (a <= 1.4e-43) tmp = x - ((y * z) / (a - t)); else tmp = (x + y) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7e-118], N[(x - N[(N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.4e-43], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{-118}:\\
\;\;\;\;x - \left(\left(z - t\right) \cdot \frac{y}{a - t} - y\right)\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{-43}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -7e-118Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
if -7e-118 < a < 1.3999999999999999e-43Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6474.1
Applied rewrites74.1%
if 1.3999999999999999e-43 < a Initial program 77.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.1
Applied rewrites84.1%
Taylor expanded in t around 0
lower-/.f6467.6
Applied rewrites67.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.05e-28) (+ (fma (/ y (- t a)) (- z t) y) x) (if (<= a 1.4e-43) (- x (/ (* y z) (- a t))) (- (+ x y) (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.05e-28) {
tmp = fma((y / (t - a)), (z - t), y) + x;
} else if (a <= 1.4e-43) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.05e-28) tmp = Float64(fma(Float64(y / Float64(t - a)), Float64(z - t), y) + x); elseif (a <= 1.4e-43) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.05e-28], N[(N[(N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.4e-43], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.05 \cdot 10^{-28}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t - a}, z - t, y\right) + x\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{-43}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -1.05000000000000003e-28Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6483.4
Applied rewrites83.4%
if -1.05000000000000003e-28 < a < 1.3999999999999999e-43Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6474.1
Applied rewrites74.1%
if 1.3999999999999999e-43 < a Initial program 77.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.1
Applied rewrites84.1%
Taylor expanded in t around 0
lower-/.f6467.6
Applied rewrites67.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.15e+33) (fma (- t z) (/ y a) (+ x y)) (if (<= a 1.4e-43) (- x (/ (* y z) (- a t))) (- (+ x y) (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.15e+33) {
tmp = fma((t - z), (y / a), (x + y));
} else if (a <= 1.4e-43) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.15e+33) tmp = fma(Float64(t - z), Float64(y / a), Float64(x + y)); elseif (a <= 1.4e-43) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.15e+33], N[(N[(t - z), $MachinePrecision] * N[(y / a), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.4e-43], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.15 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(t - z, \frac{y}{a}, x + y\right)\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{-43}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -2.15000000000000014e33Initial program 77.6%
Taylor expanded in t around 0
Applied rewrites58.6%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6462.3
Applied rewrites62.3%
if -2.15000000000000014e33 < a < 1.3999999999999999e-43Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6474.1
Applied rewrites74.1%
if 1.3999999999999999e-43 < a Initial program 77.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.1
Applied rewrites84.1%
Taylor expanded in t around 0
lower-/.f6467.6
Applied rewrites67.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.25e+33) (- (+ x y) (* z (/ y a))) (if (<= a 1.4e-43) (- x (/ (* y z) (- a t))) (- (+ x y) (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.25e+33) {
tmp = (x + y) - (z * (y / a));
} else if (a <= 1.4e-43) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.25d+33)) then
tmp = (x + y) - (z * (y / a))
else if (a <= 1.4d-43) then
tmp = x - ((y * z) / (a - t))
else
tmp = (x + y) - (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.25e+33) {
tmp = (x + y) - (z * (y / a));
} else if (a <= 1.4e-43) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.25e+33: tmp = (x + y) - (z * (y / a)) elif a <= 1.4e-43: tmp = x - ((y * z) / (a - t)) else: tmp = (x + y) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.25e+33) tmp = Float64(Float64(x + y) - Float64(z * Float64(y / a))); elseif (a <= 1.4e-43) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.25e+33) tmp = (x + y) - (z * (y / a)); elseif (a <= 1.4e-43) tmp = x - ((y * z) / (a - t)); else tmp = (x + y) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.25e+33], N[(N[(x + y), $MachinePrecision] - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.4e-43], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{+33}:\\
\;\;\;\;\left(x + y\right) - z \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{-43}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -1.24999999999999993e33Initial program 77.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6465.8
Applied rewrites65.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.5
Applied rewrites67.5%
if -1.24999999999999993e33 < a < 1.3999999999999999e-43Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6474.1
Applied rewrites74.1%
if 1.3999999999999999e-43 < a Initial program 77.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.1
Applied rewrites84.1%
Taylor expanded in t around 0
lower-/.f6467.6
Applied rewrites67.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (* z (/ y a)))))
(if (<= a -1.25e+33)
t_1
(if (<= a 1.4e-43) (- x (/ (* y z) (- a t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (z * (y / a));
double tmp;
if (a <= -1.25e+33) {
tmp = t_1;
} else if (a <= 1.4e-43) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (x + y) - (z * (y / a))
if (a <= (-1.25d+33)) then
tmp = t_1
else if (a <= 1.4d-43) then
tmp = x - ((y * z) / (a - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (z * (y / a));
double tmp;
if (a <= -1.25e+33) {
tmp = t_1;
} else if (a <= 1.4e-43) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (z * (y / a)) tmp = 0 if a <= -1.25e+33: tmp = t_1 elif a <= 1.4e-43: tmp = x - ((y * z) / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(z * Float64(y / a))) tmp = 0.0 if (a <= -1.25e+33) tmp = t_1; elseif (a <= 1.4e-43) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (z * (y / a)); tmp = 0.0; if (a <= -1.25e+33) tmp = t_1; elseif (a <= 1.4e-43) tmp = x - ((y * z) / (a - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.25e+33], t$95$1, If[LessEqual[a, 1.4e-43], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - z \cdot \frac{y}{a}\\
\mathbf{if}\;a \leq -1.25 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{-43}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.24999999999999993e33 or 1.3999999999999999e-43 < a Initial program 77.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6465.8
Applied rewrites65.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.5
Applied rewrites67.5%
if -1.24999999999999993e33 < a < 1.3999999999999999e-43Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6474.1
Applied rewrites74.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (- y))))
(if (<= a -2.2e+164)
t_1
(if (<= a 380000000000.0) (- x (/ (* y z) (- a t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - -y;
double tmp;
if (a <= -2.2e+164) {
tmp = t_1;
} else if (a <= 380000000000.0) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - -y
if (a <= (-2.2d+164)) then
tmp = t_1
else if (a <= 380000000000.0d0) then
tmp = x - ((y * z) / (a - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - -y;
double tmp;
if (a <= -2.2e+164) {
tmp = t_1;
} else if (a <= 380000000000.0) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - -y tmp = 0 if a <= -2.2e+164: tmp = t_1 elif a <= 380000000000.0: tmp = x - ((y * z) / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(-y)) tmp = 0.0 if (a <= -2.2e+164) tmp = t_1; elseif (a <= 380000000000.0) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - -y; tmp = 0.0; if (a <= -2.2e+164) tmp = t_1; elseif (a <= 380000000000.0) tmp = x - ((y * z) / (a - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - (-y)), $MachinePrecision]}, If[LessEqual[a, -2.2e+164], t$95$1, If[LessEqual[a, 380000000000.0], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \left(-y\right)\\
\mathbf{if}\;a \leq -2.2 \cdot 10^{+164}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 380000000000:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.20000000000000006e164 or 3.8e11 < a Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in a around inf
lower-*.f6460.9
Applied rewrites60.9%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6460.9
Applied rewrites60.9%
if -2.20000000000000006e164 < a < 3.8e11Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6474.1
Applied rewrites74.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* (- z t) y) (- a t)))) (t_2 (- x (- y))))
(if (<= t_1 (- INFINITY))
(* z (/ y (- t a)))
(if (<= t_1 -1e-146)
t_2
(if (<= t_1 5e-252)
(+ (- y (* 1.0 y)) x)
(if (<= t_1 2e+270) t_2 (* (/ z (- t a)) y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double t_2 = x - -y;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z * (y / (t - a));
} else if (t_1 <= -1e-146) {
tmp = t_2;
} else if (t_1 <= 5e-252) {
tmp = (y - (1.0 * y)) + x;
} else if (t_1 <= 2e+270) {
tmp = t_2;
} else {
tmp = (z / (t - a)) * y;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double t_2 = x - -y;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = z * (y / (t - a));
} else if (t_1 <= -1e-146) {
tmp = t_2;
} else if (t_1 <= 5e-252) {
tmp = (y - (1.0 * y)) + x;
} else if (t_1 <= 2e+270) {
tmp = t_2;
} else {
tmp = (z / (t - a)) * y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (((z - t) * y) / (a - t)) t_2 = x - -y tmp = 0 if t_1 <= -math.inf: tmp = z * (y / (t - a)) elif t_1 <= -1e-146: tmp = t_2 elif t_1 <= 5e-252: tmp = (y - (1.0 * y)) + x elif t_1 <= 2e+270: tmp = t_2 else: tmp = (z / (t - a)) * y return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) t_2 = Float64(x - Float64(-y)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z * Float64(y / Float64(t - a))); elseif (t_1 <= -1e-146) tmp = t_2; elseif (t_1 <= 5e-252) tmp = Float64(Float64(y - Float64(1.0 * y)) + x); elseif (t_1 <= 2e+270) tmp = t_2; else tmp = Float64(Float64(z / Float64(t - a)) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (((z - t) * y) / (a - t)); t_2 = x - -y; tmp = 0.0; if (t_1 <= -Inf) tmp = z * (y / (t - a)); elseif (t_1 <= -1e-146) tmp = t_2; elseif (t_1 <= 5e-252) tmp = (y - (1.0 * y)) + x; elseif (t_1 <= 2e+270) tmp = t_2; else tmp = (z / (t - a)) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - (-y)), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-146], t$95$2, If[LessEqual[t$95$1, 5e-252], N[(N[(y - N[(1.0 * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+270], t$95$2, N[(N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
t_2 := x - \left(-y\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;z \cdot \frac{y}{t - a}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-146}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-252}:\\
\;\;\;\;\left(y - 1 \cdot y\right) + x\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+270}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{t - a} \cdot y\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 77.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.1
Applied rewrites84.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.4
Applied rewrites26.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6428.3
Applied rewrites28.3%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1.00000000000000003e-146 or 5.00000000000000008e-252 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 2.0000000000000001e270Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in a around inf
lower-*.f6460.9
Applied rewrites60.9%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6460.9
Applied rewrites60.9%
if -1.00000000000000003e-146 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 5.00000000000000008e-252Initial program 77.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.1
Applied rewrites84.1%
Taylor expanded in t around inf
Applied rewrites45.4%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6451.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6451.3
Applied rewrites51.3%
if 2.0000000000000001e270 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 77.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.1
Applied rewrites84.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.4
Applied rewrites26.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6428.5
Applied rewrites28.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ y (- t a))))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t))))
(t_3 (- x (- y))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -1e-146)
t_3
(if (<= t_2 5e-252)
(+ (- y (* 1.0 y)) x)
(if (<= t_2 2e+270) t_3 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / (t - a));
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double t_3 = x - -y;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -1e-146) {
tmp = t_3;
} else if (t_2 <= 5e-252) {
tmp = (y - (1.0 * y)) + x;
} else if (t_2 <= 2e+270) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / (t - a));
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double t_3 = x - -y;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -1e-146) {
tmp = t_3;
} else if (t_2 <= 5e-252) {
tmp = (y - (1.0 * y)) + x;
} else if (t_2 <= 2e+270) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / (t - a)) t_2 = (x + y) - (((z - t) * y) / (a - t)) t_3 = x - -y tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -1e-146: tmp = t_3 elif t_2 <= 5e-252: tmp = (y - (1.0 * y)) + x elif t_2 <= 2e+270: tmp = t_3 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / Float64(t - a))) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) t_3 = Float64(x - Float64(-y)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -1e-146) tmp = t_3; elseif (t_2 <= 5e-252) tmp = Float64(Float64(y - Float64(1.0 * y)) + x); elseif (t_2 <= 2e+270) tmp = t_3; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / (t - a)); t_2 = (x + y) - (((z - t) * y) / (a - t)); t_3 = x - -y; tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -1e-146) tmp = t_3; elseif (t_2 <= 5e-252) tmp = (y - (1.0 * y)) + x; elseif (t_2 <= 2e+270) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x - (-y)), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -1e-146], t$95$3, If[LessEqual[t$95$2, 5e-252], N[(N[(y - N[(1.0 * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$2, 2e+270], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{t - a}\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
t_3 := x - \left(-y\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-146}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-252}:\\
\;\;\;\;\left(y - 1 \cdot y\right) + x\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+270}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0 or 2.0000000000000001e270 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 77.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.1
Applied rewrites84.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.4
Applied rewrites26.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6428.3
Applied rewrites28.3%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1.00000000000000003e-146 or 5.00000000000000008e-252 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 2.0000000000000001e270Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in a around inf
lower-*.f6460.9
Applied rewrites60.9%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6460.9
Applied rewrites60.9%
if -1.00000000000000003e-146 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 5.00000000000000008e-252Initial program 77.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.1
Applied rewrites84.1%
Taylor expanded in t around inf
Applied rewrites45.4%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6451.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6451.3
Applied rewrites51.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (- y)))) (if (<= a -3.9e+21) t_1 (if (<= a 1.35e-43) (+ (- y (* 1.0 y)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - -y;
double tmp;
if (a <= -3.9e+21) {
tmp = t_1;
} else if (a <= 1.35e-43) {
tmp = (y - (1.0 * y)) + x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - -y
if (a <= (-3.9d+21)) then
tmp = t_1
else if (a <= 1.35d-43) then
tmp = (y - (1.0d0 * y)) + x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - -y;
double tmp;
if (a <= -3.9e+21) {
tmp = t_1;
} else if (a <= 1.35e-43) {
tmp = (y - (1.0 * y)) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - -y tmp = 0 if a <= -3.9e+21: tmp = t_1 elif a <= 1.35e-43: tmp = (y - (1.0 * y)) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(-y)) tmp = 0.0 if (a <= -3.9e+21) tmp = t_1; elseif (a <= 1.35e-43) tmp = Float64(Float64(y - Float64(1.0 * y)) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - -y; tmp = 0.0; if (a <= -3.9e+21) tmp = t_1; elseif (a <= 1.35e-43) tmp = (y - (1.0 * y)) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - (-y)), $MachinePrecision]}, If[LessEqual[a, -3.9e+21], t$95$1, If[LessEqual[a, 1.35e-43], N[(N[(y - N[(1.0 * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \left(-y\right)\\
\mathbf{if}\;a \leq -3.9 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-43}:\\
\;\;\;\;\left(y - 1 \cdot y\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.9e21 or 1.34999999999999996e-43 < a Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in a around inf
lower-*.f6460.9
Applied rewrites60.9%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6460.9
Applied rewrites60.9%
if -3.9e21 < a < 1.34999999999999996e-43Initial program 77.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.1
Applied rewrites84.1%
Taylor expanded in t around inf
Applied rewrites45.4%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6451.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6451.3
Applied rewrites51.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (- y)))) (if (<= a -1.36e-49) t_1 (if (<= a 1.95e-208) (/ (* y z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - -y;
double tmp;
if (a <= -1.36e-49) {
tmp = t_1;
} else if (a <= 1.95e-208) {
tmp = (y * z) / t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - -y
if (a <= (-1.36d-49)) then
tmp = t_1
else if (a <= 1.95d-208) then
tmp = (y * z) / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - -y;
double tmp;
if (a <= -1.36e-49) {
tmp = t_1;
} else if (a <= 1.95e-208) {
tmp = (y * z) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - -y tmp = 0 if a <= -1.36e-49: tmp = t_1 elif a <= 1.95e-208: tmp = (y * z) / t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(-y)) tmp = 0.0 if (a <= -1.36e-49) tmp = t_1; elseif (a <= 1.95e-208) tmp = Float64(Float64(y * z) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - -y; tmp = 0.0; if (a <= -1.36e-49) tmp = t_1; elseif (a <= 1.95e-208) tmp = (y * z) / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - (-y)), $MachinePrecision]}, If[LessEqual[a, -1.36e-49], t$95$1, If[LessEqual[a, 1.95e-208], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \left(-y\right)\\
\mathbf{if}\;a \leq -1.36 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{-208}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.36000000000000006e-49 or 1.95000000000000002e-208 < a Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in a around inf
lower-*.f6460.9
Applied rewrites60.9%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6460.9
Applied rewrites60.9%
if -1.36000000000000006e-49 < a < 1.95000000000000002e-208Initial program 77.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.1
Applied rewrites84.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.4
Applied rewrites26.4%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f6418.2
Applied rewrites18.2%
(FPCore (x y z t a) :precision binary64 (- x (- y)))
double code(double x, double y, double z, double t, double a) {
return x - -y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - -y
end function
public static double code(double x, double y, double z, double t, double a) {
return x - -y;
}
def code(x, y, z, t, a): return x - -y
function code(x, y, z, t, a) return Float64(x - Float64(-y)) end
function tmp = code(x, y, z, t, a) tmp = x - -y; end
code[x_, y_, z_, t_, a_] := N[(x - (-y)), $MachinePrecision]
\begin{array}{l}
\\
x - \left(-y\right)
\end{array}
Initial program 77.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6480.7
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lower--.f6487.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in a around inf
lower-*.f6460.9
Applied rewrites60.9%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6460.9
Applied rewrites60.9%
herbie shell --seed 2025156
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
(- (+ x y) (/ (* (- z t) y) (- a t))))