
(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 22 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 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 (- INFINITY))
(/ (* (- t x) y) (- a z))
(if (<= t_1 -1e-266)
t_1
(if (<= t_1 0.0)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(if (<= t_1 2e-62)
(*
-1.0
(*
x
(-
(fma -1.0 (/ (* t (- y z)) (* x (- a z))) (/ y (- a z)))
(+ 1.0 (/ z (- a z))))))
(+ x (* (- y z) (- (/ t (- a z)) (/ x (- a 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 <= -((double) INFINITY)) {
tmp = ((t - x) * y) / (a - z);
} else if (t_1 <= -1e-266) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else if (t_1 <= 2e-62) {
tmp = -1.0 * (x * (fma(-1.0, ((t * (y - z)) / (x * (a - z))), (y / (a - z))) - (1.0 + (z / (a - z)))));
} else {
tmp = x + ((y - z) * ((t / (a - z)) - (x / (a - 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 <= Float64(-Inf)) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (t_1 <= -1e-266) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); elseif (t_1 <= 2e-62) tmp = Float64(-1.0 * Float64(x * Float64(fma(-1.0, Float64(Float64(t * Float64(y - z)) / Float64(x * Float64(a - z))), Float64(y / Float64(a - z))) - Float64(1.0 + Float64(z / Float64(a - z)))))); else tmp = Float64(x + Float64(Float64(y - z) * Float64(Float64(t / Float64(a - z)) - Float64(x / Float64(a - z))))); end return 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, (-Infinity)], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-266], t$95$1, If[LessEqual[t$95$1, 0.0], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], If[LessEqual[t$95$1, 2e-62], N[(-1.0 * N[(x * N[(N[(-1.0 * N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(x * N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -\infty:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-62}:\\
\;\;\;\;-1 \cdot \left(x \cdot \left(\mathsf{fma}\left(-1, \frac{t \cdot \left(y - z\right)}{x \cdot \left(a - z\right)}, \frac{y}{a - z}\right) - \left(1 + \frac{z}{a - z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 86.7%
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--.f6491.8
Applied rewrites91.8%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999998e-267Initial program 92.2%
if -9.9999999999999998e-267 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 6.7%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites80.4%
if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2.0000000000000001e-62Initial program 74.0%
Taylor expanded in z around inf
Applied rewrites29.3%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites94.3%
if 2.0000000000000001e-62 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 93.1%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6492.6
Applied rewrites92.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 (- INFINITY))
(/ (* (- t x) y) (- a z))
(if (<= t_1 -1e-266)
t_1
(if (<= t_1 1e-217)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(+ x (* (- y z) (- (/ t (- a z)) (/ x (- a 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 <= -((double) INFINITY)) {
tmp = ((t - x) * y) / (a - z);
} else if (t_1 <= -1e-266) {
tmp = t_1;
} else if (t_1 <= 1e-217) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else {
tmp = x + ((y - z) * ((t / (a - z)) - (x / (a - z))));
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) {
tmp = ((t - x) * y) / (a - z);
} else if (t_1 <= -1e-266) {
tmp = t_1;
} else if (t_1 <= 1e-217) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else {
tmp = x + ((y - z) * ((t / (a - z)) - (x / (a - z))));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_1 <= -math.inf: tmp = ((t - x) * y) / (a - z) elif t_1 <= -1e-266: tmp = t_1 elif t_1 <= 1e-217: tmp = -(((t - x) * (y - a)) / z) + t else: tmp = x + ((y - z) * ((t / (a - z)) - (x / (a - 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 <= Float64(-Inf)) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (t_1 <= -1e-266) tmp = t_1; elseif (t_1 <= 1e-217) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); else tmp = Float64(x + Float64(Float64(y - z) * Float64(Float64(t / Float64(a - z)) - Float64(x / Float64(a - 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 <= -Inf) tmp = ((t - x) * y) / (a - z); elseif (t_1 <= -1e-266) tmp = t_1; elseif (t_1 <= 1e-217) tmp = -(((t - x) * (y - a)) / z) + t; else tmp = x + ((y - z) * ((t / (a - z)) - (x / (a - 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, (-Infinity)], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-266], t$95$1, If[LessEqual[t$95$1, 1e-217], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -\infty:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{-217}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 86.7%
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--.f6491.8
Applied rewrites91.8%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999998e-267Initial program 92.2%
if -9.9999999999999998e-267 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000008e-217Initial program 13.6%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites74.3%
if 1.00000000000000008e-217 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.5%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6491.0
Applied rewrites91.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 (- INFINITY))
(/ (* (- t x) y) (- a z))
(if (<= t_1 -1e-266)
t_1
(if (<= t_1 1e-217)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(fma (/ (- x t) (- z a)) (- y z) x))))))
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 <= -((double) INFINITY)) {
tmp = ((t - x) * y) / (a - z);
} else if (t_1 <= -1e-266) {
tmp = t_1;
} else if (t_1 <= 1e-217) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else {
tmp = fma(((x - t) / (z - a)), (y - z), x);
}
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 <= Float64(-Inf)) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (t_1 <= -1e-266) tmp = t_1; elseif (t_1 <= 1e-217) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); else tmp = fma(Float64(Float64(x - t) / Float64(z - a)), Float64(y - z), x); end return 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, (-Infinity)], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-266], t$95$1, If[LessEqual[t$95$1, 1e-217], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $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 -\infty:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{-217}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z - a}, y - z, x\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 86.7%
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--.f6491.8
Applied rewrites91.8%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999998e-267Initial program 92.2%
if -9.9999999999999998e-267 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000008e-217Initial program 13.6%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites74.3%
if 1.00000000000000008e-217 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.5%
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
negate-sub2N/A
negate-sub2N/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lift--.f6491.5
Applied rewrites91.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z)))))
(t_2 (fma (/ (- x t) (- z a)) (- y z) x)))
(if (<= t_1 (- INFINITY))
(/ (* (- t x) y) (- a z))
(if (<= t_1 -1e-266)
t_2
(if (<= t_1 1e-217) (+ (- (/ (* (- t x) (- y a)) z)) t) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double t_2 = fma(((x - t) / (z - a)), (y - z), x);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = ((t - x) * y) / (a - z);
} else if (t_1 <= -1e-266) {
tmp = t_2;
} else if (t_1 <= 1e-217) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) t_2 = fma(Float64(Float64(x - t) / Float64(z - a)), Float64(y - z), x) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (t_1 <= -1e-266) tmp = t_2; elseif (t_1 <= 1e-217) 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[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-266], t$95$2, If[LessEqual[t$95$1, 1e-217], 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 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
t_2 := \mathsf{fma}\left(\frac{x - t}{z - a}, y - z, x\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-266}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-217}:\\
\;\;\;\;\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)))) < -inf.0Initial program 86.7%
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--.f6491.8
Applied rewrites91.8%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999998e-267 or 1.00000000000000008e-217 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.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
negate-sub2N/A
negate-sub2N/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lift--.f6491.8
Applied rewrites91.8%
if -9.9999999999999998e-267 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000008e-217Initial program 13.6%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites74.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ t (- a z)))))
(t_2 (/ (- t x) (- a z)))
(t_3 (+ x (* (- y z) t_2))))
(if (<= t_3 (- INFINITY))
(/ (* (- t x) y) (- a z))
(if (<= t_3 -1e-266)
t_1
(if (<= t_3 1e-217)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(if (<= t_3 5e+276) t_1 (+ x (* y 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) / (a - z);
double t_3 = x + ((y - z) * t_2);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = ((t - x) * y) / (a - z);
} else if (t_3 <= -1e-266) {
tmp = t_1;
} else if (t_3 <= 1e-217) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else if (t_3 <= 5e+276) {
tmp = t_1;
} else {
tmp = x + (y * t_2);
}
return tmp;
}
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) / (a - z);
double t_3 = x + ((y - z) * t_2);
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = ((t - x) * y) / (a - z);
} else if (t_3 <= -1e-266) {
tmp = t_1;
} else if (t_3 <= 1e-217) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else if (t_3 <= 5e+276) {
tmp = t_1;
} else {
tmp = x + (y * t_2);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * (t / (a - z))) t_2 = (t - x) / (a - z) t_3 = x + ((y - z) * t_2) tmp = 0 if t_3 <= -math.inf: tmp = ((t - x) * y) / (a - z) elif t_3 <= -1e-266: tmp = t_1 elif t_3 <= 1e-217: tmp = -(((t - x) * (y - a)) / z) + t elif t_3 <= 5e+276: tmp = t_1 else: tmp = x + (y * 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(Float64(t - x) / Float64(a - z)) t_3 = Float64(x + Float64(Float64(y - z) * t_2)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (t_3 <= -1e-266) tmp = t_1; elseif (t_3 <= 1e-217) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); elseif (t_3 <= 5e+276) tmp = t_1; else tmp = Float64(x + Float64(y * 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) / (a - z); t_3 = x + ((y - z) * t_2); tmp = 0.0; if (t_3 <= -Inf) tmp = ((t - x) * y) / (a - z); elseif (t_3 <= -1e-266) tmp = t_1; elseif (t_3 <= 1e-217) tmp = -(((t - x) * (y - a)) / z) + t; elseif (t_3 <= 5e+276) tmp = t_1; else tmp = x + (y * 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[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -1e-266], t$95$1, If[LessEqual[t$95$3, 1e-217], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], If[LessEqual[t$95$3, 5e+276], t$95$1, N[(x + N[(y * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t}{a - z}\\
t_2 := \frac{t - x}{a - z}\\
t_3 := x + \left(y - z\right) \cdot t\_2\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 10^{-217}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot t\_2\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 86.7%
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--.f6491.8
Applied rewrites91.8%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999998e-267 or 1.00000000000000008e-217 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.00000000000000001e276Initial program 92.8%
Taylor expanded in x around 0
Applied rewrites78.0%
if -9.9999999999999998e-267 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000008e-217Initial program 13.6%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites74.3%
if 5.00000000000000001e276 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 85.8%
Taylor expanded in y around inf
Applied rewrites77.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ t (- a z)))))
(t_2 (/ (- t x) (- a z)))
(t_3 (+ x (* (- y z) t_2))))
(if (<= t_3 (- INFINITY))
(/ (* (- t x) y) (- a z))
(if (<= t_3 -1e-266)
t_1
(if (<= t_3 5e-238)
(* -1.0 (* x (* -1.0 (/ (- y a) z))))
(if (<= t_3 5e+276) t_1 (+ x (* y 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) / (a - z);
double t_3 = x + ((y - z) * t_2);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = ((t - x) * y) / (a - z);
} else if (t_3 <= -1e-266) {
tmp = t_1;
} else if (t_3 <= 5e-238) {
tmp = -1.0 * (x * (-1.0 * ((y - a) / z)));
} else if (t_3 <= 5e+276) {
tmp = t_1;
} else {
tmp = x + (y * t_2);
}
return tmp;
}
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) / (a - z);
double t_3 = x + ((y - z) * t_2);
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = ((t - x) * y) / (a - z);
} else if (t_3 <= -1e-266) {
tmp = t_1;
} else if (t_3 <= 5e-238) {
tmp = -1.0 * (x * (-1.0 * ((y - a) / z)));
} else if (t_3 <= 5e+276) {
tmp = t_1;
} else {
tmp = x + (y * t_2);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * (t / (a - z))) t_2 = (t - x) / (a - z) t_3 = x + ((y - z) * t_2) tmp = 0 if t_3 <= -math.inf: tmp = ((t - x) * y) / (a - z) elif t_3 <= -1e-266: tmp = t_1 elif t_3 <= 5e-238: tmp = -1.0 * (x * (-1.0 * ((y - a) / z))) elif t_3 <= 5e+276: tmp = t_1 else: tmp = x + (y * 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(Float64(t - x) / Float64(a - z)) t_3 = Float64(x + Float64(Float64(y - z) * t_2)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (t_3 <= -1e-266) tmp = t_1; elseif (t_3 <= 5e-238) tmp = Float64(-1.0 * Float64(x * Float64(-1.0 * Float64(Float64(y - a) / z)))); elseif (t_3 <= 5e+276) tmp = t_1; else tmp = Float64(x + Float64(y * 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) / (a - z); t_3 = x + ((y - z) * t_2); tmp = 0.0; if (t_3 <= -Inf) tmp = ((t - x) * y) / (a - z); elseif (t_3 <= -1e-266) tmp = t_1; elseif (t_3 <= 5e-238) tmp = -1.0 * (x * (-1.0 * ((y - a) / z))); elseif (t_3 <= 5e+276) tmp = t_1; else tmp = x + (y * 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[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -1e-266], t$95$1, If[LessEqual[t$95$3, 5e-238], N[(-1.0 * N[(x * N[(-1.0 * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+276], t$95$1, N[(x + N[(y * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t}{a - z}\\
t_2 := \frac{t - x}{a - z}\\
t_3 := x + \left(y - z\right) \cdot t\_2\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-238}:\\
\;\;\;\;-1 \cdot \left(x \cdot \left(-1 \cdot \frac{y - a}{z}\right)\right)\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot t\_2\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 86.7%
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--.f6491.8
Applied rewrites91.8%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999998e-267 or 5e-238 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.00000000000000001e276Initial program 92.5%
Taylor expanded in x around 0
Applied rewrites77.8%
if -9.9999999999999998e-267 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5e-238Initial program 12.3%
Taylor expanded in z around inf
Applied rewrites38.3%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6432.4
Applied rewrites32.4%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6449.9
Applied rewrites49.9%
if 5.00000000000000001e276 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 85.8%
Taylor expanded in y around inf
Applied rewrites77.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= z -5.6e+52)
t_1
(if (<= z 1.75e+108) (+ 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 <= -5.6e+52) {
tmp = t_1;
} else if (z <= 1.75e+108) {
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 <= (-5.6d+52)) then
tmp = t_1
else if (z <= 1.75d+108) 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 <= -5.6e+52) {
tmp = t_1;
} else if (z <= 1.75e+108) {
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 <= -5.6e+52: tmp = t_1 elif z <= 1.75e+108: 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 <= -5.6e+52) tmp = t_1; elseif (z <= 1.75e+108) 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 <= -5.6e+52) tmp = t_1; elseif (z <= 1.75e+108) 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, -5.6e+52], t$95$1, If[LessEqual[z, 1.75e+108], 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 -5.6 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+108}:\\
\;\;\;\;x + y \cdot \frac{t - x}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.6e52 or 1.7500000000000001e108 < z Initial program 62.7%
Taylor expanded in z around inf
Applied rewrites48.9%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6463.7
Applied rewrites63.7%
if -5.6e52 < z < 1.7500000000000001e108Initial program 90.1%
Taylor expanded in y around inf
Applied rewrites79.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- t x) (/ (- y z) a) x))) (if (<= a -1.3e+18) t_1 (if (<= a 3.5e+36) (* 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), ((y - z) / a), x);
double tmp;
if (a <= -1.3e+18) {
tmp = t_1;
} else if (a <= 3.5e+36) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(y - z) / a), x) tmp = 0.0 if (a <= -1.3e+18) tmp = t_1; elseif (a <= 3.5e+36) 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 - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.3e+18], t$95$1, If[LessEqual[a, 3.5e+36], 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(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{if}\;a \leq -1.3 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+36}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.3e18 or 3.4999999999999998e36 < a Initial program 88.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6477.3
Applied rewrites77.3%
if -1.3e18 < a < 3.4999999999999998e36Initial program 73.5%
Taylor expanded in z around inf
Applied rewrites33.4%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6461.9
Applied rewrites61.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma t (/ (- y z) a) x)))
(if (<= a -7.2e+130)
t_1
(if (<= a 4.2e+116) (* t (/ (- y z) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, ((y - z) / a), x);
double tmp;
if (a <= -7.2e+130) {
tmp = t_1;
} else if (a <= 4.2e+116) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(Float64(y - z) / a), x) tmp = 0.0 if (a <= -7.2e+130) tmp = t_1; elseif (a <= 4.2e+116) 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[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -7.2e+130], t$95$1, If[LessEqual[a, 4.2e+116], 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(t, \frac{y - z}{a}, x\right)\\
\mathbf{if}\;a \leq -7.2 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{+116}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.2000000000000002e130 or 4.2000000000000002e116 < a Initial program 90.8%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6484.7
Applied rewrites84.7%
Taylor expanded in x around 0
Applied rewrites78.6%
if -7.2000000000000002e130 < a < 4.2000000000000002e116Initial program 75.6%
Taylor expanded in z around inf
Applied rewrites30.8%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6459.0
Applied rewrites59.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.3e+18) (fma (- t x) (/ y a) x) (if (<= a 3.5e+36) (* t (/ (- y z) (- z))) (fma t (/ (- y z) a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.3e+18) {
tmp = fma((t - x), (y / a), x);
} else if (a <= 3.5e+36) {
tmp = t * ((y - z) / -z);
} else {
tmp = fma(t, ((y - z) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.3e+18) tmp = fma(Float64(t - x), Float64(y / a), x); elseif (a <= 3.5e+36) tmp = Float64(t * Float64(Float64(y - z) / Float64(-z))); else tmp = fma(t, Float64(Float64(y - z) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.3e+18], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 3.5e+36], N[(t * N[(N[(y - z), $MachinePrecision] / (-z)), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+36}:\\
\;\;\;\;t \cdot \frac{y - z}{-z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y - z}{a}, x\right)\\
\end{array}
\end{array}
if a < -1.3e18Initial program 88.4%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6475.8
Applied rewrites75.8%
Taylor expanded in y around inf
Applied rewrites66.9%
if -1.3e18 < a < 3.4999999999999998e36Initial program 73.5%
Taylor expanded in z around inf
Applied rewrites33.4%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6461.9
Applied rewrites61.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6452.0
Applied rewrites52.0%
if 3.4999999999999998e36 < a Initial program 87.8%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6478.8
Applied rewrites78.8%
Taylor expanded in x around 0
Applied rewrites71.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.3e+18) (fma y (/ (- t x) a) x) (if (<= a 3.5e+36) (* t (/ (- y z) (- z))) (fma t (/ (- y z) a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.3e+18) {
tmp = fma(y, ((t - x) / a), x);
} else if (a <= 3.5e+36) {
tmp = t * ((y - z) / -z);
} else {
tmp = fma(t, ((y - z) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.3e+18) tmp = fma(y, Float64(Float64(t - x) / a), x); elseif (a <= 3.5e+36) tmp = Float64(t * Float64(Float64(y - z) / Float64(-z))); else tmp = fma(t, Float64(Float64(y - z) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.3e+18], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 3.5e+36], N[(t * N[(N[(y - z), $MachinePrecision] / (-z)), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+36}:\\
\;\;\;\;t \cdot \frac{y - z}{-z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y - z}{a}, x\right)\\
\end{array}
\end{array}
if a < -1.3e18Initial program 88.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6466.0
Applied rewrites66.0%
if -1.3e18 < a < 3.4999999999999998e36Initial program 73.5%
Taylor expanded in z around inf
Applied rewrites33.4%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6461.9
Applied rewrites61.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6452.0
Applied rewrites52.0%
if 3.4999999999999998e36 < a Initial program 87.8%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6478.8
Applied rewrites78.8%
Taylor expanded in x around 0
Applied rewrites71.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (/ (- t x) a) x))) (if (<= a -1.3e+18) t_1 (if (<= a 2.8e-68) (* t (/ (- y z) (- z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((t - x) / a), x);
double tmp;
if (a <= -1.3e+18) {
tmp = t_1;
} else if (a <= 2.8e-68) {
tmp = t * ((y - z) / -z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -1.3e+18) tmp = t_1; elseif (a <= 2.8e-68) tmp = Float64(t * Float64(Float64(y - z) / Float64(-z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.3e+18], t$95$1, If[LessEqual[a, 2.8e-68], N[(t * N[(N[(y - z), $MachinePrecision] / (-z)), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -1.3 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{-68}:\\
\;\;\;\;t \cdot \frac{y - z}{-z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.3e18 or 2.8000000000000001e-68 < a Initial program 86.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6463.7
Applied rewrites63.7%
if -1.3e18 < a < 2.8000000000000001e-68Initial program 73.1%
Taylor expanded in z around inf
Applied rewrites34.1%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6462.4
Applied rewrites62.4%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6453.8
Applied rewrites53.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (/ t a) x))) (if (<= a -5.5e+124) t_1 (if (<= a 3.5e+36) (* t (/ (- y z) (- z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (t / a), x);
double tmp;
if (a <= -5.5e+124) {
tmp = t_1;
} else if (a <= 3.5e+36) {
tmp = t * ((y - z) / -z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(t / a), x) tmp = 0.0 if (a <= -5.5e+124) tmp = t_1; elseif (a <= 3.5e+36) tmp = Float64(t * Float64(Float64(y - z) / Float64(-z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -5.5e+124], t$95$1, If[LessEqual[a, 3.5e+36], N[(t * N[(N[(y - z), $MachinePrecision] / (-z)), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{if}\;a \leq -5.5 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+36}:\\
\;\;\;\;t \cdot \frac{y - z}{-z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.49999999999999977e124 or 3.4999999999999998e36 < a Initial program 89.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6471.1
Applied rewrites71.1%
Taylor expanded in x around 0
Applied rewrites64.4%
if -5.49999999999999977e124 < a < 3.4999999999999998e36Initial program 74.7%
Taylor expanded in z around inf
Applied rewrites32.0%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6460.4
Applied rewrites60.4%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6448.9
Applied rewrites48.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- z) (- a z)))))
(if (<= z -1.15e+61)
t_1
(if (<= z 4.7e-51)
(fma y (/ t a) x)
(if (<= z 1.22e+73) (/ (* x (- y a)) z) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (-z / (a - z));
double tmp;
if (z <= -1.15e+61) {
tmp = t_1;
} else if (z <= 4.7e-51) {
tmp = fma(y, (t / a), x);
} else if (z <= 1.22e+73) {
tmp = (x * (y - a)) / z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(-z) / Float64(a - z))) tmp = 0.0 if (z <= -1.15e+61) tmp = t_1; elseif (z <= 4.7e-51) tmp = fma(y, Float64(t / a), x); elseif (z <= 1.22e+73) tmp = Float64(Float64(x * Float64(y - a)) / z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[((-z) / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e+61], t$95$1, If[LessEqual[z, 4.7e-51], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.22e+73], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{-z}{a - z}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-51}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{+73}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.15e61 or 1.21999999999999998e73 < z Initial program 63.7%
Taylor expanded in z around inf
Applied rewrites47.8%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6463.4
Applied rewrites63.4%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6454.1
Applied rewrites54.1%
if -1.15e61 < z < 4.6999999999999997e-51Initial program 91.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6472.2
Applied rewrites72.2%
Taylor expanded in x around 0
Applied rewrites59.4%
if 4.6999999999999997e-51 < z < 1.21999999999999998e73Initial program 86.4%
Taylor expanded in z around inf
Applied rewrites19.8%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6448.0
Applied rewrites48.0%
Taylor expanded in z around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6423.7
Applied rewrites23.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.9e+66)
t
(if (<= z 4.7e-51)
(fma y (/ t a) x)
(if (<= z 1.32e+73) (/ (* x (- y a)) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+66) {
tmp = t;
} else if (z <= 4.7e-51) {
tmp = fma(y, (t / a), x);
} else if (z <= 1.32e+73) {
tmp = (x * (y - a)) / z;
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e+66) tmp = t; elseif (z <= 4.7e-51) tmp = fma(y, Float64(t / a), x); elseif (z <= 1.32e+73) tmp = Float64(Float64(x * Float64(y - a)) / z); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+66], t, If[LessEqual[z, 4.7e-51], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.32e+73], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+66}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-51}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+73}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.9000000000000001e66 or 1.32e73 < z Initial program 63.6%
Taylor expanded in z around inf
Applied rewrites47.9%
if -1.9000000000000001e66 < z < 4.6999999999999997e-51Initial program 91.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6471.9
Applied rewrites71.9%
Taylor expanded in x around 0
Applied rewrites59.1%
if 4.6999999999999997e-51 < z < 1.32e73Initial program 86.4%
Taylor expanded in z around inf
Applied rewrites19.8%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6448.0
Applied rewrites48.0%
Taylor expanded in z around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6423.7
Applied rewrites23.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.9e+66) t (if (<= z 4.8e-51) (fma y (/ t a) x) (if (<= z 7.2e+72) (/ (* x y) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+66) {
tmp = t;
} else if (z <= 4.8e-51) {
tmp = fma(y, (t / a), x);
} else if (z <= 7.2e+72) {
tmp = (x * y) / z;
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e+66) tmp = t; elseif (z <= 4.8e-51) tmp = fma(y, Float64(t / a), x); elseif (z <= 7.2e+72) tmp = Float64(Float64(x * y) / z); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+66], t, If[LessEqual[z, 4.8e-51], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 7.2e+72], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+66}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-51}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+72}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.9000000000000001e66 or 7.20000000000000069e72 < z Initial program 63.6%
Taylor expanded in z around inf
Applied rewrites47.9%
if -1.9000000000000001e66 < z < 4.8e-51Initial program 91.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6471.9
Applied rewrites71.9%
Taylor expanded in x around 0
Applied rewrites59.1%
if 4.8e-51 < z < 7.20000000000000069e72Initial program 86.4%
Taylor expanded in z around inf
Applied rewrites19.8%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6448.0
Applied rewrites48.0%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f6419.0
Applied rewrites19.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.8e-42) (fma (- x) (/ y a) x) (if (<= a 6e-84) (- (/ (* t (- y z)) z)) (fma y (/ t a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.8e-42) {
tmp = fma(-x, (y / a), x);
} else if (a <= 6e-84) {
tmp = -((t * (y - z)) / z);
} else {
tmp = fma(y, (t / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.8e-42) tmp = fma(Float64(-x), Float64(y / a), x); elseif (a <= 6e-84) tmp = Float64(-Float64(Float64(t * Float64(y - z)) / z)); else tmp = fma(y, Float64(t / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.8e-42], N[((-x) * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 6e-84], (-N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{-42}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{y}{a}, x\right)\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-84}:\\
\;\;\;\;-\frac{t \cdot \left(y - z\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\end{array}
\end{array}
if a < -2.79999999999999998e-42Initial program 86.7%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6472.0
Applied rewrites72.0%
Taylor expanded in y around inf
Applied rewrites63.7%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6448.3
Applied rewrites48.3%
if -2.79999999999999998e-42 < a < 6.0000000000000002e-84Initial program 72.3%
Taylor expanded in z around inf
Applied rewrites35.3%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6463.0
Applied rewrites63.0%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6443.7
Applied rewrites43.7%
if 6.0000000000000002e-84 < a Initial program 84.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6461.0
Applied rewrites61.0%
Taylor expanded in x around 0
Applied rewrites53.4%
(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 -3e+306)
t_1
(if (<= t_2 -2e-196)
(+ x t)
(if (<= t_2 5e-192) t (if (<= t_2 4e+294) (+ 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 <= -3e+306) {
tmp = t_1;
} else if (t_2 <= -2e-196) {
tmp = x + t;
} else if (t_2 <= 5e-192) {
tmp = t;
} else if (t_2 <= 4e+294) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t * (y / a)
t_2 = x + ((y - z) * ((t - x) / (a - z)))
if (t_2 <= (-3d+306)) then
tmp = t_1
else if (t_2 <= (-2d-196)) then
tmp = x + t
else if (t_2 <= 5d-192) then
tmp = t
else if (t_2 <= 4d+294) then
tmp = x + t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / a);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -3e+306) {
tmp = t_1;
} else if (t_2 <= -2e-196) {
tmp = x + t;
} else if (t_2 <= 5e-192) {
tmp = t;
} else if (t_2 <= 4e+294) {
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 <= -3e+306: tmp = t_1 elif t_2 <= -2e-196: tmp = x + t elif t_2 <= 5e-192: tmp = t elif t_2 <= 4e+294: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / a)) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -3e+306) tmp = t_1; elseif (t_2 <= -2e-196) tmp = Float64(x + t); elseif (t_2 <= 5e-192) tmp = t; elseif (t_2 <= 4e+294) 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 <= -3e+306) tmp = t_1; elseif (t_2 <= -2e-196) tmp = x + t; elseif (t_2 <= 5e-192) tmp = t; elseif (t_2 <= 4e+294) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / a), $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, -3e+306], t$95$1, If[LessEqual[t$95$2, -2e-196], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, 5e-192], t, If[LessEqual[t$95$2, 4e+294], N[(x + t), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -3 \cdot 10^{+306}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-196}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-192}:\\
\;\;\;\;t\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -3.00000000000000021e306 or 4.00000000000000027e294 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 85.4%
Taylor expanded in z around inf
Applied rewrites7.8%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6460.2
Applied rewrites60.2%
Taylor expanded in z around 0
lower-/.f6446.2
Applied rewrites46.2%
if -3.00000000000000021e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.0000000000000001e-196 or 5.0000000000000001e-192 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.00000000000000027e294Initial program 93.8%
Taylor expanded in z around inf
lift--.f6423.6
Applied rewrites23.6%
Taylor expanded in x around 0
Applied rewrites44.5%
if -2.0000000000000001e-196 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000001e-192Initial program 20.9%
Taylor expanded in z around inf
Applied rewrites37.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -4e+146) (/ (* t y) a) (if (<= y 8.5e+186) (+ x t) (/ (* x y) z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4e+146) {
tmp = (t * y) / a;
} else if (y <= 8.5e+186) {
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) :: tmp
if (y <= (-4d+146)) then
tmp = (t * y) / a
else if (y <= 8.5d+186) 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 tmp;
if (y <= -4e+146) {
tmp = (t * y) / a;
} else if (y <= 8.5e+186) {
tmp = x + t;
} else {
tmp = (x * y) / z;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4e+146: tmp = (t * y) / a elif y <= 8.5e+186: tmp = x + t else: tmp = (x * y) / z return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4e+146) tmp = Float64(Float64(t * y) / a); elseif (y <= 8.5e+186) tmp = Float64(x + t); else tmp = Float64(Float64(x * y) / z); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4e+146) tmp = (t * y) / a; elseif (y <= 8.5e+186) tmp = x + t; else tmp = (x * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4e+146], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[y, 8.5e+186], N[(x + t), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+146}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+186}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if y < -3.99999999999999973e146Initial program 91.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6459.0
Applied rewrites59.0%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6429.9
Applied rewrites29.9%
if -3.99999999999999973e146 < y < 8.4999999999999999e186Initial program 76.8%
Taylor expanded in z around inf
lift--.f6422.1
Applied rewrites22.1%
Taylor expanded in x around 0
Applied rewrites39.8%
if 8.4999999999999999e186 < y Initial program 91.6%
Taylor expanded in z around inf
Applied rewrites6.4%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6454.6
Applied rewrites54.6%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f6427.6
Applied rewrites27.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* x y) z))) (if (<= y -3.5e+152) t_1 (if (<= y 8.5e+186) (+ x t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / z;
double tmp;
if (y <= -3.5e+152) {
tmp = t_1;
} else if (y <= 8.5e+186) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) / z
if (y <= (-3.5d+152)) then
tmp = t_1
else if (y <= 8.5d+186) then
tmp = x + t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / z;
double tmp;
if (y <= -3.5e+152) {
tmp = t_1;
} else if (y <= 8.5e+186) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * y) / z tmp = 0 if y <= -3.5e+152: tmp = t_1 elif y <= 8.5e+186: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / z) tmp = 0.0 if (y <= -3.5e+152) tmp = t_1; elseif (y <= 8.5e+186) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x * y) / z; tmp = 0.0; if (y <= -3.5e+152) tmp = t_1; elseif (y <= 8.5e+186) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -3.5e+152], t$95$1, If[LessEqual[y, 8.5e+186], N[(x + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{z}\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+152}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+186}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.49999999999999981e152 or 8.4999999999999999e186 < y Initial program 91.4%
Taylor expanded in z around inf
Applied rewrites7.9%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6453.7
Applied rewrites53.7%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f6427.1
Applied rewrites27.1%
if -3.49999999999999981e152 < y < 8.4999999999999999e186Initial program 76.9%
Taylor expanded in z around inf
lift--.f6422.0
Applied rewrites22.0%
Taylor expanded in x around 0
Applied rewrites39.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -7.2e+130) x (if (<= a 1.05e+93) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.2e+130) {
tmp = x;
} else if (a <= 1.05e+93) {
tmp = t;
} else {
tmp = x;
}
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 <= (-7.2d+130)) then
tmp = x
else if (a <= 1.05d+93) then
tmp = t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.2e+130) {
tmp = x;
} else if (a <= 1.05e+93) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7.2e+130: tmp = x elif a <= 1.05e+93: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.2e+130) tmp = x; elseif (a <= 1.05e+93) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -7.2e+130) tmp = x; elseif (a <= 1.05e+93) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.2e+130], x, If[LessEqual[a, 1.05e+93], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.2 \cdot 10^{+130}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{+93}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -7.2000000000000002e130 or 1.0499999999999999e93 < a Initial program 90.3%
Taylor expanded in a around inf
Applied rewrites53.2%
if -7.2000000000000002e130 < a < 1.0499999999999999e93Initial program 75.4%
Taylor expanded in z around inf
Applied rewrites31.1%
(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 80.1%
Taylor expanded in z around inf
Applied rewrites24.6%
herbie shell --seed 2025110
(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)))))