
(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]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
Herbie found 21 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]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) (- a z)))
(t_2 (fma t_1 (- y z) x))
(t_3 (+ x (* (- y z) t_1))))
(if (<= t_3 -5e-281)
t_2
(if (<= t_3 2e-305)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(if (<= t_3 5e+306)
t_2
(fma
x
(- (+ 1.0 (/ z (- a z))) (/ y (- a z)))
(/ (* t (- y z)) (- a z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / (a - z);
double t_2 = fma(t_1, (y - z), x);
double t_3 = x + ((y - z) * t_1);
double tmp;
if (t_3 <= -5e-281) {
tmp = t_2;
} else if (t_3 <= 2e-305) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else if (t_3 <= 5e+306) {
tmp = t_2;
} else {
tmp = fma(x, ((1.0 + (z / (a - z))) - (y / (a - z))), ((t * (y - z)) / (a - z)));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / Float64(a - z)) t_2 = fma(t_1, Float64(y - z), x) t_3 = Float64(x + Float64(Float64(y - z) * t_1)) tmp = 0.0 if (t_3 <= -5e-281) tmp = t_2; elseif (t_3 <= 2e-305) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); elseif (t_3 <= 5e+306) tmp = t_2; else tmp = fma(x, Float64(Float64(1.0 + Float64(z / Float64(a - z))) - Float64(y / Float64(a - z))), Float64(Float64(t * Float64(y - z)) / Float64(a - z))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-281], t$95$2, If[LessEqual[t$95$3, 2e-305], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], If[LessEqual[t$95$3, 5e+306], t$95$2, N[(x * N[(N[(1.0 + N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := \mathsf{fma}\left(t\_1, y - z, x\right)\\
t_3 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-281}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-305}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \left(1 + \frac{z}{a - z}\right) - \frac{y}{a - z}, \frac{t \cdot \left(y - z\right)}{a - z}\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999998e-281 or 1.99999999999999999e-305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
if -4.9999999999999998e-281 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.99999999999999999e-305Initial program 79.8%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.5
Applied rewrites46.5%
if 4.99999999999999993e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.8%
Taylor expanded in t around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites74.2%
Taylor expanded in x around 0
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6479.3
Applied rewrites79.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) (- a z)))
(t_2 (fma t_1 (- y z) x))
(t_3 (+ x (* (- y z) t_1))))
(if (<= t_3 -5e-281)
t_2
(if (<= t_3 2e-305) (+ (- (/ (* (- t x) (- y a)) z)) t) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / (a - z);
double t_2 = fma(t_1, (y - z), x);
double t_3 = x + ((y - z) * t_1);
double tmp;
if (t_3 <= -5e-281) {
tmp = t_2;
} else if (t_3 <= 2e-305) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / Float64(a - z)) t_2 = fma(t_1, Float64(y - z), x) t_3 = Float64(x + Float64(Float64(y - z) * t_1)) tmp = 0.0 if (t_3 <= -5e-281) tmp = t_2; elseif (t_3 <= 2e-305) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-281], t$95$2, If[LessEqual[t$95$3, 2e-305], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := \mathsf{fma}\left(t\_1, y - z, x\right)\\
t_3 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-281}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-305}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999998e-281 or 1.99999999999999999e-305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
if -4.9999999999999998e-281 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.99999999999999999e-305Initial program 79.8%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.5
Applied rewrites46.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- t x) y) (- a z)))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z)))))
(t_3 (+ x (* (- y z) (/ t (- a z))))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -5e-281)
t_3
(if (<= t_2 2e-305)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(if (<= t_2 5e+306) t_3 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - x) * y) / (a - z);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double t_3 = x + ((y - z) * (t / (a - z)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -5e-281) {
tmp = t_3;
} else if (t_2 <= 2e-305) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else if (t_2 <= 5e+306) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - x) * y) / (a - z);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double t_3 = x + ((y - z) * (t / (a - z)));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -5e-281) {
tmp = t_3;
} else if (t_2 <= 2e-305) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else if (t_2 <= 5e+306) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((t - x) * y) / (a - z) t_2 = x + ((y - z) * ((t - x) / (a - z))) t_3 = x + ((y - z) * (t / (a - z))) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -5e-281: tmp = t_3 elif t_2 <= 2e-305: tmp = -(((t - x) * (y - a)) / z) + t elif t_2 <= 5e+306: tmp = t_3 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(t - x) * y) / Float64(a - z)) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) t_3 = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -5e-281) tmp = t_3; elseif (t_2 <= 2e-305) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); elseif (t_2 <= 5e+306) tmp = t_3; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((t - x) * y) / (a - z); t_2 = x + ((y - z) * ((t - x) / (a - z))); t_3 = x + ((y - z) * (t / (a - z))); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -5e-281) tmp = t_3; elseif (t_2 <= 2e-305) tmp = -(((t - x) * (y - a)) / z) + t; elseif (t_2 <= 5e+306) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $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]}, Block[{t$95$3 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-281], t$95$3, If[LessEqual[t$95$2, 2e-305], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], If[LessEqual[t$95$2, 5e+306], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(t - x\right) \cdot y}{a - z}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
t_3 := x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-281}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-305}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0 or 4.99999999999999993e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.8%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6437.7
Applied rewrites37.7%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999998e-281 or 1.99999999999999999e-305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306Initial program 79.8%
Taylor expanded in x around 0
Applied rewrites64.3%
if -4.9999999999999998e-281 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.99999999999999999e-305Initial program 79.8%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.5
Applied rewrites46.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ t (- a z))))))
(if (<= a -28000000.0)
t_1
(if (<= a -2.7e-54)
(* y (/ (- t x) (- a z)))
(if (<= a 7.8e-72) (* t (/ (- y z) (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * (t / (a - z)));
double tmp;
if (a <= -28000000.0) {
tmp = t_1;
} else if (a <= -2.7e-54) {
tmp = y * ((t - x) / (a - z));
} else if (a <= 7.8e-72) {
tmp = 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 = x + ((y - z) * (t / (a - z)))
if (a <= (-28000000.0d0)) then
tmp = t_1
else if (a <= (-2.7d-54)) then
tmp = y * ((t - x) / (a - z))
else if (a <= 7.8d-72) then
tmp = 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 = x + ((y - z) * (t / (a - z)));
double tmp;
if (a <= -28000000.0) {
tmp = t_1;
} else if (a <= -2.7e-54) {
tmp = y * ((t - x) / (a - z));
} else if (a <= 7.8e-72) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * (t / (a - z))) tmp = 0 if a <= -28000000.0: tmp = t_1 elif a <= -2.7e-54: tmp = y * ((t - x) / (a - z)) elif a <= 7.8e-72: tmp = t * ((y - z) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) tmp = 0.0 if (a <= -28000000.0) tmp = t_1; elseif (a <= -2.7e-54) tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z))); elseif (a <= 7.8e-72) tmp = Float64(t * Float64(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 = x + ((y - z) * (t / (a - z))); tmp = 0.0; if (a <= -28000000.0) tmp = t_1; elseif (a <= -2.7e-54) tmp = y * ((t - x) / (a - z)); elseif (a <= 7.8e-72) tmp = 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[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -28000000.0], t$95$1, If[LessEqual[a, -2.7e-54], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.8e-72], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{if}\;a \leq -28000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-54}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{-72}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.8e7 or 7.8e-72 < a Initial program 79.8%
Taylor expanded in x around 0
Applied rewrites64.3%
if -2.8e7 < a < -2.70000000000000026e-54Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6441.6
Applied rewrites41.6%
if -2.70000000000000026e-54 < a < 7.8e-72Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) a) (- y z) x)))
(if (<= a -9000000.0)
t_1
(if (<= a -2.7e-54)
(* y (/ (- t x) (- a z)))
(if (<= a 8.2e+69) (* t (/ (- y z) (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / a), (y - z), x);
double tmp;
if (a <= -9000000.0) {
tmp = t_1;
} else if (a <= -2.7e-54) {
tmp = y * ((t - x) / (a - z));
} else if (a <= 8.2e+69) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / a), Float64(y - z), x) tmp = 0.0 if (a <= -9000000.0) tmp = t_1; elseif (a <= -2.7e-54) tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z))); elseif (a <= 8.2e+69) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -9000000.0], t$95$1, If[LessEqual[a, -2.7e-54], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.2e+69], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -9000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-54}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{+69}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9e6 or 8.1999999999999998e69 < a Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
if -9e6 < a < -2.70000000000000026e-54Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6441.6
Applied rewrites41.6%
if -2.70000000000000026e-54 < a < 8.1999999999999998e69Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= z -1.9e+24)
t_1
(if (<= z 5.5e+166) (+ x (* y (/ (- t x) (- a z)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * ((y - z) / (a - z));
double tmp;
if (z <= -1.9e+24) {
tmp = t_1;
} else if (z <= 5.5e+166) {
tmp = x + (y * ((t - x) / (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 * ((y - z) / (a - z))
if (z <= (-1.9d+24)) then
tmp = t_1
else if (z <= 5.5d+166) then
tmp = x + (y * ((t - x) / (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 * ((y - z) / (a - z));
double tmp;
if (z <= -1.9e+24) {
tmp = t_1;
} else if (z <= 5.5e+166) {
tmp = x + (y * ((t - x) / (a - z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * ((y - z) / (a - z)) tmp = 0 if z <= -1.9e+24: tmp = t_1 elif z <= 5.5e+166: tmp = x + (y * ((t - x) / (a - z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z))) tmp = 0.0 if (z <= -1.9e+24) tmp = t_1; elseif (z <= 5.5e+166) tmp = Float64(x + Float64(y * Float64(Float64(t - x) / Float64(a - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * ((y - z) / (a - z)); tmp = 0.0; if (z <= -1.9e+24) tmp = t_1; elseif (z <= 5.5e+166) tmp = x + (y * ((t - x) / (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[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+24], t$95$1, If[LessEqual[z, 5.5e+166], N[(x + N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+166}:\\
\;\;\;\;x + y \cdot \frac{t - x}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.90000000000000008e24 or 5.50000000000000008e166 < z Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.6
Applied rewrites51.6%
if -1.90000000000000008e24 < z < 5.50000000000000008e166Initial program 79.8%
Taylor expanded in y around inf
Applied rewrites59.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.6e+61)
(fma (/ t a) (- y z) x)
(if (<= a -2.7e-54)
(* y (/ (- t x) (- a z)))
(if (<= a 8.2e+69)
(* t (/ (- y z) (- a z)))
(fma (- t x) (/ (- y z) a) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.6e+61) {
tmp = fma((t / a), (y - z), x);
} else if (a <= -2.7e-54) {
tmp = y * ((t - x) / (a - z));
} else if (a <= 8.2e+69) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = fma((t - x), ((y - z) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.6e+61) tmp = fma(Float64(t / a), Float64(y - z), x); elseif (a <= -2.7e-54) tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z))); elseif (a <= 8.2e+69) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.6e+61], N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, -2.7e-54], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.2e+69], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-54}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{+69}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\end{array}
\end{array}
if a < -2.59999999999999973e61Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
Taylor expanded in x around 0
Applied rewrites44.9%
if -2.59999999999999973e61 < a < -2.70000000000000026e-54Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6441.6
Applied rewrites41.6%
if -2.70000000000000026e-54 < a < 8.1999999999999998e69Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.6
Applied rewrites51.6%
if 8.1999999999999998e69 < a Initial program 79.8%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.8
Applied rewrites53.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ t a) (- y z) x)))
(if (<= a -2.6e+61)
t_1
(if (<= a -2.7e-54)
(* y (/ (- t x) (- a z)))
(if (<= a 8.5e+69) (* t (/ (- y z) (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t / a), (y - z), x);
double tmp;
if (a <= -2.6e+61) {
tmp = t_1;
} else if (a <= -2.7e-54) {
tmp = y * ((t - x) / (a - z));
} else if (a <= 8.5e+69) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t / a), Float64(y - z), x) tmp = 0.0 if (a <= -2.6e+61) tmp = t_1; elseif (a <= -2.7e-54) tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z))); elseif (a <= 8.5e+69) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.6e+61], t$95$1, If[LessEqual[a, -2.7e-54], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.5e+69], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -2.6 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-54}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{+69}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.59999999999999973e61 or 8.5000000000000002e69 < a Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
Taylor expanded in x around 0
Applied rewrites44.9%
if -2.59999999999999973e61 < a < -2.70000000000000026e-54Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6441.6
Applied rewrites41.6%
if -2.70000000000000026e-54 < a < 8.5000000000000002e69Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ t a) (- y z) x)))
(if (<= a -0.04)
t_1
(if (<= a -2.7e-54)
(/ (* (- t x) y) (- a z))
(if (<= a 8.5e+69) (* t (/ (- y z) (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t / a), (y - z), x);
double tmp;
if (a <= -0.04) {
tmp = t_1;
} else if (a <= -2.7e-54) {
tmp = ((t - x) * y) / (a - z);
} else if (a <= 8.5e+69) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t / a), Float64(y - z), x) tmp = 0.0 if (a <= -0.04) tmp = t_1; elseif (a <= -2.7e-54) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (a <= 8.5e+69) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -0.04], t$95$1, If[LessEqual[a, -2.7e-54], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.5e+69], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -0.04:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-54}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{+69}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.0400000000000000008 or 8.5000000000000002e69 < a Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
Taylor expanded in x around 0
Applied rewrites44.9%
if -0.0400000000000000008 < a < -2.70000000000000026e-54Initial program 79.8%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6437.7
Applied rewrites37.7%
if -2.70000000000000026e-54 < a < 8.5000000000000002e69Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ t a) (- y z) x)))
(if (<= a -0.04)
t_1
(if (<= a -9.5e-200)
(/ (* (- t x) y) (- a z))
(if (<= a 2.2e-68) (/ (* (- y z) t) (- a z)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t / a), (y - z), x);
double tmp;
if (a <= -0.04) {
tmp = t_1;
} else if (a <= -9.5e-200) {
tmp = ((t - x) * y) / (a - z);
} else if (a <= 2.2e-68) {
tmp = ((y - z) * t) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t / a), Float64(y - z), x) tmp = 0.0 if (a <= -0.04) tmp = t_1; elseif (a <= -9.5e-200) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (a <= 2.2e-68) tmp = Float64(Float64(Float64(y - z) * t) / Float64(a - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -0.04], t$95$1, If[LessEqual[a, -9.5e-200], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.2e-68], N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -0.04:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -9.5 \cdot 10^{-200}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{-68}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.0400000000000000008 or 2.20000000000000002e-68 < a Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
Taylor expanded in x around 0
Applied rewrites44.9%
if -0.0400000000000000008 < a < -9.4999999999999995e-200Initial program 79.8%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6437.7
Applied rewrites37.7%
if -9.4999999999999995e-200 < a < 2.20000000000000002e-68Initial program 79.8%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6440.1
Applied rewrites40.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ t a) (- y z) x))) (if (<= a -0.04) t_1 (if (<= a 1.5e-63) (/ (* (- t x) y) (- a z)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t / a), (y - z), x);
double tmp;
if (a <= -0.04) {
tmp = t_1;
} else if (a <= 1.5e-63) {
tmp = ((t - x) * y) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t / a), Float64(y - z), x) tmp = 0.0 if (a <= -0.04) tmp = t_1; elseif (a <= 1.5e-63) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -0.04], t$95$1, If[LessEqual[a, 1.5e-63], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -0.04:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{-63}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.0400000000000000008 or 1.4999999999999999e-63 < a Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
Taylor expanded in x around 0
Applied rewrites44.9%
if -0.0400000000000000008 < a < 1.4999999999999999e-63Initial program 79.8%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6437.7
Applied rewrites37.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.2e+57)
t
(if (<= z 2e-233)
(fma y (/ (- t x) a) x)
(if (<= z 5.2e+139) (fma (/ t a) (- y z) x) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e+57) {
tmp = t;
} else if (z <= 2e-233) {
tmp = fma(y, ((t - x) / a), x);
} else if (z <= 5.2e+139) {
tmp = fma((t / a), (y - z), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.2e+57) tmp = t; elseif (z <= 2e-233) tmp = fma(y, Float64(Float64(t - x) / a), x); elseif (z <= 5.2e+139) tmp = fma(Float64(t / a), Float64(y - z), x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.2e+57], t, If[LessEqual[z, 2e-233], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 5.2e+139], N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+57}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-233}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+139}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -6.20000000000000026e57 or 5.20000000000000044e139 < z Initial program 79.8%
Taylor expanded in z around inf
Applied rewrites25.1%
if -6.20000000000000026e57 < z < 1.99999999999999992e-233Initial program 79.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.8
Applied rewrites47.8%
if 1.99999999999999992e-233 < z < 5.20000000000000044e139Initial program 79.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
Taylor expanded in x around 0
Applied rewrites44.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.2e+57) t (if (<= z 5.6e+166) (fma y (/ (- t x) a) x) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e+57) {
tmp = t;
} else if (z <= 5.6e+166) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.2e+57) tmp = t; elseif (z <= 5.6e+166) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.2e+57], t, If[LessEqual[z, 5.6e+166], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+57}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+166}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -6.20000000000000026e57 or 5.59999999999999993e166 < z Initial program 79.8%
Taylor expanded in z around inf
Applied rewrites25.1%
if -6.20000000000000026e57 < z < 5.59999999999999993e166Initial program 79.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.8
Applied rewrites47.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y t) (- a z))) (t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -5e+69)
(+ x t)
(if (<= t_2 -5e-80)
(/ (* (- y z) t) a)
(if (<= t_2 -5e-281)
(* (- 1.0 (/ y a)) x)
(if (<= t_2 2e-305)
t
(if (<= t_2 3.9e-44) x (if (<= t_2 5e+306) (+ x t) t_1)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * t) / (a - z);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -5e+69) {
tmp = x + t;
} else if (t_2 <= -5e-80) {
tmp = ((y - z) * t) / a;
} else if (t_2 <= -5e-281) {
tmp = (1.0 - (y / a)) * x;
} else if (t_2 <= 2e-305) {
tmp = t;
} else if (t_2 <= 3.9e-44) {
tmp = x;
} else if (t_2 <= 5e+306) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * t) / (a - z);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -5e+69) {
tmp = x + t;
} else if (t_2 <= -5e-80) {
tmp = ((y - z) * t) / a;
} else if (t_2 <= -5e-281) {
tmp = (1.0 - (y / a)) * x;
} else if (t_2 <= 2e-305) {
tmp = t;
} else if (t_2 <= 3.9e-44) {
tmp = x;
} else if (t_2 <= 5e+306) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * t) / (a - z) t_2 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -5e+69: tmp = x + t elif t_2 <= -5e-80: tmp = ((y - z) * t) / a elif t_2 <= -5e-281: tmp = (1.0 - (y / a)) * x elif t_2 <= 2e-305: tmp = t elif t_2 <= 3.9e-44: tmp = x elif t_2 <= 5e+306: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * t) / Float64(a - z)) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -5e+69) tmp = Float64(x + t); elseif (t_2 <= -5e-80) tmp = Float64(Float64(Float64(y - z) * t) / a); elseif (t_2 <= -5e-281) tmp = Float64(Float64(1.0 - Float64(y / a)) * x); elseif (t_2 <= 2e-305) tmp = t; elseif (t_2 <= 3.9e-44) tmp = x; elseif (t_2 <= 5e+306) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * t) / (a - z); t_2 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -5e+69) tmp = x + t; elseif (t_2 <= -5e-80) tmp = ((y - z) * t) / a; elseif (t_2 <= -5e-281) tmp = (1.0 - (y / a)) * x; elseif (t_2 <= 2e-305) tmp = t; elseif (t_2 <= 3.9e-44) tmp = x; elseif (t_2 <= 5e+306) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * t), $MachinePrecision] / N[(a - z), $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, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e+69], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, -5e-80], N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$2, -5e-281], N[(N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$2, 2e-305], t, If[LessEqual[t$95$2, 3.9e-44], x, If[LessEqual[t$95$2, 5e+306], N[(x + t), $MachinePrecision], t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot t}{a - z}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+69}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-80}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot t}{a}\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-281}:\\
\;\;\;\;\left(1 - \frac{y}{a}\right) \cdot x\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-305}:\\
\;\;\;\;t\\
\mathbf{elif}\;t\_2 \leq 3.9 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0 or 4.99999999999999993e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.8%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6440.1
Applied rewrites40.1%
Taylor expanded in y around inf
Applied rewrites21.7%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.00000000000000036e69 or 3.9000000000000002e-44 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306Initial program 79.8%
Taylor expanded in z around inf
lift--.f6418.8
Applied rewrites18.8%
Taylor expanded in x around 0
Applied rewrites33.8%
if -5.00000000000000036e69 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5e-80Initial program 79.8%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6440.1
Applied rewrites40.1%
Taylor expanded in z around 0
Applied rewrites20.4%
if -5e-80 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999998e-281Initial program 79.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.5
Applied rewrites43.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f6437.1
Applied rewrites37.1%
if -4.9999999999999998e-281 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.99999999999999999e-305Initial program 79.8%
Taylor expanded in z around inf
Applied rewrites25.1%
if 1.99999999999999999e-305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 3.9000000000000002e-44Initial program 79.8%
Taylor expanded in a around inf
Applied rewrites25.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y t) (- a z))) (t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -1e-60)
(+ x t)
(if (<= t_2 -5e-281)
(* (- 1.0 (/ y a)) x)
(if (<= t_2 2e-305)
t
(if (<= t_2 3.9e-44) x (if (<= t_2 5e+306) (+ x t) t_1))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * t) / (a - z);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -1e-60) {
tmp = x + t;
} else if (t_2 <= -5e-281) {
tmp = (1.0 - (y / a)) * x;
} else if (t_2 <= 2e-305) {
tmp = t;
} else if (t_2 <= 3.9e-44) {
tmp = x;
} else if (t_2 <= 5e+306) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * t) / (a - z);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -1e-60) {
tmp = x + t;
} else if (t_2 <= -5e-281) {
tmp = (1.0 - (y / a)) * x;
} else if (t_2 <= 2e-305) {
tmp = t;
} else if (t_2 <= 3.9e-44) {
tmp = x;
} else if (t_2 <= 5e+306) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * t) / (a - z) t_2 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -1e-60: tmp = x + t elif t_2 <= -5e-281: tmp = (1.0 - (y / a)) * x elif t_2 <= 2e-305: tmp = t elif t_2 <= 3.9e-44: tmp = x elif t_2 <= 5e+306: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * t) / Float64(a - z)) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -1e-60) tmp = Float64(x + t); elseif (t_2 <= -5e-281) tmp = Float64(Float64(1.0 - Float64(y / a)) * x); elseif (t_2 <= 2e-305) tmp = t; elseif (t_2 <= 3.9e-44) tmp = x; elseif (t_2 <= 5e+306) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * t) / (a - z); t_2 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -1e-60) tmp = x + t; elseif (t_2 <= -5e-281) tmp = (1.0 - (y / a)) * x; elseif (t_2 <= 2e-305) tmp = t; elseif (t_2 <= 3.9e-44) tmp = x; elseif (t_2 <= 5e+306) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * t), $MachinePrecision] / N[(a - z), $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, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -1e-60], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, -5e-281], N[(N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$2, 2e-305], t, If[LessEqual[t$95$2, 3.9e-44], x, If[LessEqual[t$95$2, 5e+306], N[(x + t), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot t}{a - z}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-60}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-281}:\\
\;\;\;\;\left(1 - \frac{y}{a}\right) \cdot x\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-305}:\\
\;\;\;\;t\\
\mathbf{elif}\;t\_2 \leq 3.9 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0 or 4.99999999999999993e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.8%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6440.1
Applied rewrites40.1%
Taylor expanded in y around inf
Applied rewrites21.7%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999997e-61 or 3.9000000000000002e-44 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306Initial program 79.8%
Taylor expanded in z around inf
lift--.f6418.8
Applied rewrites18.8%
Taylor expanded in x around 0
Applied rewrites33.8%
if -9.9999999999999997e-61 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999998e-281Initial program 79.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.5
Applied rewrites43.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f6437.1
Applied rewrites37.1%
if -4.9999999999999998e-281 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.99999999999999999e-305Initial program 79.8%
Taylor expanded in z around inf
Applied rewrites25.1%
if 1.99999999999999999e-305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 3.9000000000000002e-44Initial program 79.8%
Taylor expanded in a around inf
Applied rewrites25.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* t y) a)) (t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -1e-60)
(+ x t)
(if (<= t_2 -5e-281)
(* (- 1.0 (/ y a)) x)
(if (<= t_2 2e-305)
t
(if (<= t_2 3.9e-44) x (if (<= t_2 5e+306) (+ x t) t_1))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t * y) / a;
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -1e-60) {
tmp = x + t;
} else if (t_2 <= -5e-281) {
tmp = (1.0 - (y / a)) * x;
} else if (t_2 <= 2e-305) {
tmp = t;
} else if (t_2 <= 3.9e-44) {
tmp = x;
} else if (t_2 <= 5e+306) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t * y) / a;
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -1e-60) {
tmp = x + t;
} else if (t_2 <= -5e-281) {
tmp = (1.0 - (y / a)) * x;
} else if (t_2 <= 2e-305) {
tmp = t;
} else if (t_2 <= 3.9e-44) {
tmp = x;
} else if (t_2 <= 5e+306) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t * y) / a t_2 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -1e-60: tmp = x + t elif t_2 <= -5e-281: tmp = (1.0 - (y / a)) * x elif t_2 <= 2e-305: tmp = t elif t_2 <= 3.9e-44: tmp = x elif t_2 <= 5e+306: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t * y) / a) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -1e-60) tmp = Float64(x + t); elseif (t_2 <= -5e-281) tmp = Float64(Float64(1.0 - Float64(y / a)) * x); elseif (t_2 <= 2e-305) tmp = t; elseif (t_2 <= 3.9e-44) tmp = x; elseif (t_2 <= 5e+306) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t * y) / a; t_2 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -1e-60) tmp = x + t; elseif (t_2 <= -5e-281) tmp = (1.0 - (y / a)) * x; elseif (t_2 <= 2e-305) tmp = t; elseif (t_2 <= 3.9e-44) tmp = x; elseif (t_2 <= 5e+306) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t * y), $MachinePrecision] / a), $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, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -1e-60], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, -5e-281], N[(N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$2, 2e-305], t, If[LessEqual[t$95$2, 3.9e-44], x, If[LessEqual[t$95$2, 5e+306], N[(x + t), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot y}{a}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-60}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-281}:\\
\;\;\;\;\left(1 - \frac{y}{a}\right) \cdot x\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-305}:\\
\;\;\;\;t\\
\mathbf{elif}\;t\_2 \leq 3.9 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0 or 4.99999999999999993e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.8%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6440.1
Applied rewrites40.1%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6416.8
Applied rewrites16.8%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999997e-61 or 3.9000000000000002e-44 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306Initial program 79.8%
Taylor expanded in z around inf
lift--.f6418.8
Applied rewrites18.8%
Taylor expanded in x around 0
Applied rewrites33.8%
if -9.9999999999999997e-61 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999998e-281Initial program 79.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.5
Applied rewrites43.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f6437.1
Applied rewrites37.1%
if -4.9999999999999998e-281 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.99999999999999999e-305Initial program 79.8%
Taylor expanded in z around inf
Applied rewrites25.1%
if 1.99999999999999999e-305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 3.9000000000000002e-44Initial program 79.8%
Taylor expanded in a around inf
Applied rewrites25.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* t y) a)) (t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -1e-60)
(+ x t)
(if (<= t_2 -5e-281)
x
(if (<= t_2 2e-305)
t
(if (<= t_2 3.9e-44) x (if (<= t_2 5e+306) (+ x t) t_1))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t * y) / a;
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -1e-60) {
tmp = x + t;
} else if (t_2 <= -5e-281) {
tmp = x;
} else if (t_2 <= 2e-305) {
tmp = t;
} else if (t_2 <= 3.9e-44) {
tmp = x;
} else if (t_2 <= 5e+306) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t * y) / a;
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -1e-60) {
tmp = x + t;
} else if (t_2 <= -5e-281) {
tmp = x;
} else if (t_2 <= 2e-305) {
tmp = t;
} else if (t_2 <= 3.9e-44) {
tmp = x;
} else if (t_2 <= 5e+306) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t * y) / a t_2 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -1e-60: tmp = x + t elif t_2 <= -5e-281: tmp = x elif t_2 <= 2e-305: tmp = t elif t_2 <= 3.9e-44: tmp = x elif t_2 <= 5e+306: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t * y) / a) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -1e-60) tmp = Float64(x + t); elseif (t_2 <= -5e-281) tmp = x; elseif (t_2 <= 2e-305) tmp = t; elseif (t_2 <= 3.9e-44) tmp = x; elseif (t_2 <= 5e+306) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t * y) / a; t_2 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -1e-60) tmp = x + t; elseif (t_2 <= -5e-281) tmp = x; elseif (t_2 <= 2e-305) tmp = t; elseif (t_2 <= 3.9e-44) tmp = x; elseif (t_2 <= 5e+306) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t * y), $MachinePrecision] / a), $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, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -1e-60], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, -5e-281], x, If[LessEqual[t$95$2, 2e-305], t, If[LessEqual[t$95$2, 3.9e-44], x, If[LessEqual[t$95$2, 5e+306], N[(x + t), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot y}{a}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-60}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-281}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-305}:\\
\;\;\;\;t\\
\mathbf{elif}\;t\_2 \leq 3.9 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0 or 4.99999999999999993e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.8%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6440.1
Applied rewrites40.1%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6416.8
Applied rewrites16.8%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999997e-61 or 3.9000000000000002e-44 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306Initial program 79.8%
Taylor expanded in z around inf
lift--.f6418.8
Applied rewrites18.8%
Taylor expanded in x around 0
Applied rewrites33.8%
if -9.9999999999999997e-61 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999998e-281 or 1.99999999999999999e-305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 3.9000000000000002e-44Initial program 79.8%
Taylor expanded in a around inf
Applied rewrites25.9%
if -4.9999999999999998e-281 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.99999999999999999e-305Initial program 79.8%
Taylor expanded in z around inf
Applied rewrites25.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 -1e-60)
(+ x t)
(if (<= t_1 -5e-281)
x
(if (<= t_1 2e-305)
t
(if (<= t_1 3.9e-44)
x
(if (<= t_1 5e+306) (+ x t) (/ (* x 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 <= -1e-60) {
tmp = x + t;
} else if (t_1 <= -5e-281) {
tmp = x;
} else if (t_1 <= 2e-305) {
tmp = t;
} else if (t_1 <= 3.9e-44) {
tmp = x;
} else if (t_1 <= 5e+306) {
tmp = x + t;
} else {
tmp = (x * 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 <= (-1d-60)) then
tmp = x + t
else if (t_1 <= (-5d-281)) then
tmp = x
else if (t_1 <= 2d-305) then
tmp = t
else if (t_1 <= 3.9d-44) then
tmp = x
else if (t_1 <= 5d+306) then
tmp = x + t
else
tmp = (x * 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 <= -1e-60) {
tmp = x + t;
} else if (t_1 <= -5e-281) {
tmp = x;
} else if (t_1 <= 2e-305) {
tmp = t;
} else if (t_1 <= 3.9e-44) {
tmp = x;
} else if (t_1 <= 5e+306) {
tmp = x + t;
} else {
tmp = (x * 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 <= -1e-60: tmp = x + t elif t_1 <= -5e-281: tmp = x elif t_1 <= 2e-305: tmp = t elif t_1 <= 3.9e-44: tmp = x elif t_1 <= 5e+306: tmp = x + t else: tmp = (x * 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 <= -1e-60) tmp = Float64(x + t); elseif (t_1 <= -5e-281) tmp = x; elseif (t_1 <= 2e-305) tmp = t; elseif (t_1 <= 3.9e-44) tmp = x; elseif (t_1 <= 5e+306) tmp = Float64(x + t); else tmp = Float64(Float64(x * 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 <= -1e-60) tmp = x + t; elseif (t_1 <= -5e-281) tmp = x; elseif (t_1 <= 2e-305) tmp = t; elseif (t_1 <= 3.9e-44) tmp = x; elseif (t_1 <= 5e+306) tmp = x + t; else tmp = (x * 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, -1e-60], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, -5e-281], x, If[LessEqual[t$95$1, 2e-305], t, If[LessEqual[t$95$1, 3.9e-44], x, If[LessEqual[t$95$1, 5e+306], N[(x + t), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-60}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-281}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-305}:\\
\;\;\;\;t\\
\mathbf{elif}\;t\_1 \leq 3.9 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999997e-61 or 3.9000000000000002e-44 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306Initial program 79.8%
Taylor expanded in z around inf
lift--.f6418.8
Applied rewrites18.8%
Taylor expanded in x around 0
Applied rewrites33.8%
if -9.9999999999999997e-61 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999998e-281 or 1.99999999999999999e-305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 3.9000000000000002e-44Initial program 79.8%
Taylor expanded in a around inf
Applied rewrites25.9%
if -4.9999999999999998e-281 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.99999999999999999e-305Initial program 79.8%
Taylor expanded in z around inf
Applied rewrites25.1%
if 4.99999999999999993e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.5
Applied rewrites43.5%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f6416.5
Applied rewrites16.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 -1e-60)
(+ x t)
(if (<= t_1 -5e-281)
x
(if (<= t_1 2e-305) t (if (<= t_1 3.9e-44) x (+ x t)))))))
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 <= -1e-60) {
tmp = x + t;
} else if (t_1 <= -5e-281) {
tmp = x;
} else if (t_1 <= 2e-305) {
tmp = t;
} else if (t_1 <= 3.9e-44) {
tmp = x;
} 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) :: t_1
real(8) :: tmp
t_1 = x + ((y - z) * ((t - x) / (a - z)))
if (t_1 <= (-1d-60)) then
tmp = x + t
else if (t_1 <= (-5d-281)) then
tmp = x
else if (t_1 <= 2d-305) then
tmp = t
else if (t_1 <= 3.9d-44) then
tmp = x
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 t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -1e-60) {
tmp = x + t;
} else if (t_1 <= -5e-281) {
tmp = x;
} else if (t_1 <= 2e-305) {
tmp = t;
} else if (t_1 <= 3.9e-44) {
tmp = x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_1 <= -1e-60: tmp = x + t elif t_1 <= -5e-281: tmp = x elif t_1 <= 2e-305: tmp = t elif t_1 <= 3.9e-44: tmp = x else: tmp = x + t 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 <= -1e-60) tmp = Float64(x + t); elseif (t_1 <= -5e-281) tmp = x; elseif (t_1 <= 2e-305) tmp = t; elseif (t_1 <= 3.9e-44) tmp = x; else tmp = Float64(x + t); 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 <= -1e-60) tmp = x + t; elseif (t_1 <= -5e-281) tmp = x; elseif (t_1 <= 2e-305) tmp = t; elseif (t_1 <= 3.9e-44) tmp = x; else tmp = x + t; 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, -1e-60], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, -5e-281], x, If[LessEqual[t$95$1, 2e-305], t, If[LessEqual[t$95$1, 3.9e-44], x, N[(x + t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-60}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-281}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-305}:\\
\;\;\;\;t\\
\mathbf{elif}\;t\_1 \leq 3.9 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999997e-61 or 3.9000000000000002e-44 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.8%
Taylor expanded in z around inf
lift--.f6418.8
Applied rewrites18.8%
Taylor expanded in x around 0
Applied rewrites33.8%
if -9.9999999999999997e-61 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999998e-281 or 1.99999999999999999e-305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 3.9000000000000002e-44Initial program 79.8%
Taylor expanded in a around inf
Applied rewrites25.9%
if -4.9999999999999998e-281 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.99999999999999999e-305Initial program 79.8%
Taylor expanded in z around inf
Applied rewrites25.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -5e-5) t (if (<= z 1.16e-7) x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-5) {
tmp = t;
} else if (z <= 1.16e-7) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5d-5)) then
tmp = t
else if (z <= 1.16d-7) then
tmp = x
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-5) {
tmp = t;
} else if (z <= 1.16e-7) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5e-5: tmp = t elif z <= 1.16e-7: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e-5) tmp = t; elseif (z <= 1.16e-7) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5e-5) tmp = t; elseif (z <= 1.16e-7) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e-5], t, If[LessEqual[z, 1.16e-7], x, t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-5}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-7}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -5.00000000000000024e-5 or 1.1600000000000001e-7 < z Initial program 79.8%
Taylor expanded in z around inf
Applied rewrites25.1%
if -5.00000000000000024e-5 < z < 1.1600000000000001e-7Initial program 79.8%
Taylor expanded in a around inf
Applied rewrites25.9%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 79.8%
Taylor expanded in z around inf
Applied rewrites25.1%
herbie shell --seed 2025123
(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)))))