
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (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 - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (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 - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<=
t_1
-4825645764048353/12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624)
(+ x (* (- x t) (/ (- z y) (- a z))))
(if (<= t_1 0)
(+ t (/ (- a y) (/ z (- t x))))
(+ x (* (- x t) (* (/ -1 (- a z)) (- y z))))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -4e-301) {
tmp = x + ((x - t) * ((z - y) / (a - z)));
} else if (t_1 <= 0.0) {
tmp = t + ((a - y) / (z / (t - x)));
} else {
tmp = x + ((x - t) * ((-1.0 / (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 = x + ((y - z) * ((t - x) / (a - z)))
if (t_1 <= (-4d-301)) then
tmp = x + ((x - t) * ((z - y) / (a - z)))
else if (t_1 <= 0.0d0) then
tmp = t + ((a - y) / (z / (t - x)))
else
tmp = x + ((x - t) * (((-1.0d0) / (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 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -4e-301) {
tmp = x + ((x - t) * ((z - y) / (a - z)));
} else if (t_1 <= 0.0) {
tmp = t + ((a - y) / (z / (t - x)));
} else {
tmp = x + ((x - t) * ((-1.0 / (a - z)) * (y - z)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_1 <= -4e-301: tmp = x + ((x - t) * ((z - y) / (a - z))) elif t_1 <= 0.0: tmp = t + ((a - y) / (z / (t - x))) else: tmp = x + ((x - t) * ((-1.0 / (a - z)) * (y - z))) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= -4e-301) tmp = Float64(x + Float64(Float64(x - t) * Float64(Float64(z - y) / Float64(a - z)))); elseif (t_1 <= 0.0) tmp = Float64(t + Float64(Float64(a - y) / Float64(z / Float64(t - x)))); else tmp = Float64(x + Float64(Float64(x - t) * Float64(Float64(-1.0 / Float64(a - z)) * Float64(y - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_1 <= -4e-301) tmp = x + ((x - t) * ((z - y) / (a - z))); elseif (t_1 <= 0.0) tmp = t + ((a - y) / (z / (t - x))); else tmp = x + ((x - t) * ((-1.0 / (a - z)) * (y - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4825645764048353/12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624], N[(x + N[(N[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0], N[(t + N[(N[(a - y), $MachinePrecision] / N[(z / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(x - t), $MachinePrecision] * N[(N[(-1 / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq \frac{-4825645764048353}{12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624}:\\
\;\;\;\;x + \left(x - t\right) \cdot \frac{z - y}{a - z}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t + \frac{a - y}{\frac{z}{t - x}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(x - t\right) \cdot \left(\frac{-1}{a - z} \cdot \left(y - z\right)\right)\\
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.0000000000000003e-301Initial program 79.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.6%
Applied rewrites83.6%
if -4.0000000000000003e-301 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 79.6%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6453.8%
Applied rewrites53.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
div-flip-revN/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
div-flip-revN/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6452.8%
Applied rewrites52.8%
if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
metadata-evalN/A
frac-2neg-revN/A
lower-/.f6483.5%
Applied rewrites83.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- x t) (/ (- z y) (- a z)))))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<=
t_2
-4825645764048353/12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624)
t_1
(if (<= t_2 0) (+ t (/ (- a y) (/ z (- t x)))) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((x - t) * ((z - y) / (a - z)));
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -4e-301) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t + ((a - y) / (z / (t - x)));
} 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 = x + ((x - t) * ((z - y) / (a - z)))
t_2 = x + ((y - z) * ((t - x) / (a - z)))
if (t_2 <= (-4d-301)) then
tmp = t_1
else if (t_2 <= 0.0d0) then
tmp = t + ((a - y) / (z / (t - x)))
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 + ((x - t) * ((z - y) / (a - z)));
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -4e-301) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t + ((a - y) / (z / (t - x)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((x - t) * ((z - y) / (a - z))) t_2 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_2 <= -4e-301: tmp = t_1 elif t_2 <= 0.0: tmp = t + ((a - y) / (z / (t - x))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(x - t) * Float64(Float64(z - y) / Float64(a - z)))) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -4e-301) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(t + Float64(Float64(a - y) / Float64(z / Float64(t - x)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((x - t) * ((z - y) / (a - z))); t_2 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_2 <= -4e-301) tmp = t_1; elseif (t_2 <= 0.0) tmp = t + ((a - y) / (z / (t - x))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4825645764048353/12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624], t$95$1, If[LessEqual[t$95$2, 0], N[(t + N[(N[(a - y), $MachinePrecision] / N[(z / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := x + \left(x - t\right) \cdot \frac{z - y}{a - z}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq \frac{-4825645764048353}{12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t + \frac{a - y}{\frac{z}{t - x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.0000000000000003e-301 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.6%
Applied rewrites83.6%
if -4.0000000000000003e-301 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 79.6%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6453.8%
Applied rewrites53.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
div-flip-revN/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
div-flip-revN/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6452.8%
Applied rewrites52.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- x t) (/ (- z y) (- a z)))))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<=
t_2
-4825645764048353/12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624)
t_1
(if (<= t_2 0) (- t (* (/ (- t x) z) (- y a))) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((x - t) * ((z - y) / (a - z)));
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -4e-301) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t - (((t - x) / z) * (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) :: t_2
real(8) :: tmp
t_1 = x + ((x - t) * ((z - y) / (a - z)))
t_2 = x + ((y - z) * ((t - x) / (a - z)))
if (t_2 <= (-4d-301)) then
tmp = t_1
else if (t_2 <= 0.0d0) then
tmp = t - (((t - x) / z) * (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 + ((x - t) * ((z - y) / (a - z)));
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -4e-301) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t - (((t - x) / z) * (y - a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((x - t) * ((z - y) / (a - z))) t_2 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_2 <= -4e-301: tmp = t_1 elif t_2 <= 0.0: tmp = t - (((t - x) / z) * (y - a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(x - t) * Float64(Float64(z - y) / Float64(a - z)))) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -4e-301) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(t - Float64(Float64(Float64(t - x) / z) * Float64(y - a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((x - t) * ((z - y) / (a - z))); t_2 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_2 <= -4e-301) tmp = t_1; elseif (t_2 <= 0.0) tmp = t - (((t - x) / z) * (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[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4825645764048353/12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624], t$95$1, If[LessEqual[t$95$2, 0], N[(t - N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := x + \left(x - t\right) \cdot \frac{z - y}{a - z}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq \frac{-4825645764048353}{12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t - \frac{t - x}{z} \cdot \left(y - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.0000000000000003e-301 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.6%
Applied rewrites83.6%
if -4.0000000000000003e-301 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 79.6%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-negateN/A
sub-negate-revN/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
Applied rewrites52.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ t (- a z)))))
(t_2 (+ t (* (- x t) (/ (- y a) z)))))
(if (<=
z
-138000000000000004093153144235505338658701474917114395344649268042739089770820652773162085813763379863345321602613064765749952472154112)
t_2
(if (<= z -8999999999999999844710088704)
t_1
(if (<=
z
6859310779502913/762145642166990290864647761179972242614403843424065222377723867096038022172794340849684107193235344521442121855812163792833978437326241529856)
(+ x (/ (* y (- t x)) (- a z)))
(if (<= z 2050000000000) t_1 t_2))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * (t / (a - z)));
double t_2 = t + ((x - t) * ((y - a) / z));
double tmp;
if (z <= -1.38e+134) {
tmp = t_2;
} else if (z <= -9e+27) {
tmp = t_1;
} else if (z <= 9e-126) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (z <= 2050000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + ((y - z) * (t / (a - z)))
t_2 = t + ((x - t) * ((y - a) / z))
if (z <= (-1.38d+134)) then
tmp = t_2
else if (z <= (-9d+27)) then
tmp = t_1
else if (z <= 9d-126) then
tmp = x + ((y * (t - x)) / (a - z))
else if (z <= 2050000000000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * (t / (a - z)));
double t_2 = t + ((x - t) * ((y - a) / z));
double tmp;
if (z <= -1.38e+134) {
tmp = t_2;
} else if (z <= -9e+27) {
tmp = t_1;
} else if (z <= 9e-126) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (z <= 2050000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * (t / (a - z))) t_2 = t + ((x - t) * ((y - a) / z)) tmp = 0 if z <= -1.38e+134: tmp = t_2 elif z <= -9e+27: tmp = t_1 elif z <= 9e-126: tmp = x + ((y * (t - x)) / (a - z)) elif z <= 2050000000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) t_2 = Float64(t + Float64(Float64(x - t) * Float64(Float64(y - a) / z))) tmp = 0.0 if (z <= -1.38e+134) tmp = t_2; elseif (z <= -9e+27) tmp = t_1; elseif (z <= 9e-126) tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z))); elseif (z <= 2050000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * (t / (a - z))); t_2 = t + ((x - t) * ((y - a) / z)); tmp = 0.0; if (z <= -1.38e+134) tmp = t_2; elseif (z <= -9e+27) tmp = t_1; elseif (z <= 9e-126) tmp = x + ((y * (t - x)) / (a - z)); elseif (z <= 2050000000000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -138000000000000004093153144235505338658701474917114395344649268042739089770820652773162085813763379863345321602613064765749952472154112], t$95$2, If[LessEqual[z, -8999999999999999844710088704], t$95$1, If[LessEqual[z, 6859310779502913/762145642166990290864647761179972242614403843424065222377723867096038022172794340849684107193235344521442121855812163792833978437326241529856], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2050000000000], t$95$1, t$95$2]]]]]]
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t}{a - z}\\
t_2 := t + \left(x - t\right) \cdot \frac{y - a}{z}\\
\mathbf{if}\;z \leq -138000000000000004093153144235505338658701474917114395344649268042739089770820652773162085813763379863345321602613064765749952472154112:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -8999999999999999844710088704:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{6859310779502913}{762145642166990290864647761179972242614403843424065222377723867096038022172794340849684107193235344521442121855812163792833978437326241529856}:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\
\mathbf{elif}\;z \leq 2050000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if z < -1.38e134 or 2.05e12 < z Initial program 79.6%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6453.8%
Applied rewrites53.8%
if -1.38e134 < z < -8.9999999999999998e27 or 9.0000000000000005e-126 < z < 2.05e12Initial program 79.6%
Taylor expanded in x around 0
Applied rewrites64.3%
if -8.9999999999999998e27 < z < 9.0000000000000005e-126Initial program 79.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6454.7%
Applied rewrites54.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ t (* (- x t) (/ (- y a) z)))))
(if (<= z -30000000000000000948382466048)
t_1
(if (<=
z
520997997575091/2977131414714805823690030317109266572712515013375254774912983855843898524112477893944078543723575564536883288499266264815757728270805630976)
(+ x (/ (* y (- t x)) (- a z)))
(if (<= z 2050000000000) (+ x (/ (* t (- y z)) (- a z))) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = t + ((x - t) * ((y - a) / z));
double tmp;
if (z <= -3e+28) {
tmp = t_1;
} else if (z <= 1.75e-124) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (z <= 2050000000000.0) {
tmp = x + ((t * (y - z)) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = t + ((x - t) * ((y - a) / z))
if (z <= (-3d+28)) then
tmp = t_1
else if (z <= 1.75d-124) then
tmp = x + ((y * (t - x)) / (a - z))
else if (z <= 2050000000000.0d0) then
tmp = x + ((t * (y - z)) / (a - 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 = t + ((x - t) * ((y - a) / z));
double tmp;
if (z <= -3e+28) {
tmp = t_1;
} else if (z <= 1.75e-124) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (z <= 2050000000000.0) {
tmp = x + ((t * (y - z)) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t + ((x - t) * ((y - a) / z)) tmp = 0 if z <= -3e+28: tmp = t_1 elif z <= 1.75e-124: tmp = x + ((y * (t - x)) / (a - z)) elif z <= 2050000000000.0: tmp = x + ((t * (y - z)) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t + Float64(Float64(x - t) * Float64(Float64(y - a) / z))) tmp = 0.0 if (z <= -3e+28) tmp = t_1; elseif (z <= 1.75e-124) tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z))); elseif (z <= 2050000000000.0) tmp = Float64(x + Float64(Float64(t * Float64(y - z)) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t + ((x - t) * ((y - a) / z)); tmp = 0.0; if (z <= -3e+28) tmp = t_1; elseif (z <= 1.75e-124) tmp = x + ((y * (t - x)) / (a - z)); elseif (z <= 2050000000000.0) tmp = x + ((t * (y - z)) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -30000000000000000948382466048], t$95$1, If[LessEqual[z, 520997997575091/2977131414714805823690030317109266572712515013375254774912983855843898524112477893944078543723575564536883288499266264815757728270805630976], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2050000000000], N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := t + \left(x - t\right) \cdot \frac{y - a}{z}\\
\mathbf{if}\;z \leq -30000000000000000948382466048:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{520997997575091}{2977131414714805823690030317109266572712515013375254774912983855843898524112477893944078543723575564536883288499266264815757728270805630976}:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\
\mathbf{elif}\;z \leq 2050000000000:\\
\;\;\;\;x + \frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.0000000000000001e28 or 2.05e12 < z Initial program 79.6%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6453.8%
Applied rewrites53.8%
if -3.0000000000000001e28 < z < 1.7499999999999999e-124Initial program 79.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6454.7%
Applied rewrites54.7%
if 1.7499999999999999e-124 < z < 2.05e12Initial program 79.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6455.5%
Applied rewrites55.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* t (- y z)) (- a z))))
(t_2 (+ t (* (- x t) (/ (- y a) z)))))
(if (<=
z
-85999999999999998896126747031913950778816040297344791989994017316795973699655221479323918150864890160471663734042053387896069831000064)
t_2
(if (<=
z
-6902436815285787/3255866422304616344765552632188114158762089024568314531443485259650408807528140659922574316831813618526821245406949824436469141432675471230646169947427163108444901161872077421124549944292877941762189949285100879873872435565174053364826112)
t_1
(if (<=
z
6787859625549757/23817051317718446589520242536874132581700120107002038199303870846751188192899823151552628349788604516295066307994130118526061826166445047808)
(+ x (* (- t x) (/ y a)))
(if (<= z 2050000000000) t_1 t_2))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((t * (y - z)) / (a - z));
double t_2 = t + ((x - t) * ((y - a) / z));
double tmp;
if (z <= -8.6e+133) {
tmp = t_2;
} else if (z <= -2.12e-222) {
tmp = t_1;
} else if (z <= 2.85e-124) {
tmp = x + ((t - x) * (y / a));
} else if (z <= 2050000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + ((t * (y - z)) / (a - z))
t_2 = t + ((x - t) * ((y - a) / z))
if (z <= (-8.6d+133)) then
tmp = t_2
else if (z <= (-2.12d-222)) then
tmp = t_1
else if (z <= 2.85d-124) then
tmp = x + ((t - x) * (y / a))
else if (z <= 2050000000000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((t * (y - z)) / (a - z));
double t_2 = t + ((x - t) * ((y - a) / z));
double tmp;
if (z <= -8.6e+133) {
tmp = t_2;
} else if (z <= -2.12e-222) {
tmp = t_1;
} else if (z <= 2.85e-124) {
tmp = x + ((t - x) * (y / a));
} else if (z <= 2050000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((t * (y - z)) / (a - z)) t_2 = t + ((x - t) * ((y - a) / z)) tmp = 0 if z <= -8.6e+133: tmp = t_2 elif z <= -2.12e-222: tmp = t_1 elif z <= 2.85e-124: tmp = x + ((t - x) * (y / a)) elif z <= 2050000000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(t * Float64(y - z)) / Float64(a - z))) t_2 = Float64(t + Float64(Float64(x - t) * Float64(Float64(y - a) / z))) tmp = 0.0 if (z <= -8.6e+133) tmp = t_2; elseif (z <= -2.12e-222) tmp = t_1; elseif (z <= 2.85e-124) tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a))); elseif (z <= 2050000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((t * (y - z)) / (a - z)); t_2 = t + ((x - t) * ((y - a) / z)); tmp = 0.0; if (z <= -8.6e+133) tmp = t_2; elseif (z <= -2.12e-222) tmp = t_1; elseif (z <= 2.85e-124) tmp = x + ((t - x) * (y / a)); elseif (z <= 2050000000000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -85999999999999998896126747031913950778816040297344791989994017316795973699655221479323918150864890160471663734042053387896069831000064], t$95$2, If[LessEqual[z, -6902436815285787/3255866422304616344765552632188114158762089024568314531443485259650408807528140659922574316831813618526821245406949824436469141432675471230646169947427163108444901161872077421124549944292877941762189949285100879873872435565174053364826112], t$95$1, If[LessEqual[z, 6787859625549757/23817051317718446589520242536874132581700120107002038199303870846751188192899823151552628349788604516295066307994130118526061826166445047808], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2050000000000], t$95$1, t$95$2]]]]]]
\begin{array}{l}
t_1 := x + \frac{t \cdot \left(y - z\right)}{a - z}\\
t_2 := t + \left(x - t\right) \cdot \frac{y - a}{z}\\
\mathbf{if}\;z \leq -85999999999999998896126747031913950778816040297344791989994017316795973699655221479323918150864890160471663734042053387896069831000064:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq \frac{-6902436815285787}{3255866422304616344765552632188114158762089024568314531443485259650408807528140659922574316831813618526821245406949824436469141432675471230646169947427163108444901161872077421124549944292877941762189949285100879873872435565174053364826112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{6787859625549757}{23817051317718446589520242536874132581700120107002038199303870846751188192899823151552628349788604516295066307994130118526061826166445047808}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 2050000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if z < -8.5999999999999999e133 or 2.05e12 < z Initial program 79.6%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6453.8%
Applied rewrites53.8%
if -8.5999999999999999e133 < z < -2.1200000000000001e-222 or 2.8499999999999999e-124 < z < 2.05e12Initial program 79.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6455.5%
Applied rewrites55.5%
if -2.1200000000000001e-222 < z < 2.8499999999999999e-124Initial program 79.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.6%
Applied rewrites43.6%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6447.8%
Applied rewrites47.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ t (* (- x t) (/ (- y a) z)))))
(if (<=
z
-5099505842092539/121416805764108066932466369176469931665150427440758720078238275608681517825325531136)
t_1
(if (<=
z
3266710722441009/340282366920938463463374607431768211456)
(+ x (* (- t x) (/ y a)))
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = t + ((x - t) * ((y - a) / z));
double tmp;
if (z <= -4.2e-68) {
tmp = t_1;
} else if (z <= 9.6e-24) {
tmp = x + ((t - x) * (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 = t + ((x - t) * ((y - a) / z))
if (z <= (-4.2d-68)) then
tmp = t_1
else if (z <= 9.6d-24) then
tmp = x + ((t - x) * (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 = t + ((x - t) * ((y - a) / z));
double tmp;
if (z <= -4.2e-68) {
tmp = t_1;
} else if (z <= 9.6e-24) {
tmp = x + ((t - x) * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t + ((x - t) * ((y - a) / z)) tmp = 0 if z <= -4.2e-68: tmp = t_1 elif z <= 9.6e-24: tmp = x + ((t - x) * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t + Float64(Float64(x - t) * Float64(Float64(y - a) / z))) tmp = 0.0 if (z <= -4.2e-68) tmp = t_1; elseif (z <= 9.6e-24) tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t + ((x - t) * ((y - a) / z)); tmp = 0.0; if (z <= -4.2e-68) tmp = t_1; elseif (z <= 9.6e-24) tmp = x + ((t - x) * (y / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5099505842092539/121416805764108066932466369176469931665150427440758720078238275608681517825325531136], t$95$1, If[LessEqual[z, 3266710722441009/340282366920938463463374607431768211456], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := t + \left(x - t\right) \cdot \frac{y - a}{z}\\
\mathbf{if}\;z \leq \frac{-5099505842092539}{121416805764108066932466369176469931665150427440758720078238275608681517825325531136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{3266710722441009}{340282366920938463463374607431768211456}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -4.2000000000000002e-68 or 9.5999999999999993e-24 < z Initial program 79.6%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6453.8%
Applied rewrites53.8%
if -4.2000000000000002e-68 < z < 9.5999999999999993e-24Initial program 79.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.6%
Applied rewrites43.6%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6447.8%
Applied rewrites47.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ t a)))))
(if (<=
a
-620000000000000003212457350491329463065743578269686069966198026144487760686059902922307079391982416738548459206260587836559484403366779647513569787150099426184693122343108608)
t_1
(if (<=
a
-2676089423823675/5575186299632655785383929568162090376495104)
(+ x (* (- t x) (/ y a)))
(if (<=
a
3299999999999999905342712846524970004371795945284041350065477064438034921550654301697269184162914950315529134220983140352)
(+ t (* (- x t) (/ y z)))
t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * (t / a));
double tmp;
if (a <= -6.2e+173) {
tmp = t_1;
} else if (a <= -4.8e-28) {
tmp = x + ((t - x) * (y / a));
} else if (a <= 3.3e+120) {
tmp = t + ((x - t) * (y / z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((y - z) * (t / a))
if (a <= (-6.2d+173)) then
tmp = t_1
else if (a <= (-4.8d-28)) then
tmp = x + ((t - x) * (y / a))
else if (a <= 3.3d+120) then
tmp = t + ((x - t) * (y / z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * (t / a));
double tmp;
if (a <= -6.2e+173) {
tmp = t_1;
} else if (a <= -4.8e-28) {
tmp = x + ((t - x) * (y / a));
} else if (a <= 3.3e+120) {
tmp = t + ((x - t) * (y / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * (t / a)) tmp = 0 if a <= -6.2e+173: tmp = t_1 elif a <= -4.8e-28: tmp = x + ((t - x) * (y / a)) elif a <= 3.3e+120: tmp = t + ((x - t) * (y / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(t / a))) tmp = 0.0 if (a <= -6.2e+173) tmp = t_1; elseif (a <= -4.8e-28) tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a))); elseif (a <= 3.3e+120) tmp = Float64(t + Float64(Float64(x - t) * Float64(y / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * (t / a)); tmp = 0.0; if (a <= -6.2e+173) tmp = t_1; elseif (a <= -4.8e-28) tmp = x + ((t - x) * (y / a)); elseif (a <= 3.3e+120) tmp = t + ((x - t) * (y / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -620000000000000003212457350491329463065743578269686069966198026144487760686059902922307079391982416738548459206260587836559484403366779647513569787150099426184693122343108608], t$95$1, If[LessEqual[a, -2676089423823675/5575186299632655785383929568162090376495104], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3299999999999999905342712846524970004371795945284041350065477064438034921550654301697269184162914950315529134220983140352], N[(t + N[(N[(x - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t}{a}\\
\mathbf{if}\;a \leq -620000000000000003212457350491329463065743578269686069966198026144487760686059902922307079391982416738548459206260587836559484403366779647513569787150099426184693122343108608:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq \frac{-2676089423823675}{5575186299632655785383929568162090376495104}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 3299999999999999905342712846524970004371795945284041350065477064438034921550654301697269184162914950315529134220983140352:\\
\;\;\;\;t + \left(x - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -6.2e173 or 3.2999999999999999e120 < a Initial program 79.6%
Taylor expanded in x around 0
Applied rewrites64.3%
Taylor expanded in z around 0
Applied rewrites43.5%
if -6.2e173 < a < -4.8000000000000004e-28Initial program 79.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.6%
Applied rewrites43.6%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6447.8%
Applied rewrites47.8%
if -4.8000000000000004e-28 < a < 3.2999999999999999e120Initial program 79.6%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6453.8%
Applied rewrites53.8%
Taylor expanded in y around inf
lower-/.f6449.5%
Applied rewrites49.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ t (* (- x t) (/ y z)))))
(if (<=
z
-5099505842092539/121416805764108066932466369176469931665150427440758720078238275608681517825325531136)
t_1
(if (<=
z
3266710722441009/340282366920938463463374607431768211456)
(+ x (* (- t x) (/ y a)))
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = t + ((x - t) * (y / z));
double tmp;
if (z <= -4.2e-68) {
tmp = t_1;
} else if (z <= 9.6e-24) {
tmp = x + ((t - x) * (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 = t + ((x - t) * (y / z))
if (z <= (-4.2d-68)) then
tmp = t_1
else if (z <= 9.6d-24) then
tmp = x + ((t - x) * (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 = t + ((x - t) * (y / z));
double tmp;
if (z <= -4.2e-68) {
tmp = t_1;
} else if (z <= 9.6e-24) {
tmp = x + ((t - x) * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t + ((x - t) * (y / z)) tmp = 0 if z <= -4.2e-68: tmp = t_1 elif z <= 9.6e-24: tmp = x + ((t - x) * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t + Float64(Float64(x - t) * Float64(y / z))) tmp = 0.0 if (z <= -4.2e-68) tmp = t_1; elseif (z <= 9.6e-24) tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t + ((x - t) * (y / z)); tmp = 0.0; if (z <= -4.2e-68) tmp = t_1; elseif (z <= 9.6e-24) tmp = x + ((t - x) * (y / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(N[(x - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5099505842092539/121416805764108066932466369176469931665150427440758720078238275608681517825325531136], t$95$1, If[LessEqual[z, 3266710722441009/340282366920938463463374607431768211456], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := t + \left(x - t\right) \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq \frac{-5099505842092539}{121416805764108066932466369176469931665150427440758720078238275608681517825325531136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{3266710722441009}{340282366920938463463374607431768211456}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -4.2000000000000002e-68 or 9.5999999999999993e-24 < z Initial program 79.6%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6453.8%
Applied rewrites53.8%
Taylor expanded in y around inf
lower-/.f6449.5%
Applied rewrites49.5%
if -4.2000000000000002e-68 < z < 9.5999999999999993e-24Initial program 79.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.6%
Applied rewrites43.6%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6447.8%
Applied rewrites47.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ t (* (- x t) (/ y z)))))
(if (<=
z
-8742010015015781/971334446112864535459730953411759453321203419526069760625906204869452142602604249088)
t_1
(if (<=
z
1725436586697641/53919893334301279589334030174039261347274288845081144962207220498432)
(+ x (/ (* t y) a))
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = t + ((x - t) * (y / z));
double tmp;
if (z <= -9e-69) {
tmp = t_1;
} else if (z <= 3.2e-53) {
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 = t + ((x - t) * (y / z))
if (z <= (-9d-69)) then
tmp = t_1
else if (z <= 3.2d-53) 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 = t + ((x - t) * (y / z));
double tmp;
if (z <= -9e-69) {
tmp = t_1;
} else if (z <= 3.2e-53) {
tmp = x + ((t * y) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t + ((x - t) * (y / z)) tmp = 0 if z <= -9e-69: tmp = t_1 elif z <= 3.2e-53: tmp = x + ((t * y) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t + Float64(Float64(x - t) * Float64(y / z))) tmp = 0.0 if (z <= -9e-69) tmp = t_1; elseif (z <= 3.2e-53) 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 = t + ((x - t) * (y / z)); tmp = 0.0; if (z <= -9e-69) tmp = t_1; elseif (z <= 3.2e-53) 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[(t + N[(N[(x - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8742010015015781/971334446112864535459730953411759453321203419526069760625906204869452142602604249088], t$95$1, If[LessEqual[z, 1725436586697641/53919893334301279589334030174039261347274288845081144962207220498432], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := t + \left(x - t\right) \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq \frac{-8742010015015781}{971334446112864535459730953411759453321203419526069760625906204869452142602604249088}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{1725436586697641}{53919893334301279589334030174039261347274288845081144962207220498432}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -9.0000000000000002e-69 or 3.2000000000000001e-53 < z Initial program 79.6%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6453.8%
Applied rewrites53.8%
Taylor expanded in y around inf
lower-/.f6449.5%
Applied rewrites49.5%
if -9.0000000000000002e-69 < z < 3.2000000000000001e-53Initial program 79.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.6%
Applied rewrites43.6%
Taylor expanded in x around 0
lower-*.f6437.8%
Applied rewrites37.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1480000000000000000)
(+ x (/ (* t y) a))
(if (<=
a
6877123763982683/237142198758023568227473377297792835283496928595231875152809132048206089502588928)
(+ t (/ (* y (- x t)) z))
(+ x t))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.48e+18) {
tmp = x + ((t * y) / a);
} else if (a <= 2.9e-65) {
tmp = t + ((y * (x - t)) / z);
} 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 (a <= (-1.48d+18)) then
tmp = x + ((t * y) / a)
else if (a <= 2.9d-65) then
tmp = t + ((y * (x - t)) / z)
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 (a <= -1.48e+18) {
tmp = x + ((t * y) / a);
} else if (a <= 2.9e-65) {
tmp = t + ((y * (x - t)) / z);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.48e+18: tmp = x + ((t * y) / a) elif a <= 2.9e-65: tmp = t + ((y * (x - t)) / z) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.48e+18) tmp = Float64(x + Float64(Float64(t * y) / a)); elseif (a <= 2.9e-65) tmp = Float64(t + Float64(Float64(y * Float64(x - t)) / z)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.48e+18) tmp = x + ((t * y) / a); elseif (a <= 2.9e-65) tmp = t + ((y * (x - t)) / z); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1480000000000000000], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6877123763982683/237142198758023568227473377297792835283496928595231875152809132048206089502588928], N[(t + N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;a \leq -1480000000000000000:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{elif}\;a \leq \frac{6877123763982683}{237142198758023568227473377297792835283496928595231875152809132048206089502588928}:\\
\;\;\;\;t + \frac{y \cdot \left(x - t\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
if a < -1.48e18Initial program 79.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.6%
Applied rewrites43.6%
Taylor expanded in x around 0
lower-*.f6437.8%
Applied rewrites37.8%
if -1.48e18 < a < 2.8999999999999998e-65Initial program 79.6%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6453.8%
Applied rewrites53.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6445.1%
Applied rewrites45.1%
if 2.8999999999999998e-65 < a Initial program 79.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ t (/ (* x (- y a)) z))))
(if (<= z -28000000000000001471563169792)
t_1
(if (<= z 2320000000000000000000) (+ x (/ (* t y) a)) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = t + ((x * (y - a)) / z);
double tmp;
if (z <= -2.8e+28) {
tmp = t_1;
} else if (z <= 2.32e+21) {
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 = t + ((x * (y - a)) / z)
if (z <= (-2.8d+28)) then
tmp = t_1
else if (z <= 2.32d+21) 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 = t + ((x * (y - a)) / z);
double tmp;
if (z <= -2.8e+28) {
tmp = t_1;
} else if (z <= 2.32e+21) {
tmp = x + ((t * y) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t + ((x * (y - a)) / z) tmp = 0 if z <= -2.8e+28: tmp = t_1 elif z <= 2.32e+21: tmp = x + ((t * y) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t + Float64(Float64(x * Float64(y - a)) / z)) tmp = 0.0 if (z <= -2.8e+28) tmp = t_1; elseif (z <= 2.32e+21) 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 = t + ((x * (y - a)) / z); tmp = 0.0; if (z <= -2.8e+28) tmp = t_1; elseif (z <= 2.32e+21) 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[(t + N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -28000000000000001471563169792], t$95$1, If[LessEqual[z, 2320000000000000000000], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := t + \frac{x \cdot \left(y - a\right)}{z}\\
\mathbf{if}\;z \leq -28000000000000001471563169792:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2320000000000000000000:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.8000000000000001e28 or 2.32e21 < z Initial program 79.6%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
Taylor expanded in x around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6442.2%
Applied rewrites42.2%
if -2.8000000000000001e28 < z < 2.32e21Initial program 79.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.6%
Applied rewrites43.6%
Taylor expanded in x around 0
lower-*.f6437.8%
Applied rewrites37.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8600000000000000169248555008)
(+ x t)
(if (<= z 1499999999999999918362846480564224)
(+ x (/ (* t y) a))
(+ t (/ (* a (- t x)) z)))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.6e+27) {
tmp = x + t;
} else if (z <= 1.5e+33) {
tmp = x + ((t * y) / a);
} else {
tmp = t + ((a * (t - x)) / 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) :: tmp
if (z <= (-8.6d+27)) then
tmp = x + t
else if (z <= 1.5d+33) then
tmp = x + ((t * y) / a)
else
tmp = t + ((a * (t - x)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.6e+27) {
tmp = x + t;
} else if (z <= 1.5e+33) {
tmp = x + ((t * y) / a);
} else {
tmp = t + ((a * (t - x)) / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.6e+27: tmp = x + t elif z <= 1.5e+33: tmp = x + ((t * y) / a) else: tmp = t + ((a * (t - x)) / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.6e+27) tmp = Float64(x + t); elseif (z <= 1.5e+33) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(t + Float64(Float64(a * Float64(t - x)) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.6e+27) tmp = x + t; elseif (z <= 1.5e+33) tmp = x + ((t * y) / a); else tmp = t + ((a * (t - x)) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8600000000000000169248555008], N[(x + t), $MachinePrecision], If[LessEqual[z, 1499999999999999918362846480564224], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t + N[(N[(a * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -8600000000000000169248555008:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1499999999999999918362846480564224:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{a \cdot \left(t - x\right)}{z}\\
\end{array}
if z < -8.6000000000000002e27Initial program 79.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
if -8.6000000000000002e27 < z < 1.4999999999999999e33Initial program 79.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.6%
Applied rewrites43.6%
Taylor expanded in x around 0
lower-*.f6437.8%
Applied rewrites37.8%
if 1.4999999999999999e33 < z Initial program 79.6%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6429.5%
Applied rewrites29.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8600000000000000169248555008)
(+ x t)
(if (<= z 77999999999999999862150877151232)
(+ x (/ (* t y) a))
(* (+ 1 (/ x t)) t))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.6e+27) {
tmp = x + t;
} else if (z <= 7.8e+31) {
tmp = x + ((t * y) / a);
} else {
tmp = (1.0 + (x / t)) * 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.6d+27)) then
tmp = x + t
else if (z <= 7.8d+31) then
tmp = x + ((t * y) / a)
else
tmp = (1.0d0 + (x / t)) * 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.6e+27) {
tmp = x + t;
} else if (z <= 7.8e+31) {
tmp = x + ((t * y) / a);
} else {
tmp = (1.0 + (x / t)) * t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.6e+27: tmp = x + t elif z <= 7.8e+31: tmp = x + ((t * y) / a) else: tmp = (1.0 + (x / t)) * t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.6e+27) tmp = Float64(x + t); elseif (z <= 7.8e+31) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(Float64(1.0 + Float64(x / t)) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.6e+27) tmp = x + t; elseif (z <= 7.8e+31) tmp = x + ((t * y) / a); else tmp = (1.0 + (x / t)) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8600000000000000169248555008], N[(x + t), $MachinePrecision], If[LessEqual[z, 77999999999999999862150877151232], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(1 + N[(x / t), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -8600000000000000169248555008:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 77999999999999999862150877151232:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{x}{t}\right) \cdot t\\
\end{array}
if z < -8.6000000000000002e27Initial program 79.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
if -8.6000000000000002e27 < z < 7.8e31Initial program 79.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.6%
Applied rewrites43.6%
Taylor expanded in x around 0
lower-*.f6437.8%
Applied rewrites37.8%
if 7.8e31 < z Initial program 79.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
lift-+.f64N/A
+-commutativeN/A
sum-to-multN/A
lower-unsound-*.f64N/A
lower-unsound-+.f64N/A
lower-unsound-/.f6431.5%
Applied rewrites31.5%
(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 79.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x y z t a)
:name "Numeric.Signal:interpolate from hsignal-0.2.7.1"
:precision binary64
(+ x (* (- y z) (/ (- t x) (- a z)))))