
(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 13 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.1%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/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.1%
Applied rewrites98.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -420000000000000001878680817402491437056)
(+ x (* (/ z (- z a)) t))
(if (<= z 4242751136953197/18446744073709551616)
(+ x (/ (* t y) (- a z)))
(+ x (* (/ (- z y) z) t)))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+38) {
tmp = x + ((z / (z - a)) * t);
} else if (z <= 0.00023) {
tmp = x + ((t * y) / (a - z));
} else {
tmp = x + (((z - y) / 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) :: tmp
if (z <= (-4.2d+38)) then
tmp = x + ((z / (z - a)) * t)
else if (z <= 0.00023d0) then
tmp = x + ((t * y) / (a - z))
else
tmp = x + (((z - y) / z) * 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 <= -4.2e+38) {
tmp = x + ((z / (z - a)) * t);
} else if (z <= 0.00023) {
tmp = x + ((t * y) / (a - z));
} else {
tmp = x + (((z - y) / z) * t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.2e+38: tmp = x + ((z / (z - a)) * t) elif z <= 0.00023: tmp = x + ((t * y) / (a - z)) else: tmp = x + (((z - y) / z) * t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e+38) tmp = Float64(x + Float64(Float64(z / Float64(z - a)) * t)); elseif (z <= 0.00023) tmp = Float64(x + Float64(Float64(t * y) / Float64(a - z))); else tmp = Float64(x + Float64(Float64(Float64(z - y) / z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.2e+38) tmp = x + ((z / (z - a)) * t); elseif (z <= 0.00023) tmp = x + ((t * y) / (a - z)); else tmp = x + (((z - y) / z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -420000000000000001878680817402491437056], N[(x + N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4242751136953197/18446744073709551616], N[(x + N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -420000000000000001878680817402491437056:\\
\;\;\;\;x + \frac{z}{z - a} \cdot t\\
\mathbf{elif}\;z \leq \frac{4242751136953197}{18446744073709551616}:\\
\;\;\;\;x + \frac{t \cdot y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{z} \cdot t\\
\end{array}
if z < -4.2e38Initial program 85.1%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/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.1%
Applied rewrites98.1%
Taylor expanded in y around 0
Applied rewrites71.8%
if -4.2e38 < z < 2.3000000000000001e-4Initial program 85.1%
Taylor expanded in y around inf
lower-*.f6473.4%
Applied rewrites73.4%
if 2.3000000000000001e-4 < z Initial program 85.1%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/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.1%
Applied rewrites98.1%
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 (/ (* (- y z) t) (- a z))))
(if (<= t_1 -6338253001141147/316912650057057350374175801344)
(* (/ (- y z) (- a z)) t)
(if (<=
t_1
2000000000000000047490864717302210714817315855657364374946929977340474859084041145136355256432166588258691938267680232151586826339780163146874880)
(+ 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-14) {
tmp = ((y - z) / (a - z)) * t;
} else if (t_1 <= 2e+144) {
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-14)) then
tmp = ((y - z) / (a - z)) * t
else if (t_1 <= 2d+144) 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-14) {
tmp = ((y - z) / (a - z)) * t;
} else if (t_1 <= 2e+144) {
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-14: tmp = ((y - z) / (a - z)) * t elif t_1 <= 2e+144: 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-14) tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t); elseif (t_1 <= 2e+144) 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-14) tmp = ((y - z) / (a - z)) * t; elseif (t_1 <= 2e+144) 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, -6338253001141147/316912650057057350374175801344], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, 2000000000000000047490864717302210714817315855657364374946929977340474859084041145136355256432166588258691938267680232151586826339780163146874880], 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 \frac{-6338253001141147}{316912650057057350374175801344}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\
\mathbf{elif}\;t\_1 \leq 2000000000000000047490864717302210714817315855657364374946929977340474859084041145136355256432166588258691938267680232151586826339780163146874880:\\
\;\;\;\;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)) < -2e-14Initial program 85.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
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6447.4%
Applied rewrites47.4%
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
frac-2neg-revN/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f6449.7%
Applied rewrites49.7%
if -2e-14 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2e144Initial program 85.1%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/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.1%
Applied rewrites98.1%
Taylor expanded in y around 0
Applied rewrites71.8%
if 2e144 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 85.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
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6447.4%
Applied rewrites47.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- z y) z) t))))
(if (<=
z
-8256342791959349/485667223056432267729865476705879726660601709763034880312953102434726071301302124544)
t_1
(if (<=
z
8235557476827325/200867255532373784442745261542645325315275374222849104412672)
(+ x (/ (* t y) a))
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 <= -1.7e-68) {
tmp = t_1;
} else if (z <= 4.1e-44) {
tmp = x + ((t * y) / a);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((z - y) / z) * t)
if (z <= (-1.7d-68)) then
tmp = t_1
else if (z <= 4.1d-44) then
tmp = x + ((t * y) / a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((z - y) / z) * t);
double tmp;
if (z <= -1.7e-68) {
tmp = t_1;
} else if (z <= 4.1e-44) {
tmp = x + ((t * y) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((z - y) / z) * t) tmp = 0 if z <= -1.7e-68: tmp = t_1 elif z <= 4.1e-44: tmp = x + ((t * y) / a) 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 <= -1.7e-68) tmp = t_1; elseif (z <= 4.1e-44) tmp = Float64(x + Float64(Float64(t * y) / a)); 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 <= -1.7e-68) tmp = t_1; elseif (z <= 4.1e-44) tmp = x + ((t * y) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8256342791959349/485667223056432267729865476705879726660601709763034880312953102434726071301302124544], t$95$1, If[LessEqual[z, 8235557476827325/200867255532373784442745261542645325315275374222849104412672], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \frac{z - y}{z} \cdot t\\
\mathbf{if}\;z \leq \frac{-8256342791959349}{485667223056432267729865476705879726660601709763034880312953102434726071301302124544}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{8235557476827325}{200867255532373784442745261542645325315275374222849104412672}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.7000000000000001e-68 or 4.0999999999999999e-44 < z Initial program 85.1%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/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.1%
Applied rewrites98.1%
Taylor expanded in a around 0
lower-/.f64N/A
lower--.f6467.0%
Applied rewrites67.0%
if -1.7000000000000001e-68 < z < 4.0999999999999999e-44Initial program 85.1%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6460.1%
Applied rewrites60.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- y z) t) (- a z))))
(if (<= t_1 -6338253001141147/316912650057057350374175801344)
(* (/ (- y z) (- a z)) t)
(if (<=
t_1
-3334007216439927/1667003608219963568519962947680314449286189580578977040099064452941009309454408017880358050217888572685732477648358310111472200413529841270090839013082707511523789394878503639615769571477953506182241254033971650495422687009369115322790969344)
(+ x t)
(if (<=
t_1
6183260036827613/123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349568)
(+ x (/ (* t y) a))
(if (<= t_1 500000000000000021922921522538098677317023825920)
(+ x 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-14) {
tmp = ((y - z) / (a - z)) * t;
} else if (t_1 <= -2e-225) {
tmp = x + t;
} else if (t_1 <= 5e-158) {
tmp = x + ((t * y) / a);
} else if (t_1 <= 5e+47) {
tmp = x + 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-14)) then
tmp = ((y - z) / (a - z)) * t
else if (t_1 <= (-2d-225)) then
tmp = x + t
else if (t_1 <= 5d-158) then
tmp = x + ((t * y) / a)
else if (t_1 <= 5d+47) then
tmp = x + 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-14) {
tmp = ((y - z) / (a - z)) * t;
} else if (t_1 <= -2e-225) {
tmp = x + t;
} else if (t_1 <= 5e-158) {
tmp = x + ((t * y) / a);
} else if (t_1 <= 5e+47) {
tmp = x + 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-14: tmp = ((y - z) / (a - z)) * t elif t_1 <= -2e-225: tmp = x + t elif t_1 <= 5e-158: tmp = x + ((t * y) / a) elif t_1 <= 5e+47: tmp = x + 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-14) tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t); elseif (t_1 <= -2e-225) tmp = Float64(x + t); elseif (t_1 <= 5e-158) tmp = Float64(x + Float64(Float64(t * y) / a)); elseif (t_1 <= 5e+47) tmp = Float64(x + 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-14) tmp = ((y - z) / (a - z)) * t; elseif (t_1 <= -2e-225) tmp = x + t; elseif (t_1 <= 5e-158) tmp = x + ((t * y) / a); elseif (t_1 <= 5e+47) tmp = x + 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, -6338253001141147/316912650057057350374175801344], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, -3334007216439927/1667003608219963568519962947680314449286189580578977040099064452941009309454408017880358050217888572685732477648358310111472200413529841270090839013082707511523789394878503639615769571477953506182241254033971650495422687009369115322790969344], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 6183260036827613/123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349568], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 500000000000000021922921522538098677317023825920], N[(x + t), $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 \frac{-6338253001141147}{316912650057057350374175801344}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\
\mathbf{elif}\;t\_1 \leq \frac{-3334007216439927}{1667003608219963568519962947680314449286189580578977040099064452941009309454408017880358050217888572685732477648358310111472200413529841270090839013082707511523789394878503639615769571477953506182241254033971650495422687009369115322790969344}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq \frac{6183260036827613}{123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349568}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{elif}\;t\_1 \leq 500000000000000021922921522538098677317023825920:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{a - z} \cdot \left(y - z\right)\\
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -2e-14Initial program 85.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
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6447.4%
Applied rewrites47.4%
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
frac-2neg-revN/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f6449.7%
Applied rewrites49.7%
if -2e-14 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -1.9999999999999999e-225 or 4.9999999999999997e-158 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 5.0000000000000002e47Initial program 85.1%
Taylor expanded in z around inf
Applied rewrites60.5%
if -1.9999999999999999e-225 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 4.9999999999999997e-158Initial program 85.1%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6460.1%
Applied rewrites60.1%
if 5.0000000000000002e47 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 85.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
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6447.4%
Applied rewrites47.4%
(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 -6338253001141147/316912650057057350374175801344)
t_1
(if (<=
t_2
-3334007216439927/1667003608219963568519962947680314449286189580578977040099064452941009309454408017880358050217888572685732477648358310111472200413529841270090839013082707511523789394878503639615769571477953506182241254033971650495422687009369115322790969344)
(+ x t)
(if (<=
t_2
6183260036827613/123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349568)
(+ x (/ (* t y) a))
(if (<= t_2 500000000000000021922921522538098677317023825920)
(+ 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 <= -2e-14) {
tmp = t_1;
} else if (t_2 <= -2e-225) {
tmp = x + t;
} else if (t_2 <= 5e-158) {
tmp = x + ((t * y) / a);
} else if (t_2 <= 5e+47) {
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 <= (-2d-14)) then
tmp = t_1
else if (t_2 <= (-2d-225)) then
tmp = x + t
else if (t_2 <= 5d-158) then
tmp = x + ((t * y) / a)
else if (t_2 <= 5d+47) 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 <= -2e-14) {
tmp = t_1;
} else if (t_2 <= -2e-225) {
tmp = x + t;
} else if (t_2 <= 5e-158) {
tmp = x + ((t * y) / a);
} else if (t_2 <= 5e+47) {
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 <= -2e-14: tmp = t_1 elif t_2 <= -2e-225: tmp = x + t elif t_2 <= 5e-158: tmp = x + ((t * y) / a) elif t_2 <= 5e+47: 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 <= -2e-14) tmp = t_1; elseif (t_2 <= -2e-225) tmp = Float64(x + t); elseif (t_2 <= 5e-158) tmp = Float64(x + Float64(Float64(t * y) / a)); elseif (t_2 <= 5e+47) 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 <= -2e-14) tmp = t_1; elseif (t_2 <= -2e-225) tmp = x + t; elseif (t_2 <= 5e-158) tmp = x + ((t * y) / a); elseif (t_2 <= 5e+47) 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, -6338253001141147/316912650057057350374175801344], t$95$1, If[LessEqual[t$95$2, -3334007216439927/1667003608219963568519962947680314449286189580578977040099064452941009309454408017880358050217888572685732477648358310111472200413529841270090839013082707511523789394878503639615769571477953506182241254033971650495422687009369115322790969344], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, 6183260036827613/123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349568], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 500000000000000021922921522538098677317023825920], 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 \frac{-6338253001141147}{316912650057057350374175801344}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq \frac{-3334007216439927}{1667003608219963568519962947680314449286189580578977040099064452941009309454408017880358050217888572685732477648358310111472200413529841270090839013082707511523789394878503639615769571477953506182241254033971650495422687009369115322790969344}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_2 \leq \frac{6183260036827613}{123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349568}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{elif}\;t\_2 \leq 500000000000000021922921522538098677317023825920:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -2e-14 or 5.0000000000000002e47 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 85.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
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6447.4%
Applied rewrites47.4%
if -2e-14 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -1.9999999999999999e-225 or 4.9999999999999997e-158 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 5.0000000000000002e47Initial program 85.1%
Taylor expanded in z around inf
Applied rewrites60.5%
if -1.9999999999999999e-225 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 4.9999999999999997e-158Initial program 85.1%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6460.1%
Applied rewrites60.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ t z) (- z y)))))
(if (<=
z
-4613838619036107/242833611528216133864932738352939863330300854881517440156476551217363035650651062272)
t_1
(if (<=
z
1318191364431203/6277101735386680763835789423207666416102355444464034512896)
(+ x (/ (* t y) a))
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((t / z) * (z - y));
double tmp;
if (z <= -1.9e-68) {
tmp = t_1;
} else if (z <= 2.1e-43) {
tmp = x + ((t * y) / a);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((t / z) * (z - y))
if (z <= (-1.9d-68)) then
tmp = t_1
else if (z <= 2.1d-43) then
tmp = x + ((t * y) / a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((t / z) * (z - y));
double tmp;
if (z <= -1.9e-68) {
tmp = t_1;
} else if (z <= 2.1e-43) {
tmp = x + ((t * y) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((t / z) * (z - y)) tmp = 0 if z <= -1.9e-68: tmp = t_1 elif z <= 2.1e-43: tmp = x + ((t * y) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(t / z) * Float64(z - y))) tmp = 0.0 if (z <= -1.9e-68) tmp = t_1; elseif (z <= 2.1e-43) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((t / z) * (z - y)); tmp = 0.0; if (z <= -1.9e-68) tmp = t_1; elseif (z <= 2.1e-43) tmp = x + ((t * y) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(t / z), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4613838619036107/242833611528216133864932738352939863330300854881517440156476551217363035650651062272], t$95$1, If[LessEqual[z, 1318191364431203/6277101735386680763835789423207666416102355444464034512896], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \frac{t}{z} \cdot \left(z - y\right)\\
\mathbf{if}\;z \leq \frac{-4613838619036107}{242833611528216133864932738352939863330300854881517440156476551217363035650651062272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{1318191364431203}{6277101735386680763835789423207666416102355444464034512896}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.9000000000000002e-68 or 2.1000000000000001e-43 < z Initial program 85.1%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/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.1%
Applied rewrites98.1%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6458.7%
Applied rewrites58.7%
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f6465.6%
Applied rewrites65.6%
if -1.9000000000000002e-68 < z < 2.1000000000000001e-43Initial program 85.1%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6460.1%
Applied rewrites60.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -4799999999999999953829101568) (+ x t) (if (<= z 26000000000000000) (+ x (* (/ y a) t)) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+27) {
tmp = x + t;
} else if (z <= 2.6e+16) {
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 <= (-4.8d+27)) then
tmp = x + t
else if (z <= 2.6d+16) 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 <= -4.8e+27) {
tmp = x + t;
} else if (z <= 2.6e+16) {
tmp = x + ((y / a) * t);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.8e+27: tmp = x + t elif z <= 2.6e+16: tmp = x + ((y / a) * t) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e+27) tmp = Float64(x + t); elseif (z <= 2.6e+16) 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 <= -4.8e+27) tmp = x + t; elseif (z <= 2.6e+16) tmp = x + ((y / a) * t); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4799999999999999953829101568], N[(x + t), $MachinePrecision], If[LessEqual[z, 26000000000000000], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -4799999999999999953829101568:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 26000000000000000:\\
\;\;\;\;x + \frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
if z < -4.8e27 or 2.6e16 < z Initial program 85.1%
Taylor expanded in z around inf
Applied rewrites60.5%
if -4.8e27 < z < 2.6e16Initial program 85.1%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/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.1%
Applied rewrites98.1%
Taylor expanded in z around 0
lower-/.f6461.5%
Applied rewrites61.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4999999999999999791559868416)
(+ x t)
(if (<= z 1590140912926291/649037107316853453566312041152512)
(+ x (/ (* t y) a))
(+ x t))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e+27) {
tmp = x + t;
} else if (z <= 2.45e-18) {
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 <= (-5d+27)) then
tmp = x + t
else if (z <= 2.45d-18) 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 <= -5e+27) {
tmp = x + t;
} else if (z <= 2.45e-18) {
tmp = x + ((t * y) / a);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5e+27: tmp = x + t elif z <= 2.45e-18: tmp = x + ((t * y) / a) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e+27) tmp = Float64(x + t); elseif (z <= 2.45e-18) 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 <= -5e+27) tmp = x + t; elseif (z <= 2.45e-18) tmp = x + ((t * y) / a); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4999999999999999791559868416], N[(x + t), $MachinePrecision], If[LessEqual[z, 1590140912926291/649037107316853453566312041152512], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -4999999999999999791559868416:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq \frac{1590140912926291}{649037107316853453566312041152512}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
if z < -4.9999999999999998e27 or 2.4500000000000001e-18 < z Initial program 85.1%
Taylor expanded in z around inf
Applied rewrites60.5%
if -4.9999999999999998e27 < z < 2.4500000000000001e-18Initial program 85.1%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6460.1%
Applied rewrites60.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y (- a z)) t)))
(if (<=
y
-125000000000000004714848161632068786467724214271375990583792072320444331735548805624202380779518698661634426763635923712456941447904364351344500703752365677891099149098885108365277599999000415576260608)
t_1
(if (<=
y
6500000000000000106196004345803255164756849025361838451046535828149741892512568564695125575801263618109502173149575593363745726195467295895700360130074478143777178143768408366629599996836639792909642313474686134012229284104994296318231092133888)
(+ x t)
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = (y / (a - z)) * t;
double tmp;
if (y <= -1.25e+200) {
tmp = t_1;
} else if (y <= 6.5e+243) {
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) :: tmp
t_1 = (y / (a - z)) * t
if (y <= (-1.25d+200)) then
tmp = t_1
else if (y <= 6.5d+243) 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 = (y / (a - z)) * t;
double tmp;
if (y <= -1.25e+200) {
tmp = t_1;
} else if (y <= 6.5e+243) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / (a - z)) * t tmp = 0 if y <= -1.25e+200: tmp = t_1 elif y <= 6.5e+243: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / Float64(a - z)) * t) tmp = 0.0 if (y <= -1.25e+200) tmp = t_1; elseif (y <= 6.5e+243) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / (a - z)) * t; tmp = 0.0; if (y <= -1.25e+200) tmp = t_1; elseif (y <= 6.5e+243) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -125000000000000004714848161632068786467724214271375990583792072320444331735548805624202380779518698661634426763635923712456941447904364351344500703752365677891099149098885108365277599999000415576260608], t$95$1, If[LessEqual[y, 6500000000000000106196004345803255164756849025361838451046535828149741892512568564695125575801263618109502173149575593363745726195467295895700360130074478143777178143768408366629599996836639792909642313474686134012229284104994296318231092133888], N[(x + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{y}{a - z} \cdot t\\
\mathbf{if}\;y \leq -125000000000000004714848161632068786467724214271375990583792072320444331735548805624202380779518698661634426763635923712456941447904364351344500703752365677891099149098885108365277599999000415576260608:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6500000000000000106196004345803255164756849025361838451046535828149741892512568564695125575801263618109502173149575593363745726195467295895700360130074478143777178143768408366629599996836639792909642313474686134012229284104994296318231092133888:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.25e200 or 6.5000000000000001e243 < y Initial program 85.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
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6447.4%
Applied rewrites47.4%
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
frac-2neg-revN/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f6449.7%
Applied rewrites49.7%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6428.5%
Applied rewrites28.5%
if -1.25e200 < y < 6.5000000000000001e243Initial program 85.1%
Taylor expanded in z around inf
Applied rewrites60.5%
(FPCore (x y z t a)
:precision binary64
(if (<=
z
-8338720222318261/94758184344525691842589080106353915726128296943157752144717531617800961467674370503593652882607817257720198406807316479868870852301929589321550737002025216015896910157522577243058183937475491017166931103132108688408987234729984)
(+ x t)
(if (<=
z
-7540071506325551/377003575316277553052632783947358479815640765734281611362288441560101396530857955835685848633641608981764089063400052322800846281248691448694119974860434438887084693231743502178167752441192448774799271819130974018130465379775860716808779827596916922071594850183201524526501846714374614008118077197384100897810808832)
(/ (* t y) a)
(+ x t))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.8e-212) {
tmp = x + t;
} else if (z <= -2e-299) {
tmp = (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 <= (-8.8d-212)) then
tmp = x + t
else if (z <= (-2d-299)) then
tmp = (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 <= -8.8e-212) {
tmp = x + t;
} else if (z <= -2e-299) {
tmp = (t * y) / a;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.8e-212: tmp = x + t elif z <= -2e-299: tmp = (t * y) / a else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.8e-212) tmp = Float64(x + t); elseif (z <= -2e-299) tmp = 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 <= -8.8e-212) tmp = x + t; elseif (z <= -2e-299) tmp = (t * y) / a; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8338720222318261/94758184344525691842589080106353915726128296943157752144717531617800961467674370503593652882607817257720198406807316479868870852301929589321550737002025216015896910157522577243058183937475491017166931103132108688408987234729984], N[(x + t), $MachinePrecision], If[LessEqual[z, -7540071506325551/377003575316277553052632783947358479815640765734281611362288441560101396530857955835685848633641608981764089063400052322800846281248691448694119974860434438887084693231743502178167752441192448774799271819130974018130465379775860716808779827596916922071594850183201524526501846714374614008118077197384100897810808832], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-8338720222318261}{94758184344525691842589080106353915726128296943157752144717531617800961467674370503593652882607817257720198406807316479868870852301929589321550737002025216015896910157522577243058183937475491017166931103132108688408987234729984}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq \frac{-7540071506325551}{377003575316277553052632783947358479815640765734281611362288441560101396530857955835685848633641608981764089063400052322800846281248691448694119974860434438887084693231743502178167752441192448774799271819130974018130465379775860716808779827596916922071594850183201524526501846714374614008118077197384100897810808832}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
if z < -8.8000000000000001e-212 or -2e-299 < z Initial program 85.1%
Taylor expanded in z around inf
Applied rewrites60.5%
if -8.8000000000000001e-212 < z < -2e-299Initial program 85.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 y around inf
lower-*.f6426.5%
Applied rewrites26.5%
Taylor expanded in z around 0
Applied rewrites18.4%
(FPCore (x y z t a)
:precision binary64
(if (<=
z
-8338720222318261/94758184344525691842589080106353915726128296943157752144717531617800961467674370503593652882607817257720198406807316479868870852301929589321550737002025216015896910157522577243058183937475491017166931103132108688408987234729984)
(+ x t)
(if (<=
z
-7540071506325551/377003575316277553052632783947358479815640765734281611362288441560101396530857955835685848633641608981764089063400052322800846281248691448694119974860434438887084693231743502178167752441192448774799271819130974018130465379775860716808779827596916922071594850183201524526501846714374614008118077197384100897810808832)
(* (/ y a) t)
(+ x t))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.8e-212) {
tmp = x + t;
} else if (z <= -2e-299) {
tmp = (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 <= (-8.8d-212)) then
tmp = x + t
else if (z <= (-2d-299)) then
tmp = (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 <= -8.8e-212) {
tmp = x + t;
} else if (z <= -2e-299) {
tmp = (y / a) * t;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.8e-212: tmp = x + t elif z <= -2e-299: tmp = (y / a) * t else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.8e-212) tmp = Float64(x + t); elseif (z <= -2e-299) tmp = 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 <= -8.8e-212) tmp = x + t; elseif (z <= -2e-299) tmp = (y / a) * t; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8338720222318261/94758184344525691842589080106353915726128296943157752144717531617800961467674370503593652882607817257720198406807316479868870852301929589321550737002025216015896910157522577243058183937475491017166931103132108688408987234729984], N[(x + t), $MachinePrecision], If[LessEqual[z, -7540071506325551/377003575316277553052632783947358479815640765734281611362288441560101396530857955835685848633641608981764089063400052322800846281248691448694119974860434438887084693231743502178167752441192448774799271819130974018130465379775860716808779827596916922071594850183201524526501846714374614008118077197384100897810808832], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-8338720222318261}{94758184344525691842589080106353915726128296943157752144717531617800961467674370503593652882607817257720198406807316479868870852301929589321550737002025216015896910157522577243058183937475491017166931103132108688408987234729984}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq \frac{-7540071506325551}{377003575316277553052632783947358479815640765734281611362288441560101396530857955835685848633641608981764089063400052322800846281248691448694119974860434438887084693231743502178167752441192448774799271819130974018130465379775860716808779827596916922071594850183201524526501846714374614008118077197384100897810808832}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
if z < -8.8000000000000001e-212 or -2e-299 < z Initial program 85.1%
Taylor expanded in z around inf
Applied rewrites60.5%
if -8.8000000000000001e-212 < z < -2e-299Initial program 85.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
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6447.4%
Applied rewrites47.4%
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
frac-2neg-revN/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f6449.7%
Applied rewrites49.7%
Taylor expanded in z around 0
lower-/.f6420.0%
Applied rewrites20.0%
(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.1%
Taylor expanded in z around inf
Applied rewrites60.5%
herbie shell --seed 2025271 -o generate:evaluate
(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))))