
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1) 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), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1) 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), $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 (- 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 - N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
x - \frac{z - y}{-1 - \left(t - z\right)} \cdot a
Initial program 97.0%
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.7%
Applied rewrites99.7%
(FPCore (x y z t a) :precision binary64 (- x (* (/ a (- (- t z) -1)) (- 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), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \frac{a}{\left(t - z\right) - -1} \cdot \left(y - z\right)
Initial program 97.0%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f6497.3%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval97.3%
Applied rewrites97.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* (/ a t) (- y z)))))
(if (<= t -170000000000000005735768827686289408)
t_1
(if (<=
t
19500000000000000507199066594495118388684201982201717325824)
(- x (* (/ a (- 1 z)) (- y z)))
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((a / t) * (y - z));
double tmp;
if (t <= -1.7e+35) {
tmp = t_1;
} else if (t <= 1.95e+58) {
tmp = x - ((a / (1.0 - z)) * (y - z));
} 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 - ((a / t) * (y - z))
if (t <= (-1.7d+35)) then
tmp = t_1
else if (t <= 1.95d+58) then
tmp = x - ((a / (1.0d0 - z)) * (y - z))
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 - ((a / t) * (y - z));
double tmp;
if (t <= -1.7e+35) {
tmp = t_1;
} else if (t <= 1.95e+58) {
tmp = x - ((a / (1.0 - z)) * (y - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((a / t) * (y - z)) tmp = 0 if t <= -1.7e+35: tmp = t_1 elif t <= 1.95e+58: tmp = x - ((a / (1.0 - z)) * (y - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(a / t) * Float64(y - z))) tmp = 0.0 if (t <= -1.7e+35) tmp = t_1; elseif (t <= 1.95e+58) tmp = Float64(x - Float64(Float64(a / Float64(1.0 - z)) * Float64(y - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((a / t) * (y - z)); tmp = 0.0; if (t <= -1.7e+35) tmp = t_1; elseif (t <= 1.95e+58) tmp = x - ((a / (1.0 - z)) * (y - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(a / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -170000000000000005735768827686289408], t$95$1, If[LessEqual[t, 19500000000000000507199066594495118388684201982201717325824], N[(x - N[(N[(a / N[(1 - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - \frac{a}{t} \cdot \left(y - z\right)\\
\mathbf{if}\;t \leq -170000000000000005735768827686289408:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 19500000000000000507199066594495118388684201982201717325824:\\
\;\;\;\;x - \frac{a}{1 - z} \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.7000000000000001e35 or 1.9500000000000001e58 < t Initial program 97.0%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f6497.3%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval97.3%
Applied rewrites97.3%
Taylor expanded in t around 0
lower--.f6477.6%
Applied rewrites77.6%
Taylor expanded in t around inf
lower-/.f6454.4%
Applied rewrites54.4%
if -1.7000000000000001e35 < t < 1.9500000000000001e58Initial program 97.0%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f6497.3%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval97.3%
Applied rewrites97.3%
Taylor expanded in t around 0
lower--.f6477.6%
Applied rewrites77.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* (/ a t) (- y z)))))
(if (<= t -3996944669291315/281474976710656)
t_1
(if (<=
t
19500000000000000507199066594495118388684201982201717325824)
(- x (/ (* a (- y z)) (- 1 z)))
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((a / t) * (y - z));
double tmp;
if (t <= -14.2) {
tmp = t_1;
} else if (t <= 1.95e+58) {
tmp = x - ((a * (y - z)) / (1.0 - z));
} 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 - ((a / t) * (y - z))
if (t <= (-14.2d0)) then
tmp = t_1
else if (t <= 1.95d+58) then
tmp = x - ((a * (y - z)) / (1.0d0 - z))
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 - ((a / t) * (y - z));
double tmp;
if (t <= -14.2) {
tmp = t_1;
} else if (t <= 1.95e+58) {
tmp = x - ((a * (y - z)) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((a / t) * (y - z)) tmp = 0 if t <= -14.2: tmp = t_1 elif t <= 1.95e+58: tmp = x - ((a * (y - z)) / (1.0 - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(a / t) * Float64(y - z))) tmp = 0.0 if (t <= -14.2) tmp = t_1; elseif (t <= 1.95e+58) tmp = Float64(x - Float64(Float64(a * Float64(y - z)) / Float64(1.0 - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((a / t) * (y - z)); tmp = 0.0; if (t <= -14.2) tmp = t_1; elseif (t <= 1.95e+58) tmp = x - ((a * (y - z)) / (1.0 - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(a / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3996944669291315/281474976710656], t$95$1, If[LessEqual[t, 19500000000000000507199066594495118388684201982201717325824], N[(x - N[(N[(a * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(1 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - \frac{a}{t} \cdot \left(y - z\right)\\
\mathbf{if}\;t \leq \frac{-3996944669291315}{281474976710656}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 19500000000000000507199066594495118388684201982201717325824:\\
\;\;\;\;x - \frac{a \cdot \left(y - z\right)}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -14.199999999999999 or 1.9500000000000001e58 < t Initial program 97.0%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f6497.3%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval97.3%
Applied rewrites97.3%
Taylor expanded in t around 0
lower--.f6477.6%
Applied rewrites77.6%
Taylor expanded in t around inf
lower-/.f6454.4%
Applied rewrites54.4%
if -14.199999999999999 < t < 1.9500000000000001e58Initial program 97.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6469.0%
Applied rewrites69.0%
(FPCore (x y z t a)
:precision binary64
(if (<=
z
-48000000000000000746851974214408465164873667052210948801748987860680021495908273756719298715922277488457901481656320)
(- x a)
(if (<= z 749999999999999941246189568)
(- x (* (/ y (+ 1 t)) a))
(- x a))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+115) {
tmp = x - a;
} else if (z <= 7.5e+26) {
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 <= (-4.8d+115)) then
tmp = x - a
else if (z <= 7.5d+26) 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 <= -4.8e+115) {
tmp = x - a;
} else if (z <= 7.5e+26) {
tmp = x - ((y / (1.0 + t)) * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.8e+115: tmp = x - a elif z <= 7.5e+26: 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 <= -4.8e+115) tmp = Float64(x - a); elseif (z <= 7.5e+26) 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 <= -4.8e+115) tmp = x - a; elseif (z <= 7.5e+26) 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, -48000000000000000746851974214408465164873667052210948801748987860680021495908273756719298715922277488457901481656320], N[(x - a), $MachinePrecision], If[LessEqual[z, 749999999999999941246189568], N[(x - N[(N[(y / N[(1 + t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -48000000000000000746851974214408465164873667052210948801748987860680021495908273756719298715922277488457901481656320:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 749999999999999941246189568:\\
\;\;\;\;x - \frac{y}{1 + t} \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
if z < -4.8000000000000001e115 or 7.4999999999999994e26 < z Initial program 97.0%
Taylor expanded in z around inf
Applied rewrites59.8%
if -4.8000000000000001e115 < z < 7.4999999999999994e26Initial program 97.0%
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.7%
Applied rewrites99.7%
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
-48000000000000000746851974214408465164873667052210948801748987860680021495908273756719298715922277488457901481656320)
(- x a)
(if (<= z 749999999999999941246189568)
(- x (/ (* a y) (+ 1 t)))
(- x a))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+115) {
tmp = x - a;
} else if (z <= 7.5e+26) {
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 <= (-4.8d+115)) then
tmp = x - a
else if (z <= 7.5d+26) 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 <= -4.8e+115) {
tmp = x - a;
} else if (z <= 7.5e+26) {
tmp = x - ((a * y) / (1.0 + t));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.8e+115: tmp = x - a elif z <= 7.5e+26: 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 <= -4.8e+115) tmp = Float64(x - a); elseif (z <= 7.5e+26) 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 <= -4.8e+115) tmp = x - a; elseif (z <= 7.5e+26) 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, -48000000000000000746851974214408465164873667052210948801748987860680021495908273756719298715922277488457901481656320], N[(x - a), $MachinePrecision], If[LessEqual[z, 749999999999999941246189568], N[(x - N[(N[(a * y), $MachinePrecision] / N[(1 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -48000000000000000746851974214408465164873667052210948801748987860680021495908273756719298715922277488457901481656320:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 749999999999999941246189568:\\
\;\;\;\;x - \frac{a \cdot y}{1 + t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
if z < -4.8000000000000001e115 or 7.4999999999999994e26 < z Initial program 97.0%
Taylor expanded in z around inf
Applied rewrites59.8%
if -4.8000000000000001e115 < z < 7.4999999999999994e26Initial program 97.0%
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
(let* ((t_1 (- x (* (/ y t) a))))
(if (<= t -3600000000000000265239433396092928)
t_1
(if (<=
t
-4763410263543689/11908525658859223294760121268437066290850060053501019099651935423375594096449911575776314174894302258147533153997065059263030913083222523904)
(- x a)
(if (<= t 7656119366529843/1125899906842624)
(- x (* (+ y (* -1 (* 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.6e+33) {
tmp = t_1;
} else if (t <= -4e-124) {
tmp = x - a;
} else if (t <= 6.8) {
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.6d+33)) then
tmp = t_1
else if (t <= (-4d-124)) then
tmp = x - a
else if (t <= 6.8d0) 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.6e+33) {
tmp = t_1;
} else if (t <= -4e-124) {
tmp = x - a;
} else if (t <= 6.8) {
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.6e+33: tmp = t_1 elif t <= -4e-124: tmp = x - a elif t <= 6.8: 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.6e+33) tmp = t_1; elseif (t <= -4e-124) tmp = Float64(x - a); elseif (t <= 6.8) 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.6e+33) tmp = t_1; elseif (t <= -4e-124) tmp = x - a; elseif (t <= 6.8) 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, -3600000000000000265239433396092928], t$95$1, If[LessEqual[t, -4763410263543689/11908525658859223294760121268437066290850060053501019099651935423375594096449911575776314174894302258147533153997065059263030913083222523904], N[(x - a), $MachinePrecision], If[LessEqual[t, 7656119366529843/1125899906842624], N[(x - N[(N[(y + N[(-1 * 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 -3600000000000000265239433396092928:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq \frac{-4763410263543689}{11908525658859223294760121268437066290850060053501019099651935423375594096449911575776314174894302258147533153997065059263030913083222523904}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;t \leq \frac{7656119366529843}{1125899906842624}:\\
\;\;\;\;x - \left(y + -1 \cdot \left(t \cdot y\right)\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -3.6000000000000003e33 or 6.7999999999999998 < t Initial program 97.0%
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.7%
Applied rewrites99.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f6472.0%
Applied rewrites72.0%
Taylor expanded in t around inf
lower-/.f6455.5%
Applied rewrites55.5%
if -3.6000000000000003e33 < t < -3.9999999999999997e-124Initial program 97.0%
Taylor expanded in z around inf
Applied rewrites59.8%
if -3.9999999999999997e-124 < t < 6.7999999999999998Initial program 97.0%
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.7%
Applied rewrites99.7%
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.0%
Applied rewrites48.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y (- -1 t)) a)))
(if (<= z -280000000)
(- x a)
(if (<=
z
5847188406839999/609082125712499942522086399242199269429764178599687970429244153575809293172901631404100941617625641201581557264463041761466198116575193377911124206019540838720704856247279564366924353468128353022049974592451148679605349870337179684109147725966810350801733675194017346692614286874494631936)
(* 1 x)
(if (<=
z
1329141705657193/32418090381882757488378186435087196492284736189394038281216072888208225089163344893747711319899248392876545989150787415487462117776654494592866209641515341305165482839074293153792)
t_1
(if (<=
z
8802718417897835/7588550360256754183279148073529370729071901715047420004889892225542594864082845696)
(* 1 x)
(if (<= z 6034957691516229/154742504910672534362390528)
t_1
(- x a))))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (y / (-1.0 - t)) * a;
double tmp;
if (z <= -280000000.0) {
tmp = x - a;
} else if (z <= 9.6e-273) {
tmp = 1.0 * x;
} else if (z <= 4.1e-164) {
tmp = t_1;
} else if (z <= 1.16e-66) {
tmp = 1.0 * x;
} else if (z <= 3.9e-11) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (y / ((-1.0d0) - t)) * a
if (z <= (-280000000.0d0)) then
tmp = x - a
else if (z <= 9.6d-273) then
tmp = 1.0d0 * x
else if (z <= 4.1d-164) then
tmp = t_1
else if (z <= 1.16d-66) then
tmp = 1.0d0 * x
else if (z <= 3.9d-11) then
tmp = t_1
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 t_1 = (y / (-1.0 - t)) * a;
double tmp;
if (z <= -280000000.0) {
tmp = x - a;
} else if (z <= 9.6e-273) {
tmp = 1.0 * x;
} else if (z <= 4.1e-164) {
tmp = t_1;
} else if (z <= 1.16e-66) {
tmp = 1.0 * x;
} else if (z <= 3.9e-11) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / (-1.0 - t)) * a tmp = 0 if z <= -280000000.0: tmp = x - a elif z <= 9.6e-273: tmp = 1.0 * x elif z <= 4.1e-164: tmp = t_1 elif z <= 1.16e-66: tmp = 1.0 * x elif z <= 3.9e-11: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / Float64(-1.0 - t)) * a) tmp = 0.0 if (z <= -280000000.0) tmp = Float64(x - a); elseif (z <= 9.6e-273) tmp = Float64(1.0 * x); elseif (z <= 4.1e-164) tmp = t_1; elseif (z <= 1.16e-66) tmp = Float64(1.0 * x); elseif (z <= 3.9e-11) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / (-1.0 - t)) * a; tmp = 0.0; if (z <= -280000000.0) tmp = x - a; elseif (z <= 9.6e-273) tmp = 1.0 * x; elseif (z <= 4.1e-164) tmp = t_1; elseif (z <= 1.16e-66) tmp = 1.0 * x; elseif (z <= 3.9e-11) tmp = t_1; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(-1 - t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[z, -280000000], N[(x - a), $MachinePrecision], If[LessEqual[z, 5847188406839999/609082125712499942522086399242199269429764178599687970429244153575809293172901631404100941617625641201581557264463041761466198116575193377911124206019540838720704856247279564366924353468128353022049974592451148679605349870337179684109147725966810350801733675194017346692614286874494631936], N[(1 * x), $MachinePrecision], If[LessEqual[z, 1329141705657193/32418090381882757488378186435087196492284736189394038281216072888208225089163344893747711319899248392876545989150787415487462117776654494592866209641515341305165482839074293153792], t$95$1, If[LessEqual[z, 8802718417897835/7588550360256754183279148073529370729071901715047420004889892225542594864082845696], N[(1 * x), $MachinePrecision], If[LessEqual[z, 6034957691516229/154742504910672534362390528], t$95$1, N[(x - a), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \frac{y}{-1 - t} \cdot a\\
\mathbf{if}\;z \leq -280000000:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq \frac{5847188406839999}{609082125712499942522086399242199269429764178599687970429244153575809293172901631404100941617625641201581557264463041761466198116575193377911124206019540838720704856247279564366924353468128353022049974592451148679605349870337179684109147725966810350801733675194017346692614286874494631936}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq \frac{1329141705657193}{32418090381882757488378186435087196492284736189394038281216072888208225089163344893747711319899248392876545989150787415487462117776654494592866209641515341305165482839074293153792}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{8802718417897835}{7588550360256754183279148073529370729071901715047420004889892225542594864082845696}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq \frac{6034957691516229}{154742504910672534362390528}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
if z < -2.8e8 or 3.9000000000000001e-11 < z Initial program 97.0%
Taylor expanded in z around inf
Applied rewrites59.8%
if -2.8e8 < z < 9.5999999999999993e-273 or 4.0999999999999998e-164 < z < 1.16e-66Initial program 97.0%
Taylor expanded in z around inf
Applied rewrites59.8%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f6457.3%
Applied rewrites57.3%
Taylor expanded in x around inf
Applied rewrites52.9%
if 9.5999999999999993e-273 < z < 4.0999999999999998e-164 or 1.16e-66 < z < 3.9000000000000001e-11Initial program 97.0%
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.7%
Applied rewrites99.7%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6424.5%
Applied rewrites24.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
associate--r+N/A
sub-negate-revN/A
associate-+l-N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6427.8%
Applied rewrites27.8%
Taylor expanded in z around 0
Applied rewrites23.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* (/ y t) a))))
(if (<= t -3600000000000000265239433396092928)
t_1
(if (<=
t
2894802230932905/14474011154664524427946373126085988481658748083205070504932198000989141204992)
(- x 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.6e+33) {
tmp = t_1;
} else if (t <= 2e-61) {
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) :: tmp
t_1 = x - ((y / t) * a)
if (t <= (-3.6d+33)) then
tmp = t_1
else if (t <= 2d-61) 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 = x - ((y / t) * a);
double tmp;
if (t <= -3.6e+33) {
tmp = t_1;
} else if (t <= 2e-61) {
tmp = x - 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.6e+33: tmp = t_1 elif t <= 2e-61: tmp = x - 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.6e+33) tmp = t_1; elseif (t <= 2e-61) tmp = Float64(x - 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.6e+33) tmp = t_1; elseif (t <= 2e-61) tmp = x - 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, -3600000000000000265239433396092928], t$95$1, If[LessEqual[t, 2894802230932905/14474011154664524427946373126085988481658748083205070504932198000989141204992], N[(x - a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - \frac{y}{t} \cdot a\\
\mathbf{if}\;t \leq -3600000000000000265239433396092928:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq \frac{2894802230932905}{14474011154664524427946373126085988481658748083205070504932198000989141204992}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -3.6000000000000003e33 or 2.0000000000000001e-61 < t Initial program 97.0%
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.7%
Applied rewrites99.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f6472.0%
Applied rewrites72.0%
Taylor expanded in t around inf
lower-/.f6455.5%
Applied rewrites55.5%
if -3.6000000000000003e33 < t < 2.0000000000000001e-61Initial program 97.0%
Taylor expanded in z around inf
Applied rewrites59.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ (* a y) t))))
(if (<= t -3600000000000000265239433396092928)
t_1
(if (<=
t
2894802230932905/14474011154664524427946373126085988481658748083205070504932198000989141204992)
(- x a)
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((a * y) / t);
double tmp;
if (t <= -3.6e+33) {
tmp = t_1;
} else if (t <= 2e-61) {
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) :: tmp
t_1 = x - ((a * y) / t)
if (t <= (-3.6d+33)) then
tmp = t_1
else if (t <= 2d-61) 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 = x - ((a * y) / t);
double tmp;
if (t <= -3.6e+33) {
tmp = t_1;
} else if (t <= 2e-61) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((a * y) / t) tmp = 0 if t <= -3.6e+33: tmp = t_1 elif t <= 2e-61: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(a * y) / t)) tmp = 0.0 if (t <= -3.6e+33) tmp = t_1; elseif (t <= 2e-61) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((a * y) / t); tmp = 0.0; if (t <= -3.6e+33) tmp = t_1; elseif (t <= 2e-61) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(a * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3600000000000000265239433396092928], t$95$1, If[LessEqual[t, 2894802230932905/14474011154664524427946373126085988481658748083205070504932198000989141204992], N[(x - a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - \frac{a \cdot y}{t}\\
\mathbf{if}\;t \leq -3600000000000000265239433396092928:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq \frac{2894802230932905}{14474011154664524427946373126085988481658748083205070504932198000989141204992}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -3.6000000000000003e33 or 2.0000000000000001e-61 < t Initial program 97.0%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6450.7%
Applied rewrites50.7%
Taylor expanded in y around inf
lower-*.f6453.5%
Applied rewrites53.5%
if -3.6000000000000003e33 < t < 2.0000000000000001e-61Initial program 97.0%
Taylor expanded in z around inf
Applied rewrites59.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -280000000)
(- x a)
(if (<=
z
1659995391306165/237142198758023568227473377297792835283496928595231875152809132048206089502588928)
(* 1 x)
(- x a))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -280000000.0) {
tmp = x - a;
} else if (z <= 7e-66) {
tmp = 1.0 * 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 <= (-280000000.0d0)) then
tmp = x - a
else if (z <= 7d-66) then
tmp = 1.0d0 * 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 <= -280000000.0) {
tmp = x - a;
} else if (z <= 7e-66) {
tmp = 1.0 * x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -280000000.0: tmp = x - a elif z <= 7e-66: tmp = 1.0 * x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -280000000.0) tmp = Float64(x - a); elseif (z <= 7e-66) tmp = Float64(1.0 * x); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -280000000.0) tmp = x - a; elseif (z <= 7e-66) tmp = 1.0 * x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -280000000], N[(x - a), $MachinePrecision], If[LessEqual[z, 1659995391306165/237142198758023568227473377297792835283496928595231875152809132048206089502588928], N[(1 * x), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -280000000:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq \frac{1659995391306165}{237142198758023568227473377297792835283496928595231875152809132048206089502588928}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
if z < -2.8e8 or 7.0000000000000001e-66 < z Initial program 97.0%
Taylor expanded in z around inf
Applied rewrites59.8%
if -2.8e8 < z < 7.0000000000000001e-66Initial program 97.0%
Taylor expanded in z around inf
Applied rewrites59.8%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f6457.3%
Applied rewrites57.3%
Taylor expanded in x around inf
Applied rewrites52.9%
(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.0%
Taylor expanded in z around inf
Applied rewrites59.8%
herbie shell --seed 2025271 -o generate:evaluate
(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) a))))