
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - 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 + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{\left(y - z\right) \cdot t}{a - z}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - 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 + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{\left(y - z\right) \cdot t}{a - z}
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- z y) (- z a)) t)))
double code(double x, double y, double z, double t, double a) {
return x + (((z - y) / (z - a)) * t);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((z - y) / (z - a)) * t)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((z - y) / (z - a)) * t);
}
def code(x, y, z, t, a): return x + (((z - y) / (z - a)) * t)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(z - y) / Float64(z - a)) * t)) end
function tmp = code(x, y, z, t, a) tmp = x + (((z - y) / (z - a)) * t); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
x + \frac{z - y}{z - a} \cdot t
Initial program 85.7%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
mult-flip-revN/A
lower-*.f64N/A
mult-flip-revN/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.4%
Applied rewrites98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- y z) t) (- a z))))
(if (<= t_1 -2e+117)
(* (/ (- z y) (- z a)) t)
(if (<= t_1 1e+147)
(+ x (* (/ z (- z a)) t))
(* (/ t (- a z)) (- y z))))))double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if (t_1 <= -2e+117) {
tmp = ((z - y) / (z - a)) * t;
} else if (t_1 <= 1e+147) {
tmp = x + ((z / (z - a)) * t);
} else {
tmp = (t / (a - z)) * (y - z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((y - z) * t) / (a - z)
if (t_1 <= (-2d+117)) then
tmp = ((z - y) / (z - a)) * t
else if (t_1 <= 1d+147) then
tmp = x + ((z / (z - a)) * t)
else
tmp = (t / (a - z)) * (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if (t_1 <= -2e+117) {
tmp = ((z - y) / (z - a)) * t;
} else if (t_1 <= 1e+147) {
tmp = x + ((z / (z - a)) * t);
} else {
tmp = (t / (a - z)) * (y - z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) * t) / (a - z) tmp = 0 if t_1 <= -2e+117: tmp = ((z - y) / (z - a)) * t elif t_1 <= 1e+147: tmp = x + ((z / (z - a)) * t) else: tmp = (t / (a - z)) * (y - z) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_1 <= -2e+117) tmp = Float64(Float64(Float64(z - y) / Float64(z - a)) * t); elseif (t_1 <= 1e+147) tmp = Float64(x + Float64(Float64(z / Float64(z - a)) * t)); else tmp = Float64(Float64(t / Float64(a - z)) * Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_1 <= -2e+117) tmp = ((z - y) / (z - a)) * t; elseif (t_1 <= 1e+147) tmp = x + ((z / (z - a)) * t); else tmp = (t / (a - z)) * (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+117], N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, 1e+147], N[(x + N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+117}:\\
\;\;\;\;\frac{z - y}{z - a} \cdot t\\
\mathbf{elif}\;t\_1 \leq 10^{+147}:\\
\;\;\;\;x + \frac{z}{z - a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{a - z} \cdot \left(y - z\right)\\
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -2.0000000000000001e117Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.3%
Applied rewrites39.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lower-/.f64N/A
lower--.f6449.2%
Applied rewrites49.2%
if -2.0000000000000001e117 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 9.9999999999999998e146Initial program 85.7%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
mult-flip-revN/A
lower-*.f64N/A
mult-flip-revN/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.4%
Applied rewrites98.4%
Taylor expanded in y around 0
Applied rewrites72.1%
if 9.9999999999999998e146 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.3%
Applied rewrites39.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6446.4%
Applied rewrites46.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- z y) z) t))))
(if (<= z -2.55e-126)
t_1
(if (<= z 1e-51) (+ x (* (/ y a) t)) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((z - y) / z) * t);
double tmp;
if (z <= -2.55e-126) {
tmp = t_1;
} else if (z <= 1e-51) {
tmp = x + ((y / a) * t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((z - y) / z) * t)
if (z <= (-2.55d-126)) then
tmp = t_1
else if (z <= 1d-51) then
tmp = x + ((y / a) * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((z - y) / z) * t);
double tmp;
if (z <= -2.55e-126) {
tmp = t_1;
} else if (z <= 1e-51) {
tmp = x + ((y / a) * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((z - y) / z) * t) tmp = 0 if z <= -2.55e-126: tmp = t_1 elif z <= 1e-51: tmp = x + ((y / a) * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(z - y) / z) * t)) tmp = 0.0 if (z <= -2.55e-126) tmp = t_1; elseif (z <= 1e-51) tmp = Float64(x + Float64(Float64(y / a) * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((z - y) / z) * t); tmp = 0.0; if (z <= -2.55e-126) tmp = t_1; elseif (z <= 1e-51) tmp = x + ((y / a) * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.55e-126], t$95$1, If[LessEqual[z, 1e-51], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \frac{z - y}{z} \cdot t\\
\mathbf{if}\;z \leq -2.55 \cdot 10^{-126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{-51}:\\
\;\;\;\;x + \frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.55e-126 or 1e-51 < z Initial program 85.7%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
mult-flip-revN/A
lower-*.f64N/A
mult-flip-revN/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.4%
Applied rewrites98.4%
Taylor expanded in a around 0
lower-/.f64N/A
lower--.f6468.0%
Applied rewrites68.0%
if -2.55e-126 < z < 1e-51Initial program 85.7%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
mult-flip-revN/A
lower-*.f64N/A
mult-flip-revN/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.4%
Applied rewrites98.4%
Taylor expanded in z around 0
lower-/.f6461.8%
Applied rewrites61.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- z y) (- z a)) t))
(t_2 (/ (* (- y z) t) (- a z))))
(if (<= t_2 -2e-51)
t_1
(if (<= t_2 2e-220) (* x 1.0) (if (<= t_2 5e+58) (+ x t) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - y) / (z - a)) * t;
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -2e-51) {
tmp = t_1;
} else if (t_2 <= 2e-220) {
tmp = x * 1.0;
} else if (t_2 <= 5e+58) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((z - y) / (z - a)) * t
t_2 = ((y - z) * t) / (a - z)
if (t_2 <= (-2d-51)) then
tmp = t_1
else if (t_2 <= 2d-220) then
tmp = x * 1.0d0
else if (t_2 <= 5d+58) then
tmp = x + t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - y) / (z - a)) * t;
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -2e-51) {
tmp = t_1;
} else if (t_2 <= 2e-220) {
tmp = x * 1.0;
} else if (t_2 <= 5e+58) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - y) / (z - a)) * t t_2 = ((y - z) * t) / (a - z) tmp = 0 if t_2 <= -2e-51: tmp = t_1 elif t_2 <= 2e-220: tmp = x * 1.0 elif t_2 <= 5e+58: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - y) / Float64(z - a)) * t) t_2 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_2 <= -2e-51) tmp = t_1; elseif (t_2 <= 2e-220) tmp = Float64(x * 1.0); elseif (t_2 <= 5e+58) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - y) / (z - a)) * t; t_2 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_2 <= -2e-51) tmp = t_1; elseif (t_2 <= 2e-220) tmp = x * 1.0; elseif (t_2 <= 5e+58) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-51], t$95$1, If[LessEqual[t$95$2, 2e-220], N[(x * 1.0), $MachinePrecision], If[LessEqual[t$95$2, 5e+58], N[(x + t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := \frac{z - y}{z - a} \cdot t\\
t_2 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-220}:\\
\;\;\;\;x \cdot 1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+58}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -2e-51 or 4.9999999999999999e58 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.3%
Applied rewrites39.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lower-/.f64N/A
lower--.f6449.2%
Applied rewrites49.2%
if -2e-51 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2e-220Initial program 85.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6479.3%
Applied rewrites79.3%
Taylor expanded in x around inf
Applied rewrites51.1%
if 2e-220 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 4.9999999999999999e58Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ t (- a z)) (- y z)))
(t_2 (/ (* (- y z) t) (- a z))))
(if (<= t_2 -5e-13)
t_1
(if (<= t_2 2e-220) (* x 1.0) (if (<= t_2 5e+58) (+ x t) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = (t / (a - z)) * (y - z);
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -5e-13) {
tmp = t_1;
} else if (t_2 <= 2e-220) {
tmp = x * 1.0;
} else if (t_2 <= 5e+58) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t / (a - z)) * (y - z)
t_2 = ((y - z) * t) / (a - z)
if (t_2 <= (-5d-13)) then
tmp = t_1
else if (t_2 <= 2d-220) then
tmp = x * 1.0d0
else if (t_2 <= 5d+58) then
tmp = x + t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t / (a - z)) * (y - z);
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -5e-13) {
tmp = t_1;
} else if (t_2 <= 2e-220) {
tmp = x * 1.0;
} else if (t_2 <= 5e+58) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t / (a - z)) * (y - z) t_2 = ((y - z) * t) / (a - z) tmp = 0 if t_2 <= -5e-13: tmp = t_1 elif t_2 <= 2e-220: tmp = x * 1.0 elif t_2 <= 5e+58: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t / Float64(a - z)) * Float64(y - z)) t_2 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_2 <= -5e-13) tmp = t_1; elseif (t_2 <= 2e-220) tmp = Float64(x * 1.0); elseif (t_2 <= 5e+58) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t / (a - z)) * (y - z); t_2 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_2 <= -5e-13) tmp = t_1; elseif (t_2 <= 2e-220) tmp = x * 1.0; elseif (t_2 <= 5e+58) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-13], t$95$1, If[LessEqual[t$95$2, 2e-220], N[(x * 1.0), $MachinePrecision], If[LessEqual[t$95$2, 5e+58], N[(x + t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := \frac{t}{a - z} \cdot \left(y - z\right)\\
t_2 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-220}:\\
\;\;\;\;x \cdot 1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+58}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -4.9999999999999999e-13 or 4.9999999999999999e58 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.3%
Applied rewrites39.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6446.4%
Applied rewrites46.4%
if -4.9999999999999999e-13 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2e-220Initial program 85.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6479.3%
Applied rewrites79.3%
Taylor expanded in x around inf
Applied rewrites51.1%
if 2e-220 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 4.9999999999999999e58Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.2e-25) (+ x t) (if (<= z 0.28) (+ x (* (/ y a) t)) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e-25) {
tmp = x + t;
} else if (z <= 0.28) {
tmp = x + ((y / a) * t);
} else {
tmp = x + 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) :: tmp
if (z <= (-6.2d-25)) then
tmp = x + t
else if (z <= 0.28d0) then
tmp = x + ((y / a) * t)
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e-25) {
tmp = x + t;
} else if (z <= 0.28) {
tmp = x + ((y / a) * t);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.2e-25: tmp = x + t elif z <= 0.28: tmp = x + ((y / a) * t) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.2e-25) tmp = Float64(x + t); elseif (z <= 0.28) tmp = Float64(x + Float64(Float64(y / a) * t)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.2e-25) tmp = x + t; elseif (z <= 0.28) tmp = x + ((y / a) * t); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.2e-25], N[(x + t), $MachinePrecision], If[LessEqual[z, 0.28], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-25}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 0.28:\\
\;\;\;\;x + \frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
if z < -6.1999999999999999e-25 or 0.28000000000000003 < z Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
if -6.1999999999999999e-25 < z < 0.28000000000000003Initial program 85.7%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
mult-flip-revN/A
lower-*.f64N/A
mult-flip-revN/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.4%
Applied rewrites98.4%
Taylor expanded in z around 0
lower-/.f6461.8%
Applied rewrites61.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.2e-25) (+ x t) (if (<= z 0.28) (+ x (/ (* t y) a)) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e-25) {
tmp = x + t;
} else if (z <= 0.28) {
tmp = x + ((t * y) / a);
} else {
tmp = x + 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) :: tmp
if (z <= (-6.2d-25)) then
tmp = x + t
else if (z <= 0.28d0) then
tmp = x + ((t * y) / a)
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e-25) {
tmp = x + t;
} else if (z <= 0.28) {
tmp = x + ((t * y) / a);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.2e-25: tmp = x + t elif z <= 0.28: tmp = x + ((t * y) / a) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.2e-25) tmp = Float64(x + t); elseif (z <= 0.28) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.2e-25) tmp = x + t; elseif (z <= 0.28) tmp = x + ((t * y) / a); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.2e-25], N[(x + t), $MachinePrecision], If[LessEqual[z, 0.28], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-25}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 0.28:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
if z < -6.1999999999999999e-25 or 0.28000000000000003 < z Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
if -6.1999999999999999e-25 < z < 0.28000000000000003Initial program 85.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6460.0%
Applied rewrites60.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- z y) z) t)) (t_2 (/ (* (- y z) t) (- a z))))
(if (<= t_2 -1e+124)
t_1
(if (<= t_2 -0.0005)
(+ x t)
(if (<= t_2 2e-220)
(* x 1.0)
(if (<= t_2 2e+137)
(+ x t)
(if (<= t_2 5e+262) (/ (* t (- y z)) a) t_1)))))))double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - y) / z) * t;
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -1e+124) {
tmp = t_1;
} else if (t_2 <= -0.0005) {
tmp = x + t;
} else if (t_2 <= 2e-220) {
tmp = x * 1.0;
} else if (t_2 <= 2e+137) {
tmp = x + t;
} else if (t_2 <= 5e+262) {
tmp = (t * (y - z)) / a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((z - y) / z) * t
t_2 = ((y - z) * t) / (a - z)
if (t_2 <= (-1d+124)) then
tmp = t_1
else if (t_2 <= (-0.0005d0)) then
tmp = x + t
else if (t_2 <= 2d-220) then
tmp = x * 1.0d0
else if (t_2 <= 2d+137) then
tmp = x + t
else if (t_2 <= 5d+262) then
tmp = (t * (y - z)) / 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 = ((z - y) / z) * t;
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -1e+124) {
tmp = t_1;
} else if (t_2 <= -0.0005) {
tmp = x + t;
} else if (t_2 <= 2e-220) {
tmp = x * 1.0;
} else if (t_2 <= 2e+137) {
tmp = x + t;
} else if (t_2 <= 5e+262) {
tmp = (t * (y - z)) / a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - y) / z) * t t_2 = ((y - z) * t) / (a - z) tmp = 0 if t_2 <= -1e+124: tmp = t_1 elif t_2 <= -0.0005: tmp = x + t elif t_2 <= 2e-220: tmp = x * 1.0 elif t_2 <= 2e+137: tmp = x + t elif t_2 <= 5e+262: tmp = (t * (y - z)) / a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - y) / z) * t) t_2 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_2 <= -1e+124) tmp = t_1; elseif (t_2 <= -0.0005) tmp = Float64(x + t); elseif (t_2 <= 2e-220) tmp = Float64(x * 1.0); elseif (t_2 <= 2e+137) tmp = Float64(x + t); elseif (t_2 <= 5e+262) tmp = Float64(Float64(t * Float64(y - z)) / a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - y) / z) * t; t_2 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_2 <= -1e+124) tmp = t_1; elseif (t_2 <= -0.0005) tmp = x + t; elseif (t_2 <= 2e-220) tmp = x * 1.0; elseif (t_2 <= 2e+137) tmp = x + t; elseif (t_2 <= 5e+262) tmp = (t * (y - z)) / a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+124], t$95$1, If[LessEqual[t$95$2, -0.0005], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, 2e-220], N[(x * 1.0), $MachinePrecision], If[LessEqual[t$95$2, 2e+137], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, 5e+262], N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
t_1 := \frac{z - y}{z} \cdot t\\
t_2 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -0.0005:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-220}:\\
\;\;\;\;x \cdot 1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+137}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+262}:\\
\;\;\;\;\frac{t \cdot \left(y - z\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -9.9999999999999995e123 or 5.0000000000000001e262 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.3%
Applied rewrites39.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lower-/.f64N/A
lower--.f6449.2%
Applied rewrites49.2%
Taylor expanded in a around 0
lower-/.f64N/A
lower--.f6431.5%
Applied rewrites31.5%
if -9.9999999999999995e123 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -5.0000000000000001e-4 or 2e-220 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2.0000000000000001e137Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
if -5.0000000000000001e-4 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2e-220Initial program 85.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6479.3%
Applied rewrites79.3%
Taylor expanded in x around inf
Applied rewrites51.1%
if 2.0000000000000001e137 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 5.0000000000000001e262Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.3%
Applied rewrites39.3%
Taylor expanded in z around 0
Applied rewrites21.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- z y) z) t)) (t_2 (/ (* (- y z) t) (- a z))))
(if (<= t_2 -1e+124)
t_1
(if (<= t_2 -0.0005)
(+ x t)
(if (<= t_2 2e-220)
(* x 1.0)
(if (<= t_2 2e+137)
(+ x t)
(if (<= t_2 5e+262) (* (/ t a) (- y z)) t_1)))))))double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - y) / z) * t;
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -1e+124) {
tmp = t_1;
} else if (t_2 <= -0.0005) {
tmp = x + t;
} else if (t_2 <= 2e-220) {
tmp = x * 1.0;
} else if (t_2 <= 2e+137) {
tmp = x + t;
} else if (t_2 <= 5e+262) {
tmp = (t / a) * (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) :: t_2
real(8) :: tmp
t_1 = ((z - y) / z) * t
t_2 = ((y - z) * t) / (a - z)
if (t_2 <= (-1d+124)) then
tmp = t_1
else if (t_2 <= (-0.0005d0)) then
tmp = x + t
else if (t_2 <= 2d-220) then
tmp = x * 1.0d0
else if (t_2 <= 2d+137) then
tmp = x + t
else if (t_2 <= 5d+262) then
tmp = (t / a) * (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 = ((z - y) / z) * t;
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -1e+124) {
tmp = t_1;
} else if (t_2 <= -0.0005) {
tmp = x + t;
} else if (t_2 <= 2e-220) {
tmp = x * 1.0;
} else if (t_2 <= 2e+137) {
tmp = x + t;
} else if (t_2 <= 5e+262) {
tmp = (t / a) * (y - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - y) / z) * t t_2 = ((y - z) * t) / (a - z) tmp = 0 if t_2 <= -1e+124: tmp = t_1 elif t_2 <= -0.0005: tmp = x + t elif t_2 <= 2e-220: tmp = x * 1.0 elif t_2 <= 2e+137: tmp = x + t elif t_2 <= 5e+262: tmp = (t / a) * (y - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - y) / z) * t) t_2 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_2 <= -1e+124) tmp = t_1; elseif (t_2 <= -0.0005) tmp = Float64(x + t); elseif (t_2 <= 2e-220) tmp = Float64(x * 1.0); elseif (t_2 <= 2e+137) tmp = Float64(x + t); elseif (t_2 <= 5e+262) tmp = Float64(Float64(t / a) * Float64(y - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - y) / z) * t; t_2 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_2 <= -1e+124) tmp = t_1; elseif (t_2 <= -0.0005) tmp = x + t; elseif (t_2 <= 2e-220) tmp = x * 1.0; elseif (t_2 <= 2e+137) tmp = x + t; elseif (t_2 <= 5e+262) tmp = (t / a) * (y - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+124], t$95$1, If[LessEqual[t$95$2, -0.0005], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, 2e-220], N[(x * 1.0), $MachinePrecision], If[LessEqual[t$95$2, 2e+137], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, 5e+262], N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
t_1 := \frac{z - y}{z} \cdot t\\
t_2 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -0.0005:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-220}:\\
\;\;\;\;x \cdot 1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+137}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+262}:\\
\;\;\;\;\frac{t}{a} \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -9.9999999999999995e123 or 5.0000000000000001e262 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.3%
Applied rewrites39.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lower-/.f64N/A
lower--.f6449.2%
Applied rewrites49.2%
Taylor expanded in a around 0
lower-/.f64N/A
lower--.f6431.5%
Applied rewrites31.5%
if -9.9999999999999995e123 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -5.0000000000000001e-4 or 2e-220 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2.0000000000000001e137Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
if -5.0000000000000001e-4 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2e-220Initial program 85.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6479.3%
Applied rewrites79.3%
Taylor expanded in x around inf
Applied rewrites51.1%
if 2.0000000000000001e137 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 5.0000000000000001e262Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.3%
Applied rewrites39.3%
Taylor expanded in z around 0
Applied rewrites21.5%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f6423.5%
Applied rewrites23.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- z y) z) t)) (t_2 (/ (* (- y z) t) (- a z))))
(if (<= t_2 -1e+124)
t_1
(if (<= t_2 -0.0005)
(+ x t)
(if (<= t_2 2e-220)
(* x 1.0)
(if (<= t_2 1e+195) (+ x t) t_1))))))double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - y) / z) * t;
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -1e+124) {
tmp = t_1;
} else if (t_2 <= -0.0005) {
tmp = x + t;
} else if (t_2 <= 2e-220) {
tmp = x * 1.0;
} else if (t_2 <= 1e+195) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((z - y) / z) * t
t_2 = ((y - z) * t) / (a - z)
if (t_2 <= (-1d+124)) then
tmp = t_1
else if (t_2 <= (-0.0005d0)) then
tmp = x + t
else if (t_2 <= 2d-220) then
tmp = x * 1.0d0
else if (t_2 <= 1d+195) then
tmp = x + t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - y) / z) * t;
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -1e+124) {
tmp = t_1;
} else if (t_2 <= -0.0005) {
tmp = x + t;
} else if (t_2 <= 2e-220) {
tmp = x * 1.0;
} else if (t_2 <= 1e+195) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - y) / z) * t t_2 = ((y - z) * t) / (a - z) tmp = 0 if t_2 <= -1e+124: tmp = t_1 elif t_2 <= -0.0005: tmp = x + t elif t_2 <= 2e-220: tmp = x * 1.0 elif t_2 <= 1e+195: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - y) / z) * t) t_2 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_2 <= -1e+124) tmp = t_1; elseif (t_2 <= -0.0005) tmp = Float64(x + t); elseif (t_2 <= 2e-220) tmp = Float64(x * 1.0); elseif (t_2 <= 1e+195) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - y) / z) * t; t_2 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_2 <= -1e+124) tmp = t_1; elseif (t_2 <= -0.0005) tmp = x + t; elseif (t_2 <= 2e-220) tmp = x * 1.0; elseif (t_2 <= 1e+195) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+124], t$95$1, If[LessEqual[t$95$2, -0.0005], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, 2e-220], N[(x * 1.0), $MachinePrecision], If[LessEqual[t$95$2, 1e+195], N[(x + t), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
t_1 := \frac{z - y}{z} \cdot t\\
t_2 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -0.0005:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-220}:\\
\;\;\;\;x \cdot 1\\
\mathbf{elif}\;t\_2 \leq 10^{+195}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -9.9999999999999995e123 or 9.9999999999999998e194 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.3%
Applied rewrites39.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lower-/.f64N/A
lower--.f6449.2%
Applied rewrites49.2%
Taylor expanded in a around 0
lower-/.f64N/A
lower--.f6431.5%
Applied rewrites31.5%
if -9.9999999999999995e123 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -5.0000000000000001e-4 or 2e-220 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 9.9999999999999998e194Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
if -5.0000000000000001e-4 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2e-220Initial program 85.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6479.3%
Applied rewrites79.3%
Taylor expanded in x around inf
Applied rewrites51.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -4e-25) (+ x t) (if (<= z 4.4e-22) (* x 1.0) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e-25) {
tmp = x + t;
} else if (z <= 4.4e-22) {
tmp = x * 1.0;
} else {
tmp = x + 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) :: tmp
if (z <= (-4d-25)) then
tmp = x + t
else if (z <= 4.4d-22) then
tmp = x * 1.0d0
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e-25) {
tmp = x + t;
} else if (z <= 4.4e-22) {
tmp = x * 1.0;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4e-25: tmp = x + t elif z <= 4.4e-22: tmp = x * 1.0 else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e-25) tmp = Float64(x + t); elseif (z <= 4.4e-22) tmp = Float64(x * 1.0); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4e-25) tmp = x + t; elseif (z <= 4.4e-22) tmp = x * 1.0; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e-25], N[(x + t), $MachinePrecision], If[LessEqual[z, 4.4e-22], N[(x * 1.0), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-25}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-22}:\\
\;\;\;\;x \cdot 1\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
if z < -4.0000000000000002e-25 or 4.4000000000000001e-22 < z Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
if -4.0000000000000002e-25 < z < 4.4000000000000001e-22Initial program 85.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6479.3%
Applied rewrites79.3%
Taylor expanded in x around inf
Applied rewrites51.1%
(FPCore (x y z t a) :precision binary64 (+ x t))
double code(double x, double y, double z, double t, double a) {
return x + t;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + t
end function
public static double code(double x, double y, double z, double t, double a) {
return x + t;
}
def code(x, y, z, t, a): return x + t
function code(x, y, z, t, a) return Float64(x + t) end
function tmp = code(x, y, z, t, a) tmp = x + t; end
code[x_, y_, z_, t_, a_] := N[(x + t), $MachinePrecision]
x + t
Initial program 85.7%
Taylor expanded in z around inf
Applied rewrites61.1%
herbie shell --seed 2025258
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
(+ x (/ (* (- y z) t) (- a z))))