
(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))
(*
(- x)
(-
(fma (/ (/ (* (- y z) t) x) (- a z)) -1.0 (/ y (- a z)))
(+ (/ z (- a z)) 1.0)))
(if (<= t_1 -5e-248)
t_1
(if (<= t_1 0.0) (fma (/ (* (- t x) (- y a)) z) -1.0 t) t_1)))))
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 = -x * (fma(((((y - z) * t) / x) / (a - z)), -1.0, (y / (a - z))) - ((z / (a - z)) + 1.0));
} else if (t_1 <= -5e-248) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = fma((((t - x) * (y - a)) / z), -1.0, t);
} else {
tmp = t_1;
}
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(-x) * Float64(fma(Float64(Float64(Float64(Float64(y - z) * t) / x) / Float64(a - z)), -1.0, Float64(y / Float64(a - z))) - Float64(Float64(z / Float64(a - z)) + 1.0))); elseif (t_1 <= -5e-248) tmp = t_1; elseif (t_1 <= 0.0) tmp = fma(Float64(Float64(Float64(t - x) * Float64(y - a)) / z), -1.0, t); else tmp = t_1; 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[((-x) * N[(N[(N[(N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * -1.0 + N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-248], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $MachinePrecision], t$95$1]]]]
\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:\\
\;\;\;\;\left(-x\right) \cdot \left(\mathsf{fma}\left(\frac{\frac{\left(y - z\right) \cdot t}{x}}{a - z}, -1, \frac{y}{a - z}\right) - \left(\frac{z}{a - z} + 1\right)\right)\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-248}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}, -1, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 84.7%
Taylor expanded in x around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites86.5%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000001e-248 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.7%
if -5.0000000000000001e-248 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 8.5%
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
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites81.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 -5e-248)
t_1
(if (<= t_1 0.0) (fma (/ (* (- t x) (- y a)) z) -1.0 t) t_1))))
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 <= -5e-248) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = fma((((t - x) * (y - a)) / z), -1.0, t);
} else {
tmp = t_1;
}
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 <= -5e-248) tmp = t_1; elseif (t_1 <= 0.0) tmp = fma(Float64(Float64(Float64(t - x) * Float64(y - a)) / z), -1.0, t); else tmp = t_1; 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, -5e-248], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-248}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}, -1, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000001e-248 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.0%
if -5.0000000000000001e-248 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 8.5%
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
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites81.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-248)
t_2
(if (<= t_3 0.0) (fma (/ (* (- t x) (- y a)) z) -1.0 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-248) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = fma((((t - x) * (y - a)) / z), -1.0, 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-248) tmp = t_2; elseif (t_3 <= 0.0) tmp = fma(Float64(Float64(Float64(t - x) * Float64(y - a)) / z), -1.0, 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-248], t$95$2, If[LessEqual[t$95$3, 0.0], N[(N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * -1.0 + 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^{-248}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}, -1, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000001e-248 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.0%
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--.f6491.0
Applied rewrites91.0%
if -5.0000000000000001e-248 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 8.5%
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
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites81.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ t (- a z)) (- y z) x))
(t_2 (/ (- t x) (- a z)))
(t_3 (+ x (* (- y z) t_2))))
(if (<= t_3 -2e+289)
(/ (* (- t x) y) (- a z))
(if (<= t_3 -5e-248)
t_1
(if (<= t_3 0.0)
(fma (/ (* (- t x) (- y a)) z) -1.0 t)
(if (<= t_3 1e+193) t_1 (+ x (* y t_2))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t / (a - z)), (y - z), x);
double t_2 = (t - x) / (a - z);
double t_3 = x + ((y - z) * t_2);
double tmp;
if (t_3 <= -2e+289) {
tmp = ((t - x) * y) / (a - z);
} else if (t_3 <= -5e-248) {
tmp = t_1;
} else if (t_3 <= 0.0) {
tmp = fma((((t - x) * (y - a)) / z), -1.0, t);
} else if (t_3 <= 1e+193) {
tmp = t_1;
} else {
tmp = x + (y * t_2);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t / Float64(a - z)), Float64(y - z), x) 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 <= -2e+289) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (t_3 <= -5e-248) tmp = t_1; elseif (t_3 <= 0.0) tmp = fma(Float64(Float64(Float64(t - x) * Float64(y - a)) / z), -1.0, t); elseif (t_3 <= 1e+193) tmp = t_1; else tmp = Float64(x + Float64(y * t_2)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $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, -2e+289], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-248], t$95$1, If[LessEqual[t$95$3, 0.0], N[(N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $MachinePrecision], If[LessEqual[t$95$3, 1e+193], t$95$1, N[(x + N[(y * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{a - z}, y - z, x\right)\\
t_2 := \frac{t - x}{a - z}\\
t_3 := x + \left(y - z\right) \cdot t\_2\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+289}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-248}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}, -1, t\right)\\
\mathbf{elif}\;t\_3 \leq 10^{+193}:\\
\;\;\;\;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)))) < -2.0000000000000001e289Initial 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--.f6480.9
Applied rewrites80.9%
if -2.0000000000000001e289 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000001e-248 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e193Initial 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
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6491.5
Applied rewrites91.5%
Taylor expanded in x around 0
Applied rewrites77.3%
if -5.0000000000000001e-248 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 8.5%
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
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites81.3%
if 1.00000000000000007e193 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.8%
Taylor expanded in y around inf
Applied rewrites73.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ t (- a z)) (- y z) x))
(t_2 (/ (- t x) (- a z)))
(t_3 (+ x (* (- y z) t_2))))
(if (<= t_3 -2e+289)
(/ (* (- t x) y) (- a z))
(if (<= t_3 -5e-248)
t_1
(if (<= t_3 0.0)
(fma (/ (* y (- t x)) z) -1.0 t)
(if (<= t_3 1e+193) t_1 (+ x (* y t_2))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t / (a - z)), (y - z), x);
double t_2 = (t - x) / (a - z);
double t_3 = x + ((y - z) * t_2);
double tmp;
if (t_3 <= -2e+289) {
tmp = ((t - x) * y) / (a - z);
} else if (t_3 <= -5e-248) {
tmp = t_1;
} else if (t_3 <= 0.0) {
tmp = fma(((y * (t - x)) / z), -1.0, t);
} else if (t_3 <= 1e+193) {
tmp = t_1;
} else {
tmp = x + (y * t_2);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t / Float64(a - z)), Float64(y - z), x) 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 <= -2e+289) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (t_3 <= -5e-248) tmp = t_1; elseif (t_3 <= 0.0) tmp = fma(Float64(Float64(y * Float64(t - x)) / z), -1.0, t); elseif (t_3 <= 1e+193) tmp = t_1; else tmp = Float64(x + Float64(y * t_2)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $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, -2e+289], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-248], t$95$1, If[LessEqual[t$95$3, 0.0], N[(N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $MachinePrecision], If[LessEqual[t$95$3, 1e+193], t$95$1, N[(x + N[(y * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{a - z}, y - z, x\right)\\
t_2 := \frac{t - x}{a - z}\\
t_3 := x + \left(y - z\right) \cdot t\_2\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+289}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-248}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{y \cdot \left(t - x\right)}{z}, -1, t\right)\\
\mathbf{elif}\;t\_3 \leq 10^{+193}:\\
\;\;\;\;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)))) < -2.0000000000000001e289Initial 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--.f6480.9
Applied rewrites80.9%
if -2.0000000000000001e289 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000001e-248 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e193Initial 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
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6491.5
Applied rewrites91.5%
Taylor expanded in x around 0
Applied rewrites77.3%
if -5.0000000000000001e-248 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 8.5%
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
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites81.3%
Taylor expanded in y around inf
lower-*.f64N/A
lift--.f6459.4
Applied rewrites59.4%
if 1.00000000000000007e193 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.8%
Taylor expanded in y around inf
Applied rewrites73.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.48e-8)
(fma (- t x) (/ (- y z) a) x)
(if (<= a 3.7e-174)
(fma (/ (* y (- t x)) z) -1.0 t)
(fma (/ t (- a z)) (- y z) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.48e-8) {
tmp = fma((t - x), ((y - z) / a), x);
} else if (a <= 3.7e-174) {
tmp = fma(((y * (t - x)) / z), -1.0, t);
} else {
tmp = fma((t / (a - z)), (y - z), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.48e-8) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); elseif (a <= 3.7e-174) tmp = fma(Float64(Float64(y * Float64(t - x)) / z), -1.0, t); else tmp = fma(Float64(t / Float64(a - z)), Float64(y - z), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.48e-8], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 3.7e-174], N[(N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $MachinePrecision], N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.48 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{elif}\;a \leq 3.7 \cdot 10^{-174}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y \cdot \left(t - x\right)}{z}, -1, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a - z}, y - z, x\right)\\
\end{array}
\end{array}
if a < -1.48e-8Initial program 87.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6474.7
Applied rewrites74.7%
if -1.48e-8 < a < 3.7000000000000001e-174Initial program 72.0%
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
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.4%
Taylor expanded in y around inf
lower-*.f64N/A
lift--.f6473.2
Applied rewrites73.2%
if 3.7000000000000001e-174 < a Initial program 83.4%
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--.f6483.5
Applied rewrites83.5%
Taylor expanded in x around 0
Applied rewrites69.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- y z) a) x)))
(if (<= a -1.48e-8)
t_1
(if (<= a 1.7e-83) (fma (/ (* y (- t x)) z) -1.0 t) 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.48e-8) {
tmp = t_1;
} else if (a <= 1.7e-83) {
tmp = fma(((y * (t - x)) / z), -1.0, t);
} 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.48e-8) tmp = t_1; elseif (a <= 1.7e-83) tmp = fma(Float64(Float64(y * Float64(t - x)) / z), -1.0, t); 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.48e-8], t$95$1, If[LessEqual[a, 1.7e-83], N[(N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $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.48 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-83}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y \cdot \left(t - x\right)}{z}, -1, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.48e-8 or 1.6999999999999999e-83 < a Initial program 86.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6471.3
Applied rewrites71.3%
if -1.48e-8 < a < 1.6999999999999999e-83Initial program 72.3%
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
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites75.3%
Taylor expanded in y around inf
lower-*.f64N/A
lift--.f6471.6
Applied rewrites71.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- y z) a) x)))
(if (<= a -1.06e-16)
t_1
(if (<= a -1.18e-231)
(* y (/ (- t x) (- a z)))
(if (<= a 1.65e-74) (* 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.06e-16) {
tmp = t_1;
} else if (a <= -1.18e-231) {
tmp = y * ((t - x) / (a - z));
} else if (a <= 1.65e-74) {
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.06e-16) tmp = t_1; elseif (a <= -1.18e-231) tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z))); elseif (a <= 1.65e-74) 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.06e-16], t$95$1, If[LessEqual[a, -1.18e-231], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.65e-74], 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.06 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.18 \cdot 10^{-231}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{-74}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.06e-16 or 1.64999999999999998e-74 < a Initial program 86.6%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6471.5
Applied rewrites71.5%
if -1.06e-16 < a < -1.18000000000000003e-231Initial program 73.3%
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--.f6473.3
Applied rewrites73.3%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6453.6
Applied rewrites53.6%
if -1.18000000000000003e-231 < a < 1.64999999999999998e-74Initial program 71.4%
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--.f6471.3
Applied rewrites71.3%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6463.3
Applied rewrites63.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- t x) a) x)))
(if (<= a -2.75e+50)
t_1
(if (<= a -1.18e-231)
(* y (/ (- t x) (- a z)))
(if (<= a 1.75e-74) (* t (/ (- y z) (- a 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 <= -2.75e+50) {
tmp = t_1;
} else if (a <= -1.18e-231) {
tmp = y * ((t - x) / (a - z));
} else if (a <= 1.75e-74) {
tmp = t * ((y - z) / (a - 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 <= -2.75e+50) tmp = t_1; elseif (a <= -1.18e-231) tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z))); elseif (a <= 1.75e-74) 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[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.75e+50], t$95$1, If[LessEqual[a, -1.18e-231], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.75e-74], 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(y, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -2.75 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.18 \cdot 10^{-231}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{-74}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.7499999999999999e50 or 1.75000000000000007e-74 < a Initial program 87.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6464.3
Applied rewrites64.3%
if -2.7499999999999999e50 < a < -1.18000000000000003e-231Initial program 75.0%
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--.f6475.0
Applied rewrites75.0%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6450.8
Applied rewrites50.8%
if -1.18000000000000003e-231 < a < 1.75000000000000007e-74Initial program 71.4%
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--.f6471.3
Applied rewrites71.3%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6463.3
Applied rewrites63.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- t x) a) x)))
(if (<= a -2.75e+50)
t_1
(if (<= a -1.18e-231)
(/ (* (- t x) y) (- a z))
(if (<= a 1.75e-74) (* t (/ (- y z) (- a 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 <= -2.75e+50) {
tmp = t_1;
} else if (a <= -1.18e-231) {
tmp = ((t - x) * y) / (a - z);
} else if (a <= 1.75e-74) {
tmp = t * ((y - z) / (a - 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 <= -2.75e+50) tmp = t_1; elseif (a <= -1.18e-231) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (a <= 1.75e-74) 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[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.75e+50], t$95$1, If[LessEqual[a, -1.18e-231], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.75e-74], 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(y, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -2.75 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.18 \cdot 10^{-231}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{-74}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.7499999999999999e50 or 1.75000000000000007e-74 < a Initial program 87.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6464.3
Applied rewrites64.3%
if -2.7499999999999999e50 < a < -1.18000000000000003e-231Initial program 75.0%
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--.f6449.7
Applied rewrites49.7%
if -1.18000000000000003e-231 < a < 1.75000000000000007e-74Initial program 71.4%
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--.f6471.3
Applied rewrites71.3%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6463.3
Applied rewrites63.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- t x) a) x)))
(if (<= a -2.75e+50)
t_1
(if (<= a -8e-213)
(/ (* (- t x) y) (- a z))
(if (<= a 1.65e-74) (/ (* (- y z) t) (- a 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 <= -2.75e+50) {
tmp = t_1;
} else if (a <= -8e-213) {
tmp = ((t - x) * y) / (a - z);
} else if (a <= 1.65e-74) {
tmp = ((y - z) * t) / (a - 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 <= -2.75e+50) tmp = t_1; elseif (a <= -8e-213) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (a <= 1.65e-74) 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[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.75e+50], t$95$1, If[LessEqual[a, -8e-213], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.65e-74], 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(y, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -2.75 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -8 \cdot 10^{-213}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{-74}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.7499999999999999e50 or 1.64999999999999998e-74 < a Initial program 87.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6464.3
Applied rewrites64.3%
if -2.7499999999999999e50 < a < -7.9999999999999996e-213Initial program 75.4%
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--.f6448.6
Applied rewrites48.6%
if -7.9999999999999996e-213 < a < 1.64999999999999998e-74Initial program 71.2%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- t x) a) x)))
(if (<= a -2.75e+50)
t_1
(if (<= a 3.1e-232)
(/ (* (- t x) y) (- a z))
(if (<= a 1.65e-74) (+ t (/ (* a (- t x)) 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 <= -2.75e+50) {
tmp = t_1;
} else if (a <= 3.1e-232) {
tmp = ((t - x) * y) / (a - z);
} else if (a <= 1.65e-74) {
tmp = t + ((a * (t - x)) / 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 <= -2.75e+50) tmp = t_1; elseif (a <= 3.1e-232) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (a <= 1.65e-74) tmp = Float64(t + Float64(Float64(a * Float64(t - x)) / 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, -2.75e+50], t$95$1, If[LessEqual[a, 3.1e-232], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.65e-74], N[(t + N[(N[(a * N[(t - x), $MachinePrecision]), $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 -2.75 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.1 \cdot 10^{-232}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{-74}:\\
\;\;\;\;t + \frac{a \cdot \left(t - x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.7499999999999999e50 or 1.64999999999999998e-74 < a Initial program 87.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6464.3
Applied rewrites64.3%
if -2.7499999999999999e50 < a < 3.0999999999999999e-232Initial program 73.4%
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--.f6452.0
Applied rewrites52.0%
if 3.0999999999999999e-232 < a < 1.64999999999999998e-74Initial program 72.4%
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
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites73.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6441.3
Applied rewrites41.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ t (/ (* a (- t x)) z))))
(if (<= z -1.2e+16)
t_1
(if (<= z 2.15e+18)
(fma y (/ (- t x) a) x)
(if (<= z 3.5e+78) (* (* -1.0 (/ y (- a z))) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t + ((a * (t - x)) / z);
double tmp;
if (z <= -1.2e+16) {
tmp = t_1;
} else if (z <= 2.15e+18) {
tmp = fma(y, ((t - x) / a), x);
} else if (z <= 3.5e+78) {
tmp = (-1.0 * (y / (a - z))) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t + Float64(Float64(a * Float64(t - x)) / z)) tmp = 0.0 if (z <= -1.2e+16) tmp = t_1; elseif (z <= 2.15e+18) tmp = fma(y, Float64(Float64(t - x) / a), x); elseif (z <= 3.5e+78) tmp = Float64(Float64(-1.0 * Float64(y / Float64(a - z))) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(N[(a * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+16], t$95$1, If[LessEqual[z, 2.15e+18], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 3.5e+78], N[(N[(-1.0 * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \frac{a \cdot \left(t - x\right)}{z}\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+78}:\\
\;\;\;\;\left(-1 \cdot \frac{y}{a - z}\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.2e16 or 3.5000000000000001e78 < z Initial program 66.2%
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
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites62.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6449.1
Applied rewrites49.1%
if -1.2e16 < z < 2.15e18Initial program 90.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6471.4
Applied rewrites71.4%
if 2.15e18 < z < 3.5000000000000001e78Initial program 86.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.4
Applied rewrites43.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lift--.f6420.3
Applied rewrites20.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ t (/ (* a (- t x)) z)))) (if (<= z -1.2e+16) t_1 (if (<= z 3.5e+78) (fma y (/ (- t x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t + ((a * (t - x)) / z);
double tmp;
if (z <= -1.2e+16) {
tmp = t_1;
} else if (z <= 3.5e+78) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t + Float64(Float64(a * Float64(t - x)) / z)) tmp = 0.0 if (z <= -1.2e+16) tmp = t_1; elseif (z <= 3.5e+78) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(N[(a * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+16], t$95$1, If[LessEqual[z, 3.5e+78], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \frac{a \cdot \left(t - x\right)}{z}\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+78}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.2e16 or 3.5000000000000001e78 < z Initial program 66.2%
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
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites62.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6449.1
Applied rewrites49.1%
if -1.2e16 < z < 3.5000000000000001e78Initial program 90.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6469.0
Applied rewrites69.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -2e+16) t (if (<= z 4.2e+78) (fma y (/ (- t x) a) x) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+16) {
tmp = t;
} else if (z <= 4.2e+78) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+16) tmp = t; elseif (z <= 4.2e+78) 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, -2e+16], t, If[LessEqual[z, 4.2e+78], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+16}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+78}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -2e16 or 4.2000000000000002e78 < z Initial program 66.2%
Taylor expanded in z around inf
Applied rewrites46.8%
if -2e16 < z < 4.2000000000000002e78Initial program 90.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6469.0
Applied rewrites69.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.2e+16)
t
(if (<= z 2.05e+18)
(fma (/ t a) y x)
(if (<= z 2.4e+97) (* (/ (- y a) z) x) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e+16) {
tmp = t;
} else if (z <= 2.05e+18) {
tmp = fma((t / a), y, x);
} else if (z <= 2.4e+97) {
tmp = ((y - a) / z) * x;
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.2e+16) tmp = t; elseif (z <= 2.05e+18) tmp = fma(Float64(t / a), y, x); elseif (z <= 2.4e+97) tmp = Float64(Float64(Float64(y - a) / z) * x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.2e+16], t, If[LessEqual[z, 2.05e+18], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 2.4e+97], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+16}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+97}:\\
\;\;\;\;\frac{y - a}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.2e16 or 2.4e97 < z Initial program 65.7%
Taylor expanded in z around inf
Applied rewrites47.5%
if -1.2e16 < z < 2.05e18Initial program 90.9%
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--.f6491.0
Applied rewrites91.0%
Taylor expanded in x around 0
Applied rewrites71.1%
Taylor expanded in y around inf
Applied rewrites64.0%
Taylor expanded in z around 0
Applied rewrites58.8%
if 2.05e18 < z < 2.4e97Initial program 85.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6442.4
Applied rewrites42.4%
Taylor expanded in z around -inf
lower-/.f64N/A
lower--.f6422.4
Applied rewrites22.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.2e+16)
t
(if (<= z 2.05e+18)
(fma (/ t a) y x)
(if (<= z 2.4e+97) (/ (* x (- y a)) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e+16) {
tmp = t;
} else if (z <= 2.05e+18) {
tmp = fma((t / a), y, x);
} else if (z <= 2.4e+97) {
tmp = (x * (y - a)) / z;
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.2e+16) tmp = t; elseif (z <= 2.05e+18) tmp = fma(Float64(t / a), y, x); elseif (z <= 2.4e+97) 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.2e+16], t, If[LessEqual[z, 2.05e+18], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 2.4e+97], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+16}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+97}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.2e16 or 2.4e97 < z Initial program 65.7%
Taylor expanded in z around inf
Applied rewrites47.5%
if -1.2e16 < z < 2.05e18Initial program 90.9%
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--.f6491.0
Applied rewrites91.0%
Taylor expanded in x around 0
Applied rewrites71.1%
Taylor expanded in y around inf
Applied rewrites64.0%
Taylor expanded in z around 0
Applied rewrites58.8%
if 2.05e18 < z < 2.4e97Initial program 85.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6442.4
Applied rewrites42.4%
Taylor expanded in z around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.0
Applied rewrites21.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.2e+16)
t
(if (<= z 2.05e+18)
(fma (/ t a) y x)
(if (<= z 1.26e+79) (* (/ y z) x) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e+16) {
tmp = t;
} else if (z <= 2.05e+18) {
tmp = fma((t / a), y, x);
} else if (z <= 1.26e+79) {
tmp = (y / z) * x;
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.2e+16) tmp = t; elseif (z <= 2.05e+18) tmp = fma(Float64(t / a), y, x); elseif (z <= 1.26e+79) tmp = Float64(Float64(y / z) * x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.2e+16], t, If[LessEqual[z, 2.05e+18], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 1.26e+79], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+16}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\mathbf{elif}\;z \leq 1.26 \cdot 10^{+79}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.2e16 or 1.26e79 < z Initial program 66.2%
Taylor expanded in z around inf
Applied rewrites46.9%
if -1.2e16 < z < 2.05e18Initial program 90.9%
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--.f6491.0
Applied rewrites91.0%
Taylor expanded in x around 0
Applied rewrites71.1%
Taylor expanded in y around inf
Applied rewrites64.0%
Taylor expanded in z around 0
Applied rewrites58.8%
if 2.05e18 < z < 1.26e79Initial program 87.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6443.6
Applied rewrites43.6%
Taylor expanded in a around 0
lower-/.f6416.7
Applied rewrites16.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.75e+50) x (if (<= a -7.5e-213) (* (/ y z) x) (if (<= a 1.75e-74) t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.75e+50) {
tmp = x;
} else if (a <= -7.5e-213) {
tmp = (y / z) * x;
} else if (a <= 1.75e-74) {
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 <= (-2.75d+50)) then
tmp = x
else if (a <= (-7.5d-213)) then
tmp = (y / z) * x
else if (a <= 1.75d-74) 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 <= -2.75e+50) {
tmp = x;
} else if (a <= -7.5e-213) {
tmp = (y / z) * x;
} else if (a <= 1.75e-74) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.75e+50: tmp = x elif a <= -7.5e-213: tmp = (y / z) * x elif a <= 1.75e-74: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.75e+50) tmp = x; elseif (a <= -7.5e-213) tmp = Float64(Float64(y / z) * x); elseif (a <= 1.75e-74) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.75e+50) tmp = x; elseif (a <= -7.5e-213) tmp = (y / z) * x; elseif (a <= 1.75e-74) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.75e+50], x, If[LessEqual[a, -7.5e-213], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[a, 1.75e-74], t, x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.75 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -7.5 \cdot 10^{-213}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{-74}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.7499999999999999e50 or 1.75000000000000007e-74 < a Initial program 87.3%
Taylor expanded in a around inf
Applied rewrites40.4%
if -2.7499999999999999e50 < a < -7.5000000000000006e-213Initial program 75.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6434.8
Applied rewrites34.8%
Taylor expanded in a around 0
lower-/.f6422.2
Applied rewrites22.2%
if -7.5000000000000006e-213 < a < 1.75000000000000007e-74Initial program 71.2%
Taylor expanded in z around inf
Applied rewrites36.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.45e+50) x (if (<= a -1.18e-231) (/ (* x y) z) (if (<= a 1.75e-74) t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.45e+50) {
tmp = x;
} else if (a <= -1.18e-231) {
tmp = (x * y) / z;
} else if (a <= 1.75e-74) {
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 <= (-2.45d+50)) then
tmp = x
else if (a <= (-1.18d-231)) then
tmp = (x * y) / z
else if (a <= 1.75d-74) 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 <= -2.45e+50) {
tmp = x;
} else if (a <= -1.18e-231) {
tmp = (x * y) / z;
} else if (a <= 1.75e-74) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.45e+50: tmp = x elif a <= -1.18e-231: tmp = (x * y) / z elif a <= 1.75e-74: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.45e+50) tmp = x; elseif (a <= -1.18e-231) tmp = Float64(Float64(x * y) / z); elseif (a <= 1.75e-74) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.45e+50) tmp = x; elseif (a <= -1.18e-231) tmp = (x * y) / z; elseif (a <= 1.75e-74) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.45e+50], x, If[LessEqual[a, -1.18e-231], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 1.75e-74], t, x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.45 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.18 \cdot 10^{-231}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{-74}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.4500000000000001e50 or 1.75000000000000007e-74 < a Initial program 87.3%
Taylor expanded in a around inf
Applied rewrites40.4%
if -2.4500000000000001e50 < a < -1.18000000000000003e-231Initial program 75.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6434.5
Applied rewrites34.5%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f6420.2
Applied rewrites20.2%
if -1.18000000000000003e-231 < a < 1.75000000000000007e-74Initial program 71.4%
Taylor expanded in z around inf
Applied rewrites36.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.9e-15) x (if (<= a 1.75e-74) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.9e-15) {
tmp = x;
} else if (a <= 1.75e-74) {
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 <= (-4.9d-15)) then
tmp = x
else if (a <= 1.75d-74) 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 <= -4.9e-15) {
tmp = x;
} else if (a <= 1.75e-74) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.9e-15: tmp = x elif a <= 1.75e-74: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.9e-15) tmp = x; elseif (a <= 1.75e-74) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.9e-15) tmp = x; elseif (a <= 1.75e-74) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.9e-15], x, If[LessEqual[a, 1.75e-74], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.9 \cdot 10^{-15}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{-74}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.8999999999999999e-15 or 1.75000000000000007e-74 < a Initial program 86.6%
Taylor expanded in a around inf
Applied rewrites38.7%
if -4.8999999999999999e-15 < a < 1.75000000000000007e-74Initial program 72.1%
Taylor expanded in z around inf
Applied rewrites35.0%
(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.4%
Taylor expanded in z around inf
Applied rewrites25.2%
herbie shell --seed 2025101
(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)))))