
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
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, b)
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), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
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, b)
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), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (fma (/ (- t a) t_1) z (* (/ x t_1) y)))
(t_3 (* z (- t a)))
(t_4 (/ (+ (* x y) t_3) (+ y (* z (- b y))))))
(if (<= t_4 -4e+280)
t_2
(if (<= t_4 -4e-299)
(/ (fma x y t_3) (fma z (- b y) y))
(if (<= t_4 0.0)
(-
(fma
-1.0
(/
(-
(* -1.0 (/ (* x y) (- b y)))
(* -1.0 (/ (* y (- t a)) (pow (- b y) 2.0))))
z)
(/ t (- b y)))
(/ a (- b y)))
(if (<= t_4 5e+282)
(/ (fma (- t a) z (* y x)) t_1)
(if (<= t_4 INFINITY) t_2 (/ (- t a) (- b y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((b - y), z, y);
double t_2 = fma(((t - a) / t_1), z, ((x / t_1) * y));
double t_3 = z * (t - a);
double t_4 = ((x * y) + t_3) / (y + (z * (b - y)));
double tmp;
if (t_4 <= -4e+280) {
tmp = t_2;
} else if (t_4 <= -4e-299) {
tmp = fma(x, y, t_3) / fma(z, (b - y), y);
} else if (t_4 <= 0.0) {
tmp = fma(-1.0, (((-1.0 * ((x * y) / (b - y))) - (-1.0 * ((y * (t - a)) / pow((b - y), 2.0)))) / z), (t / (b - y))) - (a / (b - y));
} else if (t_4 <= 5e+282) {
tmp = fma((t - a), z, (y * x)) / t_1;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = fma(Float64(Float64(t - a) / t_1), z, Float64(Float64(x / t_1) * y)) t_3 = Float64(z * Float64(t - a)) t_4 = Float64(Float64(Float64(x * y) + t_3) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if (t_4 <= -4e+280) tmp = t_2; elseif (t_4 <= -4e-299) tmp = Float64(fma(x, y, t_3) / fma(z, Float64(b - y), y)); elseif (t_4 <= 0.0) tmp = Float64(fma(-1.0, Float64(Float64(Float64(-1.0 * Float64(Float64(x * y) / Float64(b - y))) - Float64(-1.0 * Float64(Float64(y * Float64(t - a)) / (Float64(b - y) ^ 2.0)))) / z), Float64(t / Float64(b - y))) - Float64(a / Float64(b - y))); elseif (t_4 <= 5e+282) tmp = Float64(fma(Float64(t - a), z, Float64(y * x)) / t_1); elseif (t_4 <= Inf) tmp = t_2; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision] * z + N[(N[(x / t$95$1), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + t$95$3), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -4e+280], t$95$2, If[LessEqual[t$95$4, -4e-299], N[(N[(x * y + t$95$3), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 0.0], N[(N[(-1.0 * N[(N[(N[(-1.0 * N[(N[(x * y), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-1.0 * N[(N[(y * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 5e+282], N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$2, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \mathsf{fma}\left(\frac{t - a}{t\_1}, z, \frac{x}{t\_1} \cdot y\right)\\
t_3 := z \cdot \left(t - a\right)\\
t_4 := \frac{x \cdot y + t\_3}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t\_4 \leq -4 \cdot 10^{+280}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq -4 \cdot 10^{-299}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t\_3\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z}, \frac{t}{b - y}\right) - \frac{a}{b - y}\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+282}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{t\_1}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.0000000000000001e280 or 4.99999999999999978e282 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 67.4%
lift-/.f64N/A
mult-flipN/A
associate-*r/N/A
*-rgt-identityN/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
Applied rewrites70.8%
if -4.0000000000000001e280 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -3.99999999999999997e-299Initial program 67.4%
lift-/.f64N/A
mult-flipN/A
associate-*r/N/A
*-rgt-identityN/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
Applied rewrites70.8%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
Applied rewrites67.4%
if -3.99999999999999997e-299 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 67.4%
Taylor expanded in z around -inf
lower--.f64N/A
Applied rewrites47.4%
if 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.99999999999999978e282Initial program 67.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6467.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.4
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
remove-double-negN/A
lower-fma.f6467.4
Applied rewrites67.4%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y)))
(t_2 (fma (- b y) z y))
(t_3 (fma (/ (- t a) t_2) z (* (/ x t_2) y)))
(t_4 (* z (- t a)))
(t_5 (/ (+ (* x y) t_4) (+ y (* z (- b y))))))
(if (<= t_5 -4e+280)
t_3
(if (<= t_5 -4e-299)
(/ (fma x y t_4) (fma z (- b y) y))
(if (<= t_5 0.0)
t_1
(if (<= t_5 5e+282)
(/ (fma (- t a) z (* y x)) t_2)
(if (<= t_5 INFINITY) t_3 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double t_2 = fma((b - y), z, y);
double t_3 = fma(((t - a) / t_2), z, ((x / t_2) * y));
double t_4 = z * (t - a);
double t_5 = ((x * y) + t_4) / (y + (z * (b - y)));
double tmp;
if (t_5 <= -4e+280) {
tmp = t_3;
} else if (t_5 <= -4e-299) {
tmp = fma(x, y, t_4) / fma(z, (b - y), y);
} else if (t_5 <= 0.0) {
tmp = t_1;
} else if (t_5 <= 5e+282) {
tmp = fma((t - a), z, (y * x)) / t_2;
} else if (t_5 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = fma(Float64(b - y), z, y) t_3 = fma(Float64(Float64(t - a) / t_2), z, Float64(Float64(x / t_2) * y)) t_4 = Float64(z * Float64(t - a)) t_5 = Float64(Float64(Float64(x * y) + t_4) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if (t_5 <= -4e+280) tmp = t_3; elseif (t_5 <= -4e-299) tmp = Float64(fma(x, y, t_4) / fma(z, Float64(b - y), y)); elseif (t_5 <= 0.0) tmp = t_1; elseif (t_5 <= 5e+282) tmp = Float64(fma(Float64(t - a), z, Float64(y * x)) / t_2); elseif (t_5 <= Inf) tmp = t_3; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision] * z + N[(N[(x / t$95$2), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x * y), $MachinePrecision] + t$95$4), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -4e+280], t$95$3, If[LessEqual[t$95$5, -4e-299], N[(N[(x * y + t$95$4), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 0.0], t$95$1, If[LessEqual[t$95$5, 5e+282], N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$5, Infinity], t$95$3, t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := \mathsf{fma}\left(b - y, z, y\right)\\
t_3 := \mathsf{fma}\left(\frac{t - a}{t\_2}, z, \frac{x}{t\_2} \cdot y\right)\\
t_4 := z \cdot \left(t - a\right)\\
t_5 := \frac{x \cdot y + t\_4}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t\_5 \leq -4 \cdot 10^{+280}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_5 \leq -4 \cdot 10^{-299}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t\_4\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{elif}\;t\_5 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_5 \leq 5 \cdot 10^{+282}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{t\_2}\\
\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.0000000000000001e280 or 4.99999999999999978e282 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 67.4%
lift-/.f64N/A
mult-flipN/A
associate-*r/N/A
*-rgt-identityN/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
Applied rewrites70.8%
if -4.0000000000000001e280 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -3.99999999999999997e-299Initial program 67.4%
lift-/.f64N/A
mult-flipN/A
associate-*r/N/A
*-rgt-identityN/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
Applied rewrites70.8%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
Applied rewrites67.4%
if -3.99999999999999997e-299 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.99999999999999978e282Initial program 67.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6467.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.4
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
remove-double-negN/A
lower-fma.f6467.4
Applied rewrites67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y)))
(t_2 (fma (- b y) z y))
(t_3 (* z (- t a)))
(t_4 (/ (+ (* x y) t_3) (+ y (* z (- b y))))))
(if (<= t_4 (- INFINITY))
(fma (/ (- t a) t_2) z (* (/ x y) y))
(if (<= t_4 -4e-299)
(/ (fma x y t_3) (fma z (- b y) y))
(if (<= t_4 0.0)
t_1
(if (<= t_4 2e+267) (/ (fma (- t a) z (* y x)) t_2) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double t_2 = fma((b - y), z, y);
double t_3 = z * (t - a);
double t_4 = ((x * y) + t_3) / (y + (z * (b - y)));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = fma(((t - a) / t_2), z, ((x / y) * y));
} else if (t_4 <= -4e-299) {
tmp = fma(x, y, t_3) / fma(z, (b - y), y);
} else if (t_4 <= 0.0) {
tmp = t_1;
} else if (t_4 <= 2e+267) {
tmp = fma((t - a), z, (y * x)) / t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = fma(Float64(b - y), z, y) t_3 = Float64(z * Float64(t - a)) t_4 = Float64(Float64(Float64(x * y) + t_3) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = fma(Float64(Float64(t - a) / t_2), z, Float64(Float64(x / y) * y)); elseif (t_4 <= -4e-299) tmp = Float64(fma(x, y, t_3) / fma(z, Float64(b - y), y)); elseif (t_4 <= 0.0) tmp = t_1; elseif (t_4 <= 2e+267) tmp = Float64(fma(Float64(t - a), z, Float64(y * x)) / t_2); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + t$95$3), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[(N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision] * z + N[(N[(x / y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, -4e-299], N[(N[(x * y + t$95$3), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 0.0], t$95$1, If[LessEqual[t$95$4, 2e+267], N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := \mathsf{fma}\left(b - y, z, y\right)\\
t_3 := z \cdot \left(t - a\right)\\
t_4 := \frac{x \cdot y + t\_3}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - a}{t\_2}, z, \frac{x}{y} \cdot y\right)\\
\mathbf{elif}\;t\_4 \leq -4 \cdot 10^{-299}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t\_3\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+267}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 67.4%
lift-/.f64N/A
mult-flipN/A
associate-*r/N/A
*-rgt-identityN/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
Applied rewrites70.8%
Taylor expanded in z around 0
lower-/.f6451.4
Applied rewrites51.4%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -3.99999999999999997e-299Initial program 67.4%
lift-/.f64N/A
mult-flipN/A
associate-*r/N/A
*-rgt-identityN/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
Applied rewrites70.8%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
Applied rewrites67.4%
if -3.99999999999999997e-299 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or 1.9999999999999999e267 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.9999999999999999e267Initial program 67.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6467.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.4
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
remove-double-negN/A
lower-fma.f6467.4
Applied rewrites67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -5.7e+82)
t_1
(if (<= z 3.7e-174)
(* x (* (fma (/ z x) (- t a) y) (/ 1.0 (fma z (- b y) y))))
(if (<= z 2.8e+75)
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))
t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -5.7e+82) {
tmp = t_1;
} else if (z <= 3.7e-174) {
tmp = x * (fma((z / x), (t - a), y) * (1.0 / fma(z, (b - y), y)));
} else if (z <= 2.8e+75) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -5.7e+82) tmp = t_1; elseif (z <= 3.7e-174) tmp = Float64(x * Float64(fma(Float64(z / x), Float64(t - a), y) * Float64(1.0 / fma(z, Float64(b - y), y)))); elseif (z <= 2.8e+75) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.7e+82], t$95$1, If[LessEqual[z, 3.7e-174], N[(x * N[(N[(N[(z / x), $MachinePrecision] * N[(t - a), $MachinePrecision] + y), $MachinePrecision] * N[(1.0 / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+75], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -5.7 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-174}:\\
\;\;\;\;x \cdot \left(\mathsf{fma}\left(\frac{z}{x}, t - a, y\right) \cdot \frac{1}{\mathsf{fma}\left(z, b - y, y\right)}\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+75}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.70000000000000016e82 or 2.80000000000000012e75 < z Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if -5.70000000000000016e82 < z < 3.7000000000000001e-174Initial program 67.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6466.2
Applied rewrites66.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
div-add-revN/A
mult-flipN/A
lower-*.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6465.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6465.0
Applied rewrites65.0%
if 3.7000000000000001e-174 < z < 2.80000000000000012e75Initial program 67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -8e+58)
t_1
(if (<= z 2.8e+75) (/ (fma y x (* (- t a) z)) (+ y (* z (- b y)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -8e+58) {
tmp = t_1;
} else if (z <= 2.8e+75) {
tmp = fma(y, x, ((t - a) * z)) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -8e+58) tmp = t_1; elseif (z <= 2.8e+75) tmp = Float64(fma(y, x, Float64(Float64(t - a) * z)) / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+58], t$95$1, If[LessEqual[z, 2.8e+75], N[(N[(y * x + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -8 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+75}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.99999999999999955e58 or 2.80000000000000012e75 < z Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if -7.99999999999999955e58 < z < 2.80000000000000012e75Initial program 67.4%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6467.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.4
Applied rewrites67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -8e+58)
t_1
(if (<= z 2.8e+75)
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -8e+58) {
tmp = t_1;
} else if (z <= 2.8e+75) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
} 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, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-8d+58)) then
tmp = t_1
else if (z <= 2.8d+75) then
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
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 b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -8e+58) {
tmp = t_1;
} else if (z <= 2.8e+75) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -8e+58: tmp = t_1 elif z <= 2.8e+75: tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -8e+58) tmp = t_1; elseif (z <= 2.8e+75) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -8e+58) tmp = t_1; elseif (z <= 2.8e+75) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+58], t$95$1, If[LessEqual[z, 2.8e+75], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -8 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+75}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.99999999999999955e58 or 2.80000000000000012e75 < z Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if -7.99999999999999955e58 < z < 2.80000000000000012e75Initial program 67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -8e+58)
t_1
(if (<= z 2.8e+75) (/ (fma (- t a) z (* y x)) (fma (- b y) z y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -8e+58) {
tmp = t_1;
} else if (z <= 2.8e+75) {
tmp = fma((t - a), z, (y * x)) / fma((b - y), z, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -8e+58) tmp = t_1; elseif (z <= 2.8e+75) tmp = Float64(fma(Float64(t - a), z, Float64(y * x)) / fma(Float64(b - y), z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+58], t$95$1, If[LessEqual[z, 2.8e+75], N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -8 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+75}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.99999999999999955e58 or 2.80000000000000012e75 < z Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if -7.99999999999999955e58 < z < 2.80000000000000012e75Initial program 67.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6467.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.4
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
remove-double-negN/A
lower-fma.f6467.4
Applied rewrites67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -8e+58)
t_1
(if (<= z 2.8e+75) (/ (fma x y (* z (- t a))) (fma z (- b y) y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -8e+58) {
tmp = t_1;
} else if (z <= 2.8e+75) {
tmp = fma(x, y, (z * (t - a))) / fma(z, (b - y), y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -8e+58) tmp = t_1; elseif (z <= 2.8e+75) tmp = Float64(fma(x, y, Float64(z * Float64(t - a))) / fma(z, Float64(b - y), y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+58], t$95$1, If[LessEqual[z, 2.8e+75], N[(N[(x * y + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -8 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+75}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.99999999999999955e58 or 2.80000000000000012e75 < z Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if -7.99999999999999955e58 < z < 2.80000000000000012e75Initial program 67.4%
lift-/.f64N/A
mult-flipN/A
associate-*r/N/A
*-rgt-identityN/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
Applied rewrites70.8%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
Applied rewrites67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -6.1e+41)
t_1
(if (<= z 2.45e-10) (/ (fma y x (* (- t a) z)) (+ y (* z b))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -6.1e+41) {
tmp = t_1;
} else if (z <= 2.45e-10) {
tmp = fma(y, x, ((t - a) * z)) / (y + (z * b));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -6.1e+41) tmp = t_1; elseif (z <= 2.45e-10) tmp = Float64(fma(y, x, Float64(Float64(t - a) * z)) / Float64(y + Float64(z * b))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.1e+41], t$95$1, If[LessEqual[z, 2.45e-10], N[(N[(y * x + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -6.1 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-10}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{y + z \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.09999999999999998e41 or 2.4499999999999998e-10 < z Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if -6.09999999999999998e41 < z < 2.4499999999999998e-10Initial program 67.4%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6467.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.4
Applied rewrites67.4%
Taylor expanded in y around 0
Applied rewrites58.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -6.1e+41)
t_1
(if (<= z 2.45e-10) (/ (fma x y (* z (- t a))) (fma z b y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -6.1e+41) {
tmp = t_1;
} else if (z <= 2.45e-10) {
tmp = fma(x, y, (z * (t - a))) / fma(z, b, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -6.1e+41) tmp = t_1; elseif (z <= 2.45e-10) tmp = Float64(fma(x, y, Float64(z * Float64(t - a))) / fma(z, b, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.1e+41], t$95$1, If[LessEqual[z, 2.45e-10], N[(N[(x * y + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * b + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -6.1 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-10}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.09999999999999998e41 or 2.4499999999999998e-10 < z Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if -6.09999999999999998e41 < z < 2.4499999999999998e-10Initial program 67.4%
lift-/.f64N/A
mult-flipN/A
associate-*r/N/A
*-rgt-identityN/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
Applied rewrites70.8%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
Applied rewrites67.4%
Taylor expanded in y around 0
Applied rewrites58.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -7e+58)
t_1
(if (<= z 1.15e+47) (/ (fma t z (* x y)) (fma z (- b y) y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -7e+58) {
tmp = t_1;
} else if (z <= 1.15e+47) {
tmp = fma(t, z, (x * y)) / fma(z, (b - y), y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -7e+58) tmp = t_1; elseif (z <= 1.15e+47) tmp = Float64(fma(t, z, Float64(x * y)) / fma(z, Float64(b - y), y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+58], t$95$1, If[LessEqual[z, 1.15e+47], N[(N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -7 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+47}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, x \cdot y\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.9999999999999995e58 or 1.1499999999999999e47 < z Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if -6.9999999999999995e58 < z < 1.1499999999999999e47Initial program 67.4%
lift-/.f64N/A
mult-flipN/A
associate-*r/N/A
*-rgt-identityN/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
Applied rewrites70.8%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
Applied rewrites67.4%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-*.f6448.5
Applied rewrites48.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -16000000.0)
t_1
(if (<= z -8e-140)
(* x (/ y (+ y (* z (- b y)))))
(if (<= z 7.4e-12) (* (fma (- t a) z (* y x)) (/ 1.0 y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -16000000.0) {
tmp = t_1;
} else if (z <= -8e-140) {
tmp = x * (y / (y + (z * (b - y))));
} else if (z <= 7.4e-12) {
tmp = fma((t - a), z, (y * x)) * (1.0 / y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -16000000.0) tmp = t_1; elseif (z <= -8e-140) tmp = Float64(x * Float64(y / Float64(y + Float64(z * Float64(b - y))))); elseif (z <= 7.4e-12) tmp = Float64(fma(Float64(t - a), z, Float64(y * x)) * Float64(1.0 / y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -16000000.0], t$95$1, If[LessEqual[z, -8e-140], N[(x * N[(y / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.4e-12], N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -16000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-140}:\\
\;\;\;\;x \cdot \frac{y}{y + z \cdot \left(b - y\right)}\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(t - a, z, y \cdot x\right) \cdot \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.6e7 or 7.39999999999999997e-12 < z Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if -1.6e7 < z < -7.9999999999999999e-140Initial program 67.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6466.2
Applied rewrites66.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6436.6
Applied rewrites36.6%
if -7.9999999999999999e-140 < z < 7.39999999999999997e-12Initial program 67.4%
lift-/.f64N/A
mult-flipN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6467.3
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
remove-double-negN/A
lower-fma.f6467.3
Applied rewrites67.3%
Taylor expanded in z around 0
lower-/.f6433.2
Applied rewrites33.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -16000000.0)
t_1
(if (<= z 4.8e-148)
(* x (/ y (+ y (* z (- b y)))))
(if (<= z 4.8e+14) (/ (* (- t a) z) (fma (- b y) z y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -16000000.0) {
tmp = t_1;
} else if (z <= 4.8e-148) {
tmp = x * (y / (y + (z * (b - y))));
} else if (z <= 4.8e+14) {
tmp = ((t - a) * z) / fma((b - y), z, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -16000000.0) tmp = t_1; elseif (z <= 4.8e-148) tmp = Float64(x * Float64(y / Float64(y + Float64(z * Float64(b - y))))); elseif (z <= 4.8e+14) tmp = Float64(Float64(Float64(t - a) * z) / fma(Float64(b - y), z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -16000000.0], t$95$1, If[LessEqual[z, 4.8e-148], N[(x * N[(y / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+14], N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -16000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-148}:\\
\;\;\;\;x \cdot \frac{y}{y + z \cdot \left(b - y\right)}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+14}:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.6e7 or 4.8e14 < z Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if -1.6e7 < z < 4.8000000000000002e-148Initial program 67.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6466.2
Applied rewrites66.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6436.6
Applied rewrites36.6%
if 4.8000000000000002e-148 < z < 4.8e14Initial program 67.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6442.5
Applied rewrites42.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.5
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites42.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -16000000.0)
t_1
(if (<= z 4.8e-148)
(* x (/ y (+ y (* z (- b y)))))
(if (<= z 2.4e-15) (/ (* z (- t a)) (+ y (* z b))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -16000000.0) {
tmp = t_1;
} else if (z <= 4.8e-148) {
tmp = x * (y / (y + (z * (b - y))));
} else if (z <= 2.4e-15) {
tmp = (z * (t - a)) / (y + (z * b));
} 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, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-16000000.0d0)) then
tmp = t_1
else if (z <= 4.8d-148) then
tmp = x * (y / (y + (z * (b - y))))
else if (z <= 2.4d-15) then
tmp = (z * (t - a)) / (y + (z * b))
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 b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -16000000.0) {
tmp = t_1;
} else if (z <= 4.8e-148) {
tmp = x * (y / (y + (z * (b - y))));
} else if (z <= 2.4e-15) {
tmp = (z * (t - a)) / (y + (z * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -16000000.0: tmp = t_1 elif z <= 4.8e-148: tmp = x * (y / (y + (z * (b - y)))) elif z <= 2.4e-15: tmp = (z * (t - a)) / (y + (z * b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -16000000.0) tmp = t_1; elseif (z <= 4.8e-148) tmp = Float64(x * Float64(y / Float64(y + Float64(z * Float64(b - y))))); elseif (z <= 2.4e-15) tmp = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * b))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -16000000.0) tmp = t_1; elseif (z <= 4.8e-148) tmp = x * (y / (y + (z * (b - y)))); elseif (z <= 2.4e-15) tmp = (z * (t - a)) / (y + (z * b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -16000000.0], t$95$1, If[LessEqual[z, 4.8e-148], N[(x * N[(y / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-15], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -16000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-148}:\\
\;\;\;\;x \cdot \frac{y}{y + z \cdot \left(b - y\right)}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-15}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.6e7 or 2.39999999999999995e-15 < z Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if -1.6e7 < z < 4.8000000000000002e-148Initial program 67.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6466.2
Applied rewrites66.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6436.6
Applied rewrites36.6%
if 4.8000000000000002e-148 < z < 2.39999999999999995e-15Initial program 67.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6442.5
Applied rewrites42.5%
Taylor expanded in y around 0
Applied rewrites35.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -16000000.0)
t_1
(if (<= z 6.2e-13) (* x (/ y (+ y (* z (- b y))))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -16000000.0) {
tmp = t_1;
} else if (z <= 6.2e-13) {
tmp = x * (y / (y + (z * (b - y))));
} 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, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-16000000.0d0)) then
tmp = t_1
else if (z <= 6.2d-13) then
tmp = x * (y / (y + (z * (b - y))))
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 b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -16000000.0) {
tmp = t_1;
} else if (z <= 6.2e-13) {
tmp = x * (y / (y + (z * (b - y))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -16000000.0: tmp = t_1 elif z <= 6.2e-13: tmp = x * (y / (y + (z * (b - y)))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -16000000.0) tmp = t_1; elseif (z <= 6.2e-13) tmp = Float64(x * Float64(y / Float64(y + Float64(z * Float64(b - y))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -16000000.0) tmp = t_1; elseif (z <= 6.2e-13) tmp = x * (y / (y + (z * (b - y)))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -16000000.0], t$95$1, If[LessEqual[z, 6.2e-13], N[(x * N[(y / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -16000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \frac{y}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.6e7 or 6.1999999999999998e-13 < z Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if -1.6e7 < z < 6.1999999999999998e-13Initial program 67.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6466.2
Applied rewrites66.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6436.6
Applied rewrites36.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -1e-55) t_1 (if (<= z 6.5e-73) (* x 1.0) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1e-55) {
tmp = t_1;
} else if (z <= 6.5e-73) {
tmp = x * 1.0;
} 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, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-1d-55)) then
tmp = t_1
else if (z <= 6.5d-73) then
tmp = x * 1.0d0
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 b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1e-55) {
tmp = t_1;
} else if (z <= 6.5e-73) {
tmp = x * 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -1e-55: tmp = t_1 elif z <= 6.5e-73: tmp = x * 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1e-55) tmp = t_1; elseif (z <= 6.5e-73) tmp = Float64(x * 1.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -1e-55) tmp = t_1; elseif (z <= 6.5e-73) tmp = x * 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e-55], t$95$1, If[LessEqual[z, 6.5e-73], N[(x * 1.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-73}:\\
\;\;\;\;x \cdot 1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.99999999999999995e-56 or 6.4999999999999999e-73 < z Initial program 67.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if -9.99999999999999995e-56 < z < 6.4999999999999999e-73Initial program 67.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6466.2
Applied rewrites66.2%
Taylor expanded in z around 0
Applied rewrites25.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -650.0) (* x 1.0) (if (<= y 54000000000.0) (/ (- t a) b) (* x 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -650.0) {
tmp = x * 1.0;
} else if (y <= 54000000000.0) {
tmp = (t - a) / b;
} else {
tmp = x * 1.0;
}
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, b)
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), intent (in) :: b
real(8) :: tmp
if (y <= (-650.0d0)) then
tmp = x * 1.0d0
else if (y <= 54000000000.0d0) then
tmp = (t - a) / b
else
tmp = x * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -650.0) {
tmp = x * 1.0;
} else if (y <= 54000000000.0) {
tmp = (t - a) / b;
} else {
tmp = x * 1.0;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -650.0: tmp = x * 1.0 elif y <= 54000000000.0: tmp = (t - a) / b else: tmp = x * 1.0 return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -650.0) tmp = Float64(x * 1.0); elseif (y <= 54000000000.0) tmp = Float64(Float64(t - a) / b); else tmp = Float64(x * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -650.0) tmp = x * 1.0; elseif (y <= 54000000000.0) tmp = (t - a) / b; else tmp = x * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -650.0], N[(x * 1.0), $MachinePrecision], If[LessEqual[y, 54000000000.0], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], N[(x * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -650:\\
\;\;\;\;x \cdot 1\\
\mathbf{elif}\;y \leq 54000000000:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;x \cdot 1\\
\end{array}
\end{array}
if y < -650 or 5.4e10 < y Initial program 67.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6466.2
Applied rewrites66.2%
Taylor expanded in z around 0
Applied rewrites25.6%
if -650 < y < 5.4e10Initial program 67.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6435.5
Applied rewrites35.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.2e-22) (/ t b) (if (<= z 4.1e-8) (* x 1.0) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.2e-22) {
tmp = t / b;
} else if (z <= 4.1e-8) {
tmp = x * 1.0;
} else {
tmp = t / b;
}
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, b)
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), intent (in) :: b
real(8) :: tmp
if (z <= (-4.2d-22)) then
tmp = t / b
else if (z <= 4.1d-8) then
tmp = x * 1.0d0
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.2e-22) {
tmp = t / b;
} else if (z <= 4.1e-8) {
tmp = x * 1.0;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.2e-22: tmp = t / b elif z <= 4.1e-8: tmp = x * 1.0 else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.2e-22) tmp = Float64(t / b); elseif (z <= 4.1e-8) tmp = Float64(x * 1.0); else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.2e-22) tmp = t / b; elseif (z <= 4.1e-8) tmp = x * 1.0; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.2e-22], N[(t / b), $MachinePrecision], If[LessEqual[z, 4.1e-8], N[(x * 1.0), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-22}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-8}:\\
\;\;\;\;x \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -4.20000000000000016e-22 or 4.10000000000000032e-8 < z Initial program 67.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6435.5
Applied rewrites35.5%
Taylor expanded in t around inf
lower-/.f6420.6
Applied rewrites20.6%
if -4.20000000000000016e-22 < z < 4.10000000000000032e-8Initial program 67.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6466.2
Applied rewrites66.2%
Taylor expanded in z around 0
Applied rewrites25.6%
(FPCore (x y z t a b) :precision binary64 (* x 1.0))
double code(double x, double y, double z, double t, double a, double b) {
return x * 1.0;
}
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, b)
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), intent (in) :: b
code = x * 1.0d0
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 1.0;
}
def code(x, y, z, t, a, b): return x * 1.0
function code(x, y, z, t, a, b) return Float64(x * 1.0) end
function tmp = code(x, y, z, t, a, b) tmp = x * 1.0; end
code[x_, y_, z_, t_, a_, b_] := N[(x * 1.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot 1
\end{array}
Initial program 67.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6466.2
Applied rewrites66.2%
Taylor expanded in z around 0
Applied rewrites25.6%
herbie shell --seed 2025149
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))