
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - 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 + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + y \cdot \frac{z - t}{z - a}
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - 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 + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + y \cdot \frac{z - t}{z - a}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (* (/ y (- a z)) t)))
(if (<=
t_1
-500000000000000024173346057776829528764197422945257127936)
t_2
(if (<= t_1 5764607523034235/576460752303423488)
(- x (* (/ y a) (- z t)))
(if (<=
t_1
99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464)
(+ x (* y (/ (- z t) z)))
t_2)))))double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / (a - z)) * t;
double tmp;
if (t_1 <= -5e+56) {
tmp = t_2;
} else if (t_1 <= 0.01) {
tmp = x - ((y / a) * (z - t));
} else if (t_1 <= 1e+119) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = t_2;
}
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 = (z - t) / (z - a)
t_2 = (y / (a - z)) * t
if (t_1 <= (-5d+56)) then
tmp = t_2
else if (t_1 <= 0.01d0) then
tmp = x - ((y / a) * (z - t))
else if (t_1 <= 1d+119) then
tmp = x + (y * ((z - t) / z))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / (a - z)) * t;
double tmp;
if (t_1 <= -5e+56) {
tmp = t_2;
} else if (t_1 <= 0.01) {
tmp = x - ((y / a) * (z - t));
} else if (t_1 <= 1e+119) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = (y / (a - z)) * t tmp = 0 if t_1 <= -5e+56: tmp = t_2 elif t_1 <= 0.01: tmp = x - ((y / a) * (z - t)) elif t_1 <= 1e+119: tmp = x + (y * ((z - t) / z)) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(Float64(y / Float64(a - z)) * t) tmp = 0.0 if (t_1 <= -5e+56) tmp = t_2; elseif (t_1 <= 0.01) tmp = Float64(x - Float64(Float64(y / a) * Float64(z - t))); elseif (t_1 <= 1e+119) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = (y / (a - z)) * t; tmp = 0.0; if (t_1 <= -5e+56) tmp = t_2; elseif (t_1 <= 0.01) tmp = x - ((y / a) * (z - t)); elseif (t_1 <= 1e+119) tmp = x + (y * ((z - t) / z)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -500000000000000024173346057776829528764197422945257127936], t$95$2, If[LessEqual[t$95$1, 5764607523034235/576460752303423488], N[(x - N[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \frac{y}{a - z} \cdot t\\
\mathbf{if}\;t\_1 \leq -500000000000000024173346057776829528764197422945257127936:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \frac{5764607523034235}{576460752303423488}:\\
\;\;\;\;x - \frac{y}{a} \cdot \left(z - t\right)\\
\mathbf{elif}\;t\_1 \leq 99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -5.0000000000000002e56 or 9.9999999999999994e118 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.2%
Applied rewrites95.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.2%
Applied rewrites26.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6428.0%
Applied rewrites28.0%
if -5.0000000000000002e56 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.01Initial program 98.2%
Applied rewrites95.8%
Taylor expanded in z around 0
Applied rewrites60.4%
if 0.01 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999994e118Initial program 98.2%
Taylor expanded in a around 0
lower-/.f64N/A
lower--.f6467.0%
Applied rewrites67.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (* (/ y (- a z)) t)))
(if (<=
t_1
-1999999999999999960006936694788402363337610385794017036377296623661544829254857450929578869859984879509552150362154074112)
t_2
(if (<= t_1 5764607523034235/576460752303423488)
(+ x (* y (/ t a)))
(if (<=
t_1
99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464)
(+ x (* y (/ (- z t) z)))
t_2)))))double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / (a - z)) * t;
double tmp;
if (t_1 <= -2e+120) {
tmp = t_2;
} else if (t_1 <= 0.01) {
tmp = x + (y * (t / a));
} else if (t_1 <= 1e+119) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = t_2;
}
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 = (z - t) / (z - a)
t_2 = (y / (a - z)) * t
if (t_1 <= (-2d+120)) then
tmp = t_2
else if (t_1 <= 0.01d0) then
tmp = x + (y * (t / a))
else if (t_1 <= 1d+119) then
tmp = x + (y * ((z - t) / z))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / (a - z)) * t;
double tmp;
if (t_1 <= -2e+120) {
tmp = t_2;
} else if (t_1 <= 0.01) {
tmp = x + (y * (t / a));
} else if (t_1 <= 1e+119) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = (y / (a - z)) * t tmp = 0 if t_1 <= -2e+120: tmp = t_2 elif t_1 <= 0.01: tmp = x + (y * (t / a)) elif t_1 <= 1e+119: tmp = x + (y * ((z - t) / z)) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(Float64(y / Float64(a - z)) * t) tmp = 0.0 if (t_1 <= -2e+120) tmp = t_2; elseif (t_1 <= 0.01) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (t_1 <= 1e+119) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = (y / (a - z)) * t; tmp = 0.0; if (t_1 <= -2e+120) tmp = t_2; elseif (t_1 <= 0.01) tmp = x + (y * (t / a)); elseif (t_1 <= 1e+119) tmp = x + (y * ((z - t) / z)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -1999999999999999960006936694788402363337610385794017036377296623661544829254857450929578869859984879509552150362154074112], t$95$2, If[LessEqual[t$95$1, 5764607523034235/576460752303423488], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \frac{y}{a - z} \cdot t\\
\mathbf{if}\;t\_1 \leq -1999999999999999960006936694788402363337610385794017036377296623661544829254857450929578869859984879509552150362154074112:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \frac{5764607523034235}{576460752303423488}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;t\_1 \leq 99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e120 or 9.9999999999999994e118 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.2%
Applied rewrites95.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.2%
Applied rewrites26.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6428.0%
Applied rewrites28.0%
if -2e120 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.01Initial program 98.2%
Taylor expanded in z around 0
lower-/.f6461.4%
Applied rewrites61.4%
if 0.01 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999994e118Initial program 98.2%
Taylor expanded in a around 0
lower-/.f64N/A
lower--.f6467.0%
Applied rewrites67.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (* (/ y (- a z)) t)))
(if (<=
t_1
-1999999999999999960006936694788402363337610385794017036377296623661544829254857450929578869859984879509552150362154074112)
t_2
(if (<=
t_1
7307508186654515/365375409332725729550921208179070754913983135744)
(+ x (* y (/ t a)))
(if (<= t_1 100000000000) (+ x (* y (/ z (- z a)))) t_2)))))double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / (a - z)) * t;
double tmp;
if (t_1 <= -2e+120) {
tmp = t_2;
} else if (t_1 <= 2e-32) {
tmp = x + (y * (t / a));
} else if (t_1 <= 100000000000.0) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = t_2;
}
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 = (z - t) / (z - a)
t_2 = (y / (a - z)) * t
if (t_1 <= (-2d+120)) then
tmp = t_2
else if (t_1 <= 2d-32) then
tmp = x + (y * (t / a))
else if (t_1 <= 100000000000.0d0) then
tmp = x + (y * (z / (z - a)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / (a - z)) * t;
double tmp;
if (t_1 <= -2e+120) {
tmp = t_2;
} else if (t_1 <= 2e-32) {
tmp = x + (y * (t / a));
} else if (t_1 <= 100000000000.0) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = (y / (a - z)) * t tmp = 0 if t_1 <= -2e+120: tmp = t_2 elif t_1 <= 2e-32: tmp = x + (y * (t / a)) elif t_1 <= 100000000000.0: tmp = x + (y * (z / (z - a))) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(Float64(y / Float64(a - z)) * t) tmp = 0.0 if (t_1 <= -2e+120) tmp = t_2; elseif (t_1 <= 2e-32) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (t_1 <= 100000000000.0) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = (y / (a - z)) * t; tmp = 0.0; if (t_1 <= -2e+120) tmp = t_2; elseif (t_1 <= 2e-32) tmp = x + (y * (t / a)); elseif (t_1 <= 100000000000.0) tmp = x + (y * (z / (z - a))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -1999999999999999960006936694788402363337610385794017036377296623661544829254857450929578869859984879509552150362154074112], t$95$2, If[LessEqual[t$95$1, 7307508186654515/365375409332725729550921208179070754913983135744], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 100000000000], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \frac{y}{a - z} \cdot t\\
\mathbf{if}\;t\_1 \leq -1999999999999999960006936694788402363337610385794017036377296623661544829254857450929578869859984879509552150362154074112:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \frac{7307508186654515}{365375409332725729550921208179070754913983135744}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;t\_1 \leq 100000000000:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e120 or 1e11 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.2%
Applied rewrites95.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.2%
Applied rewrites26.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6428.0%
Applied rewrites28.0%
if -2e120 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-32Initial program 98.2%
Taylor expanded in z around 0
lower-/.f6461.4%
Applied rewrites61.4%
if 2.0000000000000001e-32 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e11Initial program 98.2%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f6472.2%
Applied rewrites72.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (* (/ y (- a z)) t)))
(if (<=
t_1
-1999999999999999960006936694788402363337610385794017036377296623661544829254857450929578869859984879509552150362154074112)
t_2
(if (<= t_1 7378697629483821/73786976294838206464)
(+ x (* y (/ t a)))
(if (<= t_1 100000000000) (+ x y) t_2)))))double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / (a - z)) * t;
double tmp;
if (t_1 <= -2e+120) {
tmp = t_2;
} else if (t_1 <= 0.0001) {
tmp = x + (y * (t / a));
} else if (t_1 <= 100000000000.0) {
tmp = x + y;
} else {
tmp = t_2;
}
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 = (z - t) / (z - a)
t_2 = (y / (a - z)) * t
if (t_1 <= (-2d+120)) then
tmp = t_2
else if (t_1 <= 0.0001d0) then
tmp = x + (y * (t / a))
else if (t_1 <= 100000000000.0d0) then
tmp = x + y
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / (a - z)) * t;
double tmp;
if (t_1 <= -2e+120) {
tmp = t_2;
} else if (t_1 <= 0.0001) {
tmp = x + (y * (t / a));
} else if (t_1 <= 100000000000.0) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = (y / (a - z)) * t tmp = 0 if t_1 <= -2e+120: tmp = t_2 elif t_1 <= 0.0001: tmp = x + (y * (t / a)) elif t_1 <= 100000000000.0: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(Float64(y / Float64(a - z)) * t) tmp = 0.0 if (t_1 <= -2e+120) tmp = t_2; elseif (t_1 <= 0.0001) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (t_1 <= 100000000000.0) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = (y / (a - z)) * t; tmp = 0.0; if (t_1 <= -2e+120) tmp = t_2; elseif (t_1 <= 0.0001) tmp = x + (y * (t / a)); elseif (t_1 <= 100000000000.0) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -1999999999999999960006936694788402363337610385794017036377296623661544829254857450929578869859984879509552150362154074112], t$95$2, If[LessEqual[t$95$1, 7378697629483821/73786976294838206464], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 100000000000], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \frac{y}{a - z} \cdot t\\
\mathbf{if}\;t\_1 \leq -1999999999999999960006936694788402363337610385794017036377296623661544829254857450929578869859984879509552150362154074112:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \frac{7378697629483821}{73786976294838206464}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;t\_1 \leq 100000000000:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e120 or 1e11 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.2%
Applied rewrites95.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.2%
Applied rewrites26.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6428.0%
Applied rewrites28.0%
if -2e120 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e-4Initial program 98.2%
Taylor expanded in z around 0
lower-/.f6461.4%
Applied rewrites61.4%
if 1e-4 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e11Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (* (/ y (- a z)) t)))
(if (<=
t_1
-500000000000000024173346057776829528764197422945257127936)
t_2
(if (<=
t_1
7307508186654515/365375409332725729550921208179070754913983135744)
(+ x (/ (* t y) a))
(if (<= t_1 100000000000) (+ x y) t_2)))))double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / (a - z)) * t;
double tmp;
if (t_1 <= -5e+56) {
tmp = t_2;
} else if (t_1 <= 2e-32) {
tmp = x + ((t * y) / a);
} else if (t_1 <= 100000000000.0) {
tmp = x + y;
} else {
tmp = t_2;
}
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 = (z - t) / (z - a)
t_2 = (y / (a - z)) * t
if (t_1 <= (-5d+56)) then
tmp = t_2
else if (t_1 <= 2d-32) then
tmp = x + ((t * y) / a)
else if (t_1 <= 100000000000.0d0) then
tmp = x + y
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / (a - z)) * t;
double tmp;
if (t_1 <= -5e+56) {
tmp = t_2;
} else if (t_1 <= 2e-32) {
tmp = x + ((t * y) / a);
} else if (t_1 <= 100000000000.0) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = (y / (a - z)) * t tmp = 0 if t_1 <= -5e+56: tmp = t_2 elif t_1 <= 2e-32: tmp = x + ((t * y) / a) elif t_1 <= 100000000000.0: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(Float64(y / Float64(a - z)) * t) tmp = 0.0 if (t_1 <= -5e+56) tmp = t_2; elseif (t_1 <= 2e-32) tmp = Float64(x + Float64(Float64(t * y) / a)); elseif (t_1 <= 100000000000.0) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = (y / (a - z)) * t; tmp = 0.0; if (t_1 <= -5e+56) tmp = t_2; elseif (t_1 <= 2e-32) tmp = x + ((t * y) / a); elseif (t_1 <= 100000000000.0) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -500000000000000024173346057776829528764197422945257127936], t$95$2, If[LessEqual[t$95$1, 7307508186654515/365375409332725729550921208179070754913983135744], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 100000000000], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \frac{y}{a - z} \cdot t\\
\mathbf{if}\;t\_1 \leq -500000000000000024173346057776829528764197422945257127936:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \frac{7307508186654515}{365375409332725729550921208179070754913983135744}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{elif}\;t\_1 \leq 100000000000:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -5.0000000000000002e56 or 1e11 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.2%
Applied rewrites95.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.2%
Applied rewrites26.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6428.0%
Applied rewrites28.0%
if -5.0000000000000002e56 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-32Initial program 98.2%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6460.0%
Applied rewrites60.0%
if 2.0000000000000001e-32 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e11Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -3022314549036573/604462909807314587353088)
(* (/ t (- a z)) y)
(if (<=
t_1
1942668892225729/971334446112864535459730953411759453321203419526069760625906204869452142602604249088)
(* 1 x)
(if (<= t_1 100000000000) (+ x y) (* (/ y (- a z)) t))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -5e-9) {
tmp = (t / (a - z)) * y;
} else if (t_1 <= 2e-69) {
tmp = 1.0 * x;
} else if (t_1 <= 100000000000.0) {
tmp = x + y;
} else {
tmp = (y / (a - z)) * t;
}
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 = (z - t) / (z - a)
if (t_1 <= (-5d-9)) then
tmp = (t / (a - z)) * y
else if (t_1 <= 2d-69) then
tmp = 1.0d0 * x
else if (t_1 <= 100000000000.0d0) then
tmp = x + y
else
tmp = (y / (a - z)) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -5e-9) {
tmp = (t / (a - z)) * y;
} else if (t_1 <= 2e-69) {
tmp = 1.0 * x;
} else if (t_1 <= 100000000000.0) {
tmp = x + y;
} else {
tmp = (y / (a - z)) * t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -5e-9: tmp = (t / (a - z)) * y elif t_1 <= 2e-69: tmp = 1.0 * x elif t_1 <= 100000000000.0: tmp = x + y else: tmp = (y / (a - z)) * t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -5e-9) tmp = Float64(Float64(t / Float64(a - z)) * y); elseif (t_1 <= 2e-69) tmp = Float64(1.0 * x); elseif (t_1 <= 100000000000.0) tmp = Float64(x + y); else tmp = Float64(Float64(y / Float64(a - z)) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -5e-9) tmp = (t / (a - z)) * y; elseif (t_1 <= 2e-69) tmp = 1.0 * x; elseif (t_1 <= 100000000000.0) tmp = x + y; else tmp = (y / (a - z)) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -3022314549036573/604462909807314587353088], N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 1942668892225729/971334446112864535459730953411759453321203419526069760625906204869452142602604249088], N[(1 * x), $MachinePrecision], If[LessEqual[t$95$1, 100000000000], N[(x + y), $MachinePrecision], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq \frac{-3022314549036573}{604462909807314587353088}:\\
\;\;\;\;\frac{t}{a - z} \cdot y\\
\mathbf{elif}\;t\_1 \leq \frac{1942668892225729}{971334446112864535459730953411759453321203419526069760625906204869452142602604249088}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;t\_1 \leq 100000000000:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - z} \cdot t\\
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -5.0000000000000001e-9Initial program 98.2%
Applied rewrites95.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.2%
Applied rewrites26.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6428.2%
Applied rewrites28.2%
if -5.0000000000000001e-9 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.9999999999999999e-69Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
metadata-evalN/A
lower-unsound-+.f64N/A
metadata-evalN/A
lower-unsound-/.f6458.1%
Applied rewrites58.1%
Taylor expanded in x around inf
Applied rewrites50.8%
if 1.9999999999999999e-69 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e11Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
if 1e11 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.2%
Applied rewrites95.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.2%
Applied rewrites26.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6428.0%
Applied rewrites28.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (* (/ t (- a z)) y)))
(if (<= t_1 -3022314549036573/604462909807314587353088)
t_2
(if (<=
t_1
1942668892225729/971334446112864535459730953411759453321203419526069760625906204869452142602604249088)
(* 1 x)
(if (<= t_1 100000000000) (+ x y) t_2)))))double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (t / (a - z)) * y;
double tmp;
if (t_1 <= -5e-9) {
tmp = t_2;
} else if (t_1 <= 2e-69) {
tmp = 1.0 * x;
} else if (t_1 <= 100000000000.0) {
tmp = x + y;
} else {
tmp = t_2;
}
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 = (z - t) / (z - a)
t_2 = (t / (a - z)) * y
if (t_1 <= (-5d-9)) then
tmp = t_2
else if (t_1 <= 2d-69) then
tmp = 1.0d0 * x
else if (t_1 <= 100000000000.0d0) then
tmp = x + y
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (t / (a - z)) * y;
double tmp;
if (t_1 <= -5e-9) {
tmp = t_2;
} else if (t_1 <= 2e-69) {
tmp = 1.0 * x;
} else if (t_1 <= 100000000000.0) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = (t / (a - z)) * y tmp = 0 if t_1 <= -5e-9: tmp = t_2 elif t_1 <= 2e-69: tmp = 1.0 * x elif t_1 <= 100000000000.0: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(Float64(t / Float64(a - z)) * y) tmp = 0.0 if (t_1 <= -5e-9) tmp = t_2; elseif (t_1 <= 2e-69) tmp = Float64(1.0 * x); elseif (t_1 <= 100000000000.0) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = (t / (a - z)) * y; tmp = 0.0; if (t_1 <= -5e-9) tmp = t_2; elseif (t_1 <= 2e-69) tmp = 1.0 * x; elseif (t_1 <= 100000000000.0) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -3022314549036573/604462909807314587353088], t$95$2, If[LessEqual[t$95$1, 1942668892225729/971334446112864535459730953411759453321203419526069760625906204869452142602604249088], N[(1 * x), $MachinePrecision], If[LessEqual[t$95$1, 100000000000], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \frac{t}{a - z} \cdot y\\
\mathbf{if}\;t\_1 \leq \frac{-3022314549036573}{604462909807314587353088}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \frac{1942668892225729}{971334446112864535459730953411759453321203419526069760625906204869452142602604249088}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;t\_1 \leq 100000000000:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -5.0000000000000001e-9 or 1e11 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.2%
Applied rewrites95.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.2%
Applied rewrites26.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6428.2%
Applied rewrites28.2%
if -5.0000000000000001e-9 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.9999999999999999e-69Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
metadata-evalN/A
lower-unsound-+.f64N/A
metadata-evalN/A
lower-unsound-/.f6458.1%
Applied rewrites58.1%
Taylor expanded in x around inf
Applied rewrites50.8%
if 1.9999999999999999e-69 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e11Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (/ (* y (- z t)) z)))
(if (<=
t_1
-1999999999999999960006936694788402363337610385794017036377296623661544829254857450929578869859984879509552150362154074112)
t_2
(if (<=
t_1
1942668892225729/971334446112864535459730953411759453321203419526069760625906204869452142602604249088)
(* 1 x)
(if (<=
t_1
99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464)
(+ x y)
t_2)))))double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y * (z - t)) / z;
double tmp;
if (t_1 <= -2e+120) {
tmp = t_2;
} else if (t_1 <= 2e-69) {
tmp = 1.0 * x;
} else if (t_1 <= 1e+119) {
tmp = x + y;
} else {
tmp = t_2;
}
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 = (z - t) / (z - a)
t_2 = (y * (z - t)) / z
if (t_1 <= (-2d+120)) then
tmp = t_2
else if (t_1 <= 2d-69) then
tmp = 1.0d0 * x
else if (t_1 <= 1d+119) then
tmp = x + y
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y * (z - t)) / z;
double tmp;
if (t_1 <= -2e+120) {
tmp = t_2;
} else if (t_1 <= 2e-69) {
tmp = 1.0 * x;
} else if (t_1 <= 1e+119) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = (y * (z - t)) / z tmp = 0 if t_1 <= -2e+120: tmp = t_2 elif t_1 <= 2e-69: tmp = 1.0 * x elif t_1 <= 1e+119: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(Float64(y * Float64(z - t)) / z) tmp = 0.0 if (t_1 <= -2e+120) tmp = t_2; elseif (t_1 <= 2e-69) tmp = Float64(1.0 * x); elseif (t_1 <= 1e+119) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = (y * (z - t)) / z; tmp = 0.0; if (t_1 <= -2e+120) tmp = t_2; elseif (t_1 <= 2e-69) tmp = 1.0 * x; elseif (t_1 <= 1e+119) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[t$95$1, -1999999999999999960006936694788402363337610385794017036377296623661544829254857450929578869859984879509552150362154074112], t$95$2, If[LessEqual[t$95$1, 1942668892225729/971334446112864535459730953411759453321203419526069760625906204869452142602604249088], N[(1 * x), $MachinePrecision], If[LessEqual[t$95$1, 99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \frac{y \cdot \left(z - t\right)}{z}\\
\mathbf{if}\;t\_1 \leq -1999999999999999960006936694788402363337610385794017036377296623661544829254857450929578869859984879509552150362154074112:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \frac{1942668892225729}{971334446112864535459730953411759453321203419526069760625906204869452142602604249088}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;t\_1 \leq 99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e120 or 9.9999999999999994e118 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.2%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.7%
Applied rewrites39.7%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6424.3%
Applied rewrites24.3%
if -2e120 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.9999999999999999e-69Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
metadata-evalN/A
lower-unsound-+.f64N/A
metadata-evalN/A
lower-unsound-/.f6458.1%
Applied rewrites58.1%
Taylor expanded in x around inf
Applied rewrites50.8%
if 1.9999999999999999e-69 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999994e118Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<=
t_1
-99999999999999997168788049560464200849936328366177157906432)
(* (/ t a) y)
(if (<=
t_1
1942668892225729/971334446112864535459730953411759453321203419526069760625906204869452142602604249088)
(* 1 x)
(if (<=
t_1
99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464)
(+ x y)
(* (/ y a) t))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+59) {
tmp = (t / a) * y;
} else if (t_1 <= 2e-69) {
tmp = 1.0 * x;
} else if (t_1 <= 1e+119) {
tmp = x + y;
} else {
tmp = (y / a) * t;
}
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 = (z - t) / (z - a)
if (t_1 <= (-1d+59)) then
tmp = (t / a) * y
else if (t_1 <= 2d-69) then
tmp = 1.0d0 * x
else if (t_1 <= 1d+119) then
tmp = x + y
else
tmp = (y / a) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+59) {
tmp = (t / a) * y;
} else if (t_1 <= 2e-69) {
tmp = 1.0 * x;
} else if (t_1 <= 1e+119) {
tmp = x + y;
} else {
tmp = (y / a) * t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -1e+59: tmp = (t / a) * y elif t_1 <= 2e-69: tmp = 1.0 * x elif t_1 <= 1e+119: tmp = x + y else: tmp = (y / a) * t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -1e+59) tmp = Float64(Float64(t / a) * y); elseif (t_1 <= 2e-69) tmp = Float64(1.0 * x); elseif (t_1 <= 1e+119) tmp = Float64(x + y); else tmp = Float64(Float64(y / a) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -1e+59) tmp = (t / a) * y; elseif (t_1 <= 2e-69) tmp = 1.0 * x; elseif (t_1 <= 1e+119) tmp = x + y; else tmp = (y / a) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -99999999999999997168788049560464200849936328366177157906432], N[(N[(t / a), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 1942668892225729/971334446112864535459730953411759453321203419526069760625906204869452142602604249088], N[(1 * x), $MachinePrecision], If[LessEqual[t$95$1, 99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464], N[(x + y), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -99999999999999997168788049560464200849936328366177157906432:\\
\;\;\;\;\frac{t}{a} \cdot y\\
\mathbf{elif}\;t\_1 \leq \frac{1942668892225729}{971334446112864535459730953411759453321203419526069760625906204869452142602604249088}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;t\_1 \leq 99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.9999999999999997e58Initial program 98.2%
Applied rewrites95.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.2%
Applied rewrites26.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6428.2%
Applied rewrites28.2%
Taylor expanded in z around 0
Applied rewrites20.0%
if -9.9999999999999997e58 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.9999999999999999e-69Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
metadata-evalN/A
lower-unsound-+.f64N/A
metadata-evalN/A
lower-unsound-/.f6458.1%
Applied rewrites58.1%
Taylor expanded in x around inf
Applied rewrites50.8%
if 1.9999999999999999e-69 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999994e118Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
if 9.9999999999999994e118 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.2%
Applied rewrites95.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.2%
Applied rewrites26.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6428.0%
Applied rewrites28.0%
Taylor expanded in z around 0
Applied rewrites19.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (* (/ t a) y)))
(if (<=
t_1
-99999999999999997168788049560464200849936328366177157906432)
t_2
(if (<=
t_1
1942668892225729/971334446112864535459730953411759453321203419526069760625906204869452142602604249088)
(* 1 x)
(if (<=
t_1
99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464)
(+ x y)
t_2)))))double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (t / a) * y;
double tmp;
if (t_1 <= -1e+59) {
tmp = t_2;
} else if (t_1 <= 2e-69) {
tmp = 1.0 * x;
} else if (t_1 <= 1e+119) {
tmp = x + y;
} else {
tmp = t_2;
}
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 = (z - t) / (z - a)
t_2 = (t / a) * y
if (t_1 <= (-1d+59)) then
tmp = t_2
else if (t_1 <= 2d-69) then
tmp = 1.0d0 * x
else if (t_1 <= 1d+119) then
tmp = x + y
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (t / a) * y;
double tmp;
if (t_1 <= -1e+59) {
tmp = t_2;
} else if (t_1 <= 2e-69) {
tmp = 1.0 * x;
} else if (t_1 <= 1e+119) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = (t / a) * y tmp = 0 if t_1 <= -1e+59: tmp = t_2 elif t_1 <= 2e-69: tmp = 1.0 * x elif t_1 <= 1e+119: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(Float64(t / a) * y) tmp = 0.0 if (t_1 <= -1e+59) tmp = t_2; elseif (t_1 <= 2e-69) tmp = Float64(1.0 * x); elseif (t_1 <= 1e+119) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = (t / a) * y; tmp = 0.0; if (t_1 <= -1e+59) tmp = t_2; elseif (t_1 <= 2e-69) tmp = 1.0 * x; elseif (t_1 <= 1e+119) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t / a), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -99999999999999997168788049560464200849936328366177157906432], t$95$2, If[LessEqual[t$95$1, 1942668892225729/971334446112864535459730953411759453321203419526069760625906204869452142602604249088], N[(1 * x), $MachinePrecision], If[LessEqual[t$95$1, 99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \frac{t}{a} \cdot y\\
\mathbf{if}\;t\_1 \leq -99999999999999997168788049560464200849936328366177157906432:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \frac{1942668892225729}{971334446112864535459730953411759453321203419526069760625906204869452142602604249088}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;t\_1 \leq 99999999999999994416755247254933381274972870380190006824232035607637985622760311004411949604741731366073618283536318464:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.9999999999999997e58 or 9.9999999999999994e118 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.2%
Applied rewrites95.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.2%
Applied rewrites26.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6428.2%
Applied rewrites28.2%
Taylor expanded in z around 0
Applied rewrites20.0%
if -9.9999999999999997e58 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.9999999999999999e-69Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
metadata-evalN/A
lower-unsound-+.f64N/A
metadata-evalN/A
lower-unsound-/.f6458.1%
Applied rewrites58.1%
Taylor expanded in x around inf
Applied rewrites50.8%
if 1.9999999999999999e-69 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999994e118Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
(FPCore (x y z t a)
:precision binary64
(if (<=
(/ (- z t) (- z a))
1294652232923503/196159429230833773869868419475239575503198607639501078528)
(* 1 x)
(+ x y)))double code(double x, double y, double z, double t, double a) {
double tmp;
if (((z - t) / (z - a)) <= 6.6e-42) {
tmp = 1.0 * x;
} else {
tmp = x + y;
}
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 - t) / (z - a)) <= 6.6d-42) then
tmp = 1.0d0 * x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((z - t) / (z - a)) <= 6.6e-42) {
tmp = 1.0 * x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((z - t) / (z - a)) <= 6.6e-42: tmp = 1.0 * x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(z - t) / Float64(z - a)) <= 6.6e-42) tmp = Float64(1.0 * x); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((z - t) / (z - a)) <= 6.6e-42) tmp = 1.0 * x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], 1294652232923503/196159429230833773869868419475239575503198607639501078528], N[(1 * x), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\frac{z - t}{z - a} \leq \frac{1294652232923503}{196159429230833773869868419475239575503198607639501078528}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 6.6000000000000005e-42Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
metadata-evalN/A
lower-unsound-+.f64N/A
metadata-evalN/A
lower-unsound-/.f6458.1%
Applied rewrites58.1%
Taylor expanded in x around inf
Applied rewrites50.8%
if 6.6000000000000005e-42 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + y
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
x + y
Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
(FPCore (x y z t a) :precision binary64 y)
double code(double x, double y, double z, double t, double a) {
return y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = y
end function
public static double code(double x, double y, double z, double t, double a) {
return y;
}
def code(x, y, z, t, a): return y
function code(x, y, z, t, a) return y end
function tmp = code(x, y, z, t, a) tmp = y; end
code[x_, y_, z_, t_, a_] := y
y
Initial program 98.2%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
Taylor expanded in x around 0
Applied rewrites19.0%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
(+ x (* y (/ (- z t) (- z a)))))