
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
(FPCore (x y z t a) :precision binary64 (- x (* (/ (- z y) (- -1.0 (- t z))) a)))
double code(double x, double y, double z, double t, double a) {
return x - (((z - y) / (-1.0 - (t - z))) * a);
}
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 - (((z - y) / ((-1.0d0) - (t - z))) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((z - y) / (-1.0 - (t - z))) * a);
}
def code(x, y, z, t, a): return x - (((z - y) / (-1.0 - (t - z))) * a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(z - y) / Float64(-1.0 - Float64(t - z))) * a)) end
function tmp = code(x, y, z, t, a) tmp = x - (((z - y) / (-1.0 - (t - z))) * a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(z - y), $MachinePrecision] / N[(-1.0 - N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
x - \frac{z - y}{-1 - \left(t - z\right)} \cdot a
Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
(FPCore (x y z t a) :precision binary64 (- x (* (/ a (- (- t z) -1.0)) (- y z))))
double code(double x, double y, double z, double t, double a) {
return x - ((a / ((t - z) - -1.0)) * (y - z));
}
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 - ((a / ((t - z) - (-1.0d0))) * (y - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((a / ((t - z) - -1.0)) * (y - z));
}
def code(x, y, z, t, a): return x - ((a / ((t - z) - -1.0)) * (y - z))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(a / Float64(Float64(t - z) - -1.0)) * Float64(y - z))) end
function tmp = code(x, y, z, t, a) tmp = x - ((a / ((t - z) - -1.0)) * (y - z)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(a / N[(N[(t - z), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \frac{a}{\left(t - z\right) - -1} \cdot \left(y - z\right)
Initial program 97.1%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f6497.4%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval97.4%
Applied rewrites97.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* (/ (- z y) (- z 1.0)) a))))
(if (<= z -1.25e+63)
t_1
(if (<= z 3.2e+74) (- x (* (/ y (+ 1.0 t)) a)) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x - (((z - y) / (z - 1.0)) * a);
double tmp;
if (z <= -1.25e+63) {
tmp = t_1;
} else if (z <= 3.2e+74) {
tmp = x - ((y / (1.0 + t)) * a);
} 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 - (((z - y) / (z - 1.0d0)) * a)
if (z <= (-1.25d+63)) then
tmp = t_1
else if (z <= 3.2d+74) then
tmp = x - ((y / (1.0d0 + t)) * a)
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 - (((z - y) / (z - 1.0)) * a);
double tmp;
if (z <= -1.25e+63) {
tmp = t_1;
} else if (z <= 3.2e+74) {
tmp = x - ((y / (1.0 + t)) * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (((z - y) / (z - 1.0)) * a) tmp = 0 if z <= -1.25e+63: tmp = t_1 elif z <= 3.2e+74: tmp = x - ((y / (1.0 + t)) * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(Float64(z - y) / Float64(z - 1.0)) * a)) tmp = 0.0 if (z <= -1.25e+63) tmp = t_1; elseif (z <= 3.2e+74) tmp = Float64(x - Float64(Float64(y / Float64(1.0 + t)) * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (((z - y) / (z - 1.0)) * a); tmp = 0.0; if (z <= -1.25e+63) tmp = t_1; elseif (z <= 3.2e+74) tmp = x - ((y / (1.0 + t)) * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(N[(z - y), $MachinePrecision] / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e+63], t$95$1, If[LessEqual[z, 3.2e+74], N[(x - N[(N[(y / N[(1.0 + t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - \frac{z - y}{z - 1} \cdot a\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+74}:\\
\;\;\;\;x - \frac{y}{1 + t} \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.25e63 or 3.1999999999999999e74 < z Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in t around 0
lower--.f6480.4%
Applied rewrites80.4%
if -1.25e63 < z < 3.1999999999999999e74Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f6472.0%
Applied rewrites72.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* (/ z (- -1.0 (- t z))) a))))
(if (<= z -1.25e+63)
t_1
(if (<= z 2.6e+17) (- x (* (/ y (+ 1.0 t)) a)) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((z / (-1.0 - (t - z))) * a);
double tmp;
if (z <= -1.25e+63) {
tmp = t_1;
} else if (z <= 2.6e+17) {
tmp = x - ((y / (1.0 + t)) * a);
} 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 - ((z / ((-1.0d0) - (t - z))) * a)
if (z <= (-1.25d+63)) then
tmp = t_1
else if (z <= 2.6d+17) then
tmp = x - ((y / (1.0d0 + t)) * a)
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 - ((z / (-1.0 - (t - z))) * a);
double tmp;
if (z <= -1.25e+63) {
tmp = t_1;
} else if (z <= 2.6e+17) {
tmp = x - ((y / (1.0 + t)) * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((z / (-1.0 - (t - z))) * a) tmp = 0 if z <= -1.25e+63: tmp = t_1 elif z <= 2.6e+17: tmp = x - ((y / (1.0 + t)) * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(z / Float64(-1.0 - Float64(t - z))) * a)) tmp = 0.0 if (z <= -1.25e+63) tmp = t_1; elseif (z <= 2.6e+17) tmp = Float64(x - Float64(Float64(y / Float64(1.0 + t)) * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((z / (-1.0 - (t - z))) * a); tmp = 0.0; if (z <= -1.25e+63) tmp = t_1; elseif (z <= 2.6e+17) tmp = x - ((y / (1.0 + t)) * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(z / N[(-1.0 - N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e+63], t$95$1, If[LessEqual[z, 2.6e+17], N[(x - N[(N[(y / N[(1.0 + t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - \frac{z}{-1 - \left(t - z\right)} \cdot a\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+17}:\\
\;\;\;\;x - \frac{y}{1 + t} \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.25e63 or 2.6e17 < z Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in y around 0
Applied rewrites74.0%
if -1.25e63 < z < 2.6e17Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f6472.0%
Applied rewrites72.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -9e+62) (- x a) (if (<= z 1.45e+71) (- x (* (/ y (+ 1.0 t)) a)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9e+62) {
tmp = x - a;
} else if (z <= 1.45e+71) {
tmp = x - ((y / (1.0 + t)) * a);
} else {
tmp = x - 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 (z <= (-9d+62)) then
tmp = x - a
else if (z <= 1.45d+71) then
tmp = x - ((y / (1.0d0 + t)) * a)
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9e+62) {
tmp = x - a;
} else if (z <= 1.45e+71) {
tmp = x - ((y / (1.0 + t)) * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9e+62: tmp = x - a elif z <= 1.45e+71: tmp = x - ((y / (1.0 + t)) * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9e+62) tmp = Float64(x - a); elseif (z <= 1.45e+71) tmp = Float64(x - Float64(Float64(y / Float64(1.0 + t)) * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9e+62) tmp = x - a; elseif (z <= 1.45e+71) tmp = x - ((y / (1.0 + t)) * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9e+62], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.45e+71], N[(x - N[(N[(y / N[(1.0 + t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+62}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+71}:\\
\;\;\;\;x - \frac{y}{1 + t} \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
if z < -9e62 or 1.45e71 < z Initial program 97.1%
Taylor expanded in z around inf
Applied rewrites59.5%
if -9e62 < z < 1.45e71Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f6472.0%
Applied rewrites72.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.6e+62) (- x a) (if (<= z 2.65e+17) (- x (/ (* a y) (+ 1.0 t))) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.6e+62) {
tmp = x - a;
} else if (z <= 2.65e+17) {
tmp = x - ((a * y) / (1.0 + t));
} else {
tmp = x - 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 (z <= (-8.6d+62)) then
tmp = x - a
else if (z <= 2.65d+17) then
tmp = x - ((a * y) / (1.0d0 + t))
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.6e+62) {
tmp = x - a;
} else if (z <= 2.65e+17) {
tmp = x - ((a * y) / (1.0 + t));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.6e+62: tmp = x - a elif z <= 2.65e+17: tmp = x - ((a * y) / (1.0 + t)) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.6e+62) tmp = Float64(x - a); elseif (z <= 2.65e+17) tmp = Float64(x - Float64(Float64(a * y) / Float64(1.0 + t))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.6e+62) tmp = x - a; elseif (z <= 2.65e+17) tmp = x - ((a * y) / (1.0 + t)); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.6e+62], N[(x - a), $MachinePrecision], If[LessEqual[z, 2.65e+17], N[(x - N[(N[(a * y), $MachinePrecision] / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+62}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{+17}:\\
\;\;\;\;x - \frac{a \cdot y}{1 + t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
if z < -8.5999999999999994e62 or 2.65e17 < z Initial program 97.1%
Taylor expanded in z around inf
Applied rewrites59.5%
if -8.5999999999999994e62 < z < 2.65e17Initial program 97.1%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6469.1%
Applied rewrites69.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.45e+35)
(- x (* (/ (- y z) t) a))
(if (<= t 1.15e-27)
(- x (* (+ y (* -1.0 (* t y))) a))
(- x (* (/ y t) a)))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.45e+35) {
tmp = x - (((y - z) / t) * a);
} else if (t <= 1.15e-27) {
tmp = x - ((y + (-1.0 * (t * y))) * a);
} else {
tmp = x - ((y / t) * 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 (t <= (-1.45d+35)) then
tmp = x - (((y - z) / t) * a)
else if (t <= 1.15d-27) then
tmp = x - ((y + ((-1.0d0) * (t * y))) * a)
else
tmp = x - ((y / t) * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.45e+35) {
tmp = x - (((y - z) / t) * a);
} else if (t <= 1.15e-27) {
tmp = x - ((y + (-1.0 * (t * y))) * a);
} else {
tmp = x - ((y / t) * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.45e+35: tmp = x - (((y - z) / t) * a) elif t <= 1.15e-27: tmp = x - ((y + (-1.0 * (t * y))) * a) else: tmp = x - ((y / t) * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.45e+35) tmp = Float64(x - Float64(Float64(Float64(y - z) / t) * a)); elseif (t <= 1.15e-27) tmp = Float64(x - Float64(Float64(y + Float64(-1.0 * Float64(t * y))) * a)); else tmp = Float64(x - Float64(Float64(y / t) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.45e+35) tmp = x - (((y - z) / t) * a); elseif (t <= 1.15e-27) tmp = x - ((y + (-1.0 * (t * y))) * a); else tmp = x - ((y / t) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.45e+35], N[(x - N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e-27], N[(x - N[(N[(y + N[(-1.0 * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+35}:\\
\;\;\;\;x - \frac{y - z}{t} \cdot a\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-27}:\\
\;\;\;\;x - \left(y + -1 \cdot \left(t \cdot y\right)\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t} \cdot a\\
\end{array}
if t < -1.45e35Initial program 97.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6450.4%
Applied rewrites50.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6453.6%
Applied rewrites53.6%
if -1.45e35 < t < 1.15e-27Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f6472.0%
Applied rewrites72.0%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6448.7%
Applied rewrites48.7%
if 1.15e-27 < t Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f6472.0%
Applied rewrites72.0%
Taylor expanded in t around inf
lower-/.f6456.2%
Applied rewrites56.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* (/ y t) a))))
(if (<= t -3.1e-7)
t_1
(if (<= t 1.15e-27) (- x (* (+ y (* -1.0 (* t y))) a)) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((y / t) * a);
double tmp;
if (t <= -3.1e-7) {
tmp = t_1;
} else if (t <= 1.15e-27) {
tmp = x - ((y + (-1.0 * (t * y))) * a);
} 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 / t) * a)
if (t <= (-3.1d-7)) then
tmp = t_1
else if (t <= 1.15d-27) then
tmp = x - ((y + ((-1.0d0) * (t * y))) * a)
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 / t) * a);
double tmp;
if (t <= -3.1e-7) {
tmp = t_1;
} else if (t <= 1.15e-27) {
tmp = x - ((y + (-1.0 * (t * y))) * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((y / t) * a) tmp = 0 if t <= -3.1e-7: tmp = t_1 elif t <= 1.15e-27: tmp = x - ((y + (-1.0 * (t * y))) * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(y / t) * a)) tmp = 0.0 if (t <= -3.1e-7) tmp = t_1; elseif (t <= 1.15e-27) tmp = Float64(x - Float64(Float64(y + Float64(-1.0 * Float64(t * y))) * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((y / t) * a); tmp = 0.0; if (t <= -3.1e-7) tmp = t_1; elseif (t <= 1.15e-27) tmp = x - ((y + (-1.0 * (t * y))) * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(y / t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.1e-7], t$95$1, If[LessEqual[t, 1.15e-27], N[(x - N[(N[(y + N[(-1.0 * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - \frac{y}{t} \cdot a\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-27}:\\
\;\;\;\;x - \left(y + -1 \cdot \left(t \cdot y\right)\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -3.1e-7 or 1.15e-27 < t Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f6472.0%
Applied rewrites72.0%
Taylor expanded in t around inf
lower-/.f6456.2%
Applied rewrites56.2%
if -3.1e-7 < t < 1.15e-27Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f6472.0%
Applied rewrites72.0%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6448.7%
Applied rewrites48.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.6e+62) (- x a) (if (<= z 8.6e+61) (- x (* (/ y t) a)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.6e+62) {
tmp = x - a;
} else if (z <= 8.6e+61) {
tmp = x - ((y / t) * a);
} else {
tmp = x - 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 (z <= (-8.6d+62)) then
tmp = x - a
else if (z <= 8.6d+61) then
tmp = x - ((y / t) * a)
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.6e+62) {
tmp = x - a;
} else if (z <= 8.6e+61) {
tmp = x - ((y / t) * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.6e+62: tmp = x - a elif z <= 8.6e+61: tmp = x - ((y / t) * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.6e+62) tmp = Float64(x - a); elseif (z <= 8.6e+61) tmp = Float64(x - Float64(Float64(y / t) * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.6e+62) tmp = x - a; elseif (z <= 8.6e+61) tmp = x - ((y / t) * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.6e+62], N[(x - a), $MachinePrecision], If[LessEqual[z, 8.6e+61], N[(x - N[(N[(y / t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+62}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{+61}:\\
\;\;\;\;x - \frac{y}{t} \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
if z < -8.5999999999999994e62 or 8.6000000000000003e61 < z Initial program 97.1%
Taylor expanded in z around inf
Applied rewrites59.5%
if -8.5999999999999994e62 < z < 8.6000000000000003e61Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f6472.0%
Applied rewrites72.0%
Taylor expanded in t around inf
lower-/.f6456.2%
Applied rewrites56.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.7e+62) (- x a) (if (<= z 5.9e+32) (- x (/ (* a y) t)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+62) {
tmp = x - a;
} else if (z <= 5.9e+32) {
tmp = x - ((a * y) / t);
} else {
tmp = x - 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 (z <= (-1.7d+62)) then
tmp = x - a
else if (z <= 5.9d+32) then
tmp = x - ((a * y) / t)
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+62) {
tmp = x - a;
} else if (z <= 5.9e+32) {
tmp = x - ((a * y) / t);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.7e+62: tmp = x - a elif z <= 5.9e+32: tmp = x - ((a * y) / t) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e+62) tmp = Float64(x - a); elseif (z <= 5.9e+32) tmp = Float64(x - Float64(Float64(a * y) / t)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.7e+62) tmp = x - a; elseif (z <= 5.9e+32) tmp = x - ((a * y) / t); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e+62], N[(x - a), $MachinePrecision], If[LessEqual[z, 5.9e+32], N[(x - N[(N[(a * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+62}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 5.9 \cdot 10^{+32}:\\
\;\;\;\;x - \frac{a \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
if z < -1.7000000000000001e62 or 5.8999999999999997e32 < z Initial program 97.1%
Taylor expanded in z around inf
Applied rewrites59.5%
if -1.7000000000000001e62 < z < 5.8999999999999997e32Initial program 97.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6450.4%
Applied rewrites50.4%
Taylor expanded in y around inf
lower-*.f6454.1%
Applied rewrites54.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ a (- z 1.0))))
(t_2 (/ (- y z) (/ (+ (- t z) 1.0) a))))
(if (<= t_2 -5e+270)
t_1
(if (<= t_2 -1e-44)
(- x a)
(if (<= t_2 2e-42)
(- (- x))
(if (<= t_2 1e+263) (- x a) t_1))))))double code(double x, double y, double z, double t, double a) {
double t_1 = y * (a / (z - 1.0));
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -5e+270) {
tmp = t_1;
} else if (t_2 <= -1e-44) {
tmp = x - a;
} else if (t_2 <= 2e-42) {
tmp = -(-x);
} else if (t_2 <= 1e+263) {
tmp = x - a;
} 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) :: t_2
real(8) :: tmp
t_1 = y * (a / (z - 1.0d0))
t_2 = (y - z) / (((t - z) + 1.0d0) / a)
if (t_2 <= (-5d+270)) then
tmp = t_1
else if (t_2 <= (-1d-44)) then
tmp = x - a
else if (t_2 <= 2d-42) then
tmp = -(-x)
else if (t_2 <= 1d+263) then
tmp = x - a
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 * (a / (z - 1.0));
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -5e+270) {
tmp = t_1;
} else if (t_2 <= -1e-44) {
tmp = x - a;
} else if (t_2 <= 2e-42) {
tmp = -(-x);
} else if (t_2 <= 1e+263) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (a / (z - 1.0)) t_2 = (y - z) / (((t - z) + 1.0) / a) tmp = 0 if t_2 <= -5e+270: tmp = t_1 elif t_2 <= -1e-44: tmp = x - a elif t_2 <= 2e-42: tmp = -(-x) elif t_2 <= 1e+263: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(a / Float64(z - 1.0))) t_2 = Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)) tmp = 0.0 if (t_2 <= -5e+270) tmp = t_1; elseif (t_2 <= -1e-44) tmp = Float64(x - a); elseif (t_2 <= 2e-42) tmp = Float64(-Float64(-x)); elseif (t_2 <= 1e+263) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (a / (z - 1.0)); t_2 = (y - z) / (((t - z) + 1.0) / a); tmp = 0.0; if (t_2 <= -5e+270) tmp = t_1; elseif (t_2 <= -1e-44) tmp = x - a; elseif (t_2 <= 2e-42) tmp = -(-x); elseif (t_2 <= 1e+263) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(a / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+270], t$95$1, If[LessEqual[t$95$2, -1e-44], N[(x - a), $MachinePrecision], If[LessEqual[t$95$2, 2e-42], (-(-x)), If[LessEqual[t$95$2, 1e+263], N[(x - a), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
t_1 := y \cdot \frac{a}{z - 1}\\
t_2 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+270}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-44}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-42}:\\
\;\;\;\;-\left(-x\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+263}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -4.9999999999999998e270 or 1e263 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6424.0%
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-+.f64N/A
distribute-neg-inN/A
metadata-evalN/A
sub-flipN/A
associate--r-N/A
associate-/l*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites26.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f6418.9%
Applied rewrites18.9%
if -4.9999999999999998e270 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -9.9999999999999995e-45 or 2.0000000000000001e-42 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 1e263Initial program 97.1%
Taylor expanded in z around inf
Applied rewrites59.5%
if -9.9999999999999995e-45 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 2.0000000000000001e-42Initial program 97.1%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f6488.1%
Applied rewrites88.1%
Taylor expanded in x around inf
lower-*.f6453.6%
Applied rewrites53.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6453.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6453.6%
Applied rewrites53.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* a y) (- z 1.0)))
(t_2 (/ (- y z) (/ (+ (- t z) 1.0) a))))
(if (<= t_2 -5e+270)
t_1
(if (<= t_2 -1e-44)
(- x a)
(if (<= t_2 2e-42)
(- (- x))
(if (<= t_2 2e+294) (- x a) t_1))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (a * y) / (z - 1.0);
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -5e+270) {
tmp = t_1;
} else if (t_2 <= -1e-44) {
tmp = x - a;
} else if (t_2 <= 2e-42) {
tmp = -(-x);
} else if (t_2 <= 2e+294) {
tmp = x - a;
} 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) :: t_2
real(8) :: tmp
t_1 = (a * y) / (z - 1.0d0)
t_2 = (y - z) / (((t - z) + 1.0d0) / a)
if (t_2 <= (-5d+270)) then
tmp = t_1
else if (t_2 <= (-1d-44)) then
tmp = x - a
else if (t_2 <= 2d-42) then
tmp = -(-x)
else if (t_2 <= 2d+294) then
tmp = x - a
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 = (a * y) / (z - 1.0);
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -5e+270) {
tmp = t_1;
} else if (t_2 <= -1e-44) {
tmp = x - a;
} else if (t_2 <= 2e-42) {
tmp = -(-x);
} else if (t_2 <= 2e+294) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * y) / (z - 1.0) t_2 = (y - z) / (((t - z) + 1.0) / a) tmp = 0 if t_2 <= -5e+270: tmp = t_1 elif t_2 <= -1e-44: tmp = x - a elif t_2 <= 2e-42: tmp = -(-x) elif t_2 <= 2e+294: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * y) / Float64(z - 1.0)) t_2 = Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)) tmp = 0.0 if (t_2 <= -5e+270) tmp = t_1; elseif (t_2 <= -1e-44) tmp = Float64(x - a); elseif (t_2 <= 2e-42) tmp = Float64(-Float64(-x)); elseif (t_2 <= 2e+294) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * y) / (z - 1.0); t_2 = (y - z) / (((t - z) + 1.0) / a); tmp = 0.0; if (t_2 <= -5e+270) tmp = t_1; elseif (t_2 <= -1e-44) tmp = x - a; elseif (t_2 <= 2e-42) tmp = -(-x); elseif (t_2 <= 2e+294) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a * y), $MachinePrecision] / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+270], t$95$1, If[LessEqual[t$95$2, -1e-44], N[(x - a), $MachinePrecision], If[LessEqual[t$95$2, 2e-42], (-(-x)), If[LessEqual[t$95$2, 2e+294], N[(x - a), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
t_1 := \frac{a \cdot y}{z - 1}\\
t_2 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+270}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-44}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-42}:\\
\;\;\;\;-\left(-x\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -4.9999999999999998e270 or 2.0000000000000001e294 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6424.0%
Applied rewrites24.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6418.0%
Applied rewrites18.0%
if -4.9999999999999998e270 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -9.9999999999999995e-45 or 2.0000000000000001e-42 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 2.0000000000000001e294Initial program 97.1%
Taylor expanded in z around inf
Applied rewrites59.5%
if -9.9999999999999995e-45 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 2.0000000000000001e-42Initial program 97.1%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f6488.1%
Applied rewrites88.1%
Taylor expanded in x around inf
lower-*.f6453.6%
Applied rewrites53.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6453.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6453.6%
Applied rewrites53.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y z) (/ (+ (- t z) 1.0) a))))
(if (<= t_1 -2e+84)
(* y (/ a (- -1.0 t)))
(if (<= t_1 2e-42)
(- (- x))
(if (<= t_1 1e+263) (- x a) (* y (/ a (- z 1.0))))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_1 <= -2e+84) {
tmp = y * (a / (-1.0 - t));
} else if (t_1 <= 2e-42) {
tmp = -(-x);
} else if (t_1 <= 1e+263) {
tmp = x - a;
} else {
tmp = y * (a / (z - 1.0));
}
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 - z) / (((t - z) + 1.0d0) / a)
if (t_1 <= (-2d+84)) then
tmp = y * (a / ((-1.0d0) - t))
else if (t_1 <= 2d-42) then
tmp = -(-x)
else if (t_1 <= 1d+263) then
tmp = x - a
else
tmp = y * (a / (z - 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_1 <= -2e+84) {
tmp = y * (a / (-1.0 - t));
} else if (t_1 <= 2e-42) {
tmp = -(-x);
} else if (t_1 <= 1e+263) {
tmp = x - a;
} else {
tmp = y * (a / (z - 1.0));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - z) / (((t - z) + 1.0) / a) tmp = 0 if t_1 <= -2e+84: tmp = y * (a / (-1.0 - t)) elif t_1 <= 2e-42: tmp = -(-x) elif t_1 <= 1e+263: tmp = x - a else: tmp = y * (a / (z - 1.0)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)) tmp = 0.0 if (t_1 <= -2e+84) tmp = Float64(y * Float64(a / Float64(-1.0 - t))); elseif (t_1 <= 2e-42) tmp = Float64(-Float64(-x)); elseif (t_1 <= 1e+263) tmp = Float64(x - a); else tmp = Float64(y * Float64(a / Float64(z - 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - z) / (((t - z) + 1.0) / a); tmp = 0.0; if (t_1 <= -2e+84) tmp = y * (a / (-1.0 - t)); elseif (t_1 <= 2e-42) tmp = -(-x); elseif (t_1 <= 1e+263) tmp = x - a; else tmp = y * (a / (z - 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+84], N[(y * N[(a / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-42], (-(-x)), If[LessEqual[t$95$1, 1e+263], N[(x - a), $MachinePrecision], N[(y * N[(a / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+84}:\\
\;\;\;\;y \cdot \frac{a}{-1 - t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-42}:\\
\;\;\;\;-\left(-x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+263}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{a}{z - 1}\\
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -2.0000000000000001e84Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6424.0%
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-+.f64N/A
distribute-neg-inN/A
metadata-evalN/A
sub-flipN/A
associate--r-N/A
associate-/l*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites26.8%
Taylor expanded in z around 0
Applied rewrites22.7%
if -2.0000000000000001e84 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 2.0000000000000001e-42Initial program 97.1%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f6488.1%
Applied rewrites88.1%
Taylor expanded in x around inf
lower-*.f6453.6%
Applied rewrites53.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6453.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6453.6%
Applied rewrites53.6%
if 2.0000000000000001e-42 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 1e263Initial program 97.1%
Taylor expanded in z around inf
Applied rewrites59.5%
if 1e263 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-eval99.6%
Applied rewrites99.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6424.0%
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-+.f64N/A
distribute-neg-inN/A
metadata-evalN/A
sub-flipN/A
associate--r-N/A
associate-/l*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites26.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f6418.9%
Applied rewrites18.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.2e+47) (- x a) (if (<= z 1.4e-147) (- (- x)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+47) {
tmp = x - a;
} else if (z <= 1.4e-147) {
tmp = -(-x);
} else {
tmp = x - 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 (z <= (-5.2d+47)) then
tmp = x - a
else if (z <= 1.4d-147) then
tmp = -(-x)
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+47) {
tmp = x - a;
} else if (z <= 1.4e-147) {
tmp = -(-x);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.2e+47: tmp = x - a elif z <= 1.4e-147: tmp = -(-x) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e+47) tmp = Float64(x - a); elseif (z <= 1.4e-147) tmp = Float64(-Float64(-x)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.2e+47) tmp = x - a; elseif (z <= 1.4e-147) tmp = -(-x); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+47], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.4e-147], (-(-x)), N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+47}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-147}:\\
\;\;\;\;-\left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
if z < -5.2000000000000001e47 or 1.4e-147 < z Initial program 97.1%
Taylor expanded in z around inf
Applied rewrites59.5%
if -5.2000000000000001e47 < z < 1.4e-147Initial program 97.1%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f6488.1%
Applied rewrites88.1%
Taylor expanded in x around inf
lower-*.f6453.6%
Applied rewrites53.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6453.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6453.6%
Applied rewrites53.6%
(FPCore (x y z t a) :precision binary64 (- x a))
double code(double x, double y, double z, double t, double a) {
return x - a;
}
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 - a
end function
public static double code(double x, double y, double z, double t, double a) {
return x - a;
}
def code(x, y, z, t, a): return x - a
function code(x, y, z, t, a) return Float64(x - a) end
function tmp = code(x, y, z, t, a) tmp = x - a; end
code[x_, y_, z_, t_, a_] := N[(x - a), $MachinePrecision]
x - a
Initial program 97.1%
Taylor expanded in z around inf
Applied rewrites59.5%
herbie shell --seed 2025258
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))