
(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 16 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 (/ (- t a) (- b y)))
(t_2 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_3 (fma z (/ (- t a) (fma (- b y) z y)) (* x 1.0))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -5e-250)
t_2
(if (<= t_2 0.0)
t_1
(if (<= t_2 1e+230) t_2 (if (<= t_2 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 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_3 = fma(z, ((t - a) / fma((b - y), z, y)), (x * 1.0));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -5e-250) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 1e+230) {
tmp = t_2;
} else if (t_2 <= ((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 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_3 = fma(z, Float64(Float64(t - a) / fma(Float64(b - y), z, y)), Float64(x * 1.0)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -5e-250) tmp = t_2; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 1e+230) tmp = t_2; elseif (t_2 <= 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[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(N[(t - a), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] + N[(x * 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -5e-250], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 1e+230], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_3 := \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, x \cdot 1\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-250}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+230}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \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)))) < -inf.0 or 1.0000000000000001e230 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 67.5%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
div-add-revN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites75.3%
Taylor expanded in z around 0
Applied rewrites56.1%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5.00000000000000027e-250 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.0000000000000001e230Initial program 67.5%
if -5.00000000000000027e-250 < (/.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.5%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.5
Applied rewrites51.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -1.85e+64)
t_2
(if (<= z 3.4e+60) (fma z (/ (- t a) t_1) (* x (/ y t_1))) t_2))))
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 = (t - a) / (b - y);
double tmp;
if (z <= -1.85e+64) {
tmp = t_2;
} else if (z <= 3.4e+60) {
tmp = fma(z, ((t - a) / t_1), (x * (y / t_1)));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.85e+64) tmp = t_2; elseif (z <= 3.4e+60) tmp = fma(z, Float64(Float64(t - a) / t_1), Float64(x * Float64(y / t_1))); else tmp = t_2; 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+64], t$95$2, If[LessEqual[z, 3.4e+60], N[(z * N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(x * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+60}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{t\_1}, x \cdot \frac{y}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.84999999999999992e64 or 3.4e60 < z Initial program 67.5%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.5
Applied rewrites51.5%
if -1.84999999999999992e64 < z < 3.4e60Initial program 67.5%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
div-add-revN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites75.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -53000000000000.0)
t_1
(if (<= z 8.2e-166)
(/ (+ (* x y) (* z (- t a))) (+ y (* z b)))
(if (<= z 2500000.0)
(fma z (/ (- t a) (fma (- b y) z y)) (* 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 <= -53000000000000.0) {
tmp = t_1;
} else if (z <= 8.2e-166) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * b));
} else if (z <= 2500000.0) {
tmp = fma(z, ((t - a) / fma((b - y), z, y)), (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 <= -53000000000000.0) tmp = t_1; elseif (z <= 8.2e-166) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * b))); elseif (z <= 2500000.0) tmp = fma(z, Float64(Float64(t - a) / fma(Float64(b - y), z, y)), Float64(x * 1.0)); 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, -53000000000000.0], t$95$1, If[LessEqual[z, 8.2e-166], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2500000.0], N[(z * N[(N[(t - a), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] + N[(x * 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -53000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-166}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot b}\\
\mathbf{elif}\;z \leq 2500000:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, x \cdot 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.3e13 or 2.5e6 < z Initial program 67.5%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.5
Applied rewrites51.5%
if -5.3e13 < z < 8.1999999999999995e-166Initial program 67.5%
Taylor expanded in y around 0
Applied rewrites58.2%
if 8.1999999999999995e-166 < z < 2.5e6Initial program 67.5%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
div-add-revN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites75.3%
Taylor expanded in z around 0
Applied rewrites56.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -53000000000000.0)
t_1
(if (<= z 8.2e-166)
(/ (+ (* x y) (* z (- t a))) (+ y (* z b)))
(if (<= z 200.0) (fma z (/ (- t a) (fma b z y)) (* 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 <= -53000000000000.0) {
tmp = t_1;
} else if (z <= 8.2e-166) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * b));
} else if (z <= 200.0) {
tmp = fma(z, ((t - a) / fma(b, z, y)), (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 <= -53000000000000.0) tmp = t_1; elseif (z <= 8.2e-166) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * b))); elseif (z <= 200.0) tmp = fma(z, Float64(Float64(t - a) / fma(b, z, y)), Float64(x * 1.0)); 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, -53000000000000.0], t$95$1, If[LessEqual[z, 8.2e-166], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 200.0], N[(z * N[(N[(t - a), $MachinePrecision] / N[(b * z + y), $MachinePrecision]), $MachinePrecision] + N[(x * 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -53000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-166}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot b}\\
\mathbf{elif}\;z \leq 200:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b, z, y\right)}, x \cdot 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.3e13 or 200 < z Initial program 67.5%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.5
Applied rewrites51.5%
if -5.3e13 < z < 8.1999999999999995e-166Initial program 67.5%
Taylor expanded in y around 0
Applied rewrites58.2%
if 8.1999999999999995e-166 < z < 200Initial program 67.5%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
div-add-revN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites75.3%
Taylor expanded in z around 0
Applied rewrites56.1%
Taylor expanded in y around 0
Applied rewrites48.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -0.00019)
t_1
(if (<= z 200.0) (fma z (/ (- t a) (fma b z y)) (* 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 <= -0.00019) {
tmp = t_1;
} else if (z <= 200.0) {
tmp = fma(z, ((t - a) / fma(b, z, y)), (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 <= -0.00019) tmp = t_1; elseif (z <= 200.0) tmp = fma(z, Float64(Float64(t - a) / fma(b, z, y)), Float64(x * 1.0)); 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, -0.00019], t$95$1, If[LessEqual[z, 200.0], N[(z * N[(N[(t - a), $MachinePrecision] / N[(b * z + y), $MachinePrecision]), $MachinePrecision] + N[(x * 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -0.00019:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 200:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b, z, y\right)}, x \cdot 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.9000000000000001e-4 or 200 < z Initial program 67.5%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.5
Applied rewrites51.5%
if -1.9000000000000001e-4 < z < 200Initial program 67.5%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
div-add-revN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites75.3%
Taylor expanded in z around 0
Applied rewrites56.1%
Taylor expanded in y around 0
Applied rewrites48.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.6e-6)
t_1
(if (<= z 200.0) (+ x (* z (- (/ t y) (/ a 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 <= -1.6e-6) {
tmp = t_1;
} else if (z <= 200.0) {
tmp = x + (z * ((t / y) - (a / 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 <= (-1.6d-6)) then
tmp = t_1
else if (z <= 200.0d0) then
tmp = x + (z * ((t / y) - (a / 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 <= -1.6e-6) {
tmp = t_1;
} else if (z <= 200.0) {
tmp = x + (z * ((t / y) - (a / 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 <= -1.6e-6: tmp = t_1 elif z <= 200.0: tmp = x + (z * ((t / y) - (a / 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 <= -1.6e-6) tmp = t_1; elseif (z <= 200.0) tmp = Float64(x + Float64(z * Float64(Float64(t / y) - Float64(a / 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 <= -1.6e-6) tmp = t_1; elseif (z <= 200.0) tmp = x + (z * ((t / y) - (a / 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, -1.6e-6], t$95$1, If[LessEqual[z, 200.0], N[(x + N[(z * N[(N[(t / y), $MachinePrecision] - N[(a / 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 -1.6 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 200:\\
\;\;\;\;x + z \cdot \left(\frac{t}{y} - \frac{a}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.5999999999999999e-6 or 200 < z Initial program 67.5%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.5
Applied rewrites51.5%
if -1.5999999999999999e-6 < z < 200Initial program 67.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f6434.7
Applied rewrites34.7%
Taylor expanded in x around 0
lift-/.f6434.8
Applied rewrites34.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -1.6e-6) t_1 (if (<= z 200.0) (+ x (* z (/ (- t a) 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 <= -1.6e-6) {
tmp = t_1;
} else if (z <= 200.0) {
tmp = x + (z * ((t - a) / 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 <= (-1.6d-6)) then
tmp = t_1
else if (z <= 200.0d0) then
tmp = x + (z * ((t - a) / 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 <= -1.6e-6) {
tmp = t_1;
} else if (z <= 200.0) {
tmp = x + (z * ((t - a) / 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 <= -1.6e-6: tmp = t_1 elif z <= 200.0: tmp = x + (z * ((t - a) / 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 <= -1.6e-6) tmp = t_1; elseif (z <= 200.0) tmp = Float64(x + Float64(z * Float64(Float64(t - a) / 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 <= -1.6e-6) tmp = t_1; elseif (z <= 200.0) tmp = x + (z * ((t - a) / 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, -1.6e-6], t$95$1, If[LessEqual[z, 200.0], N[(x + N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 200:\\
\;\;\;\;x + z \cdot \frac{t - a}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.5999999999999999e-6 or 200 < z Initial program 67.5%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.5
Applied rewrites51.5%
if -1.5999999999999999e-6 < z < 200Initial program 67.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f6434.7
Applied rewrites34.7%
Taylor expanded in x around 0
sub-divN/A
lower-/.f64N/A
lift--.f6435.3
Applied rewrites35.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -9.8e-117) t_1 (if (<= z 1.2e-12) (+ x (* x z)) 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 <= -9.8e-117) {
tmp = t_1;
} else if (z <= 1.2e-12) {
tmp = x + (x * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, 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 <= (-9.8d-117)) then
tmp = t_1
else if (z <= 1.2d-12) then
tmp = x + (x * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -9.8e-117) {
tmp = t_1;
} else if (z <= 1.2e-12) {
tmp = x + (x * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -9.8e-117: tmp = t_1 elif z <= 1.2e-12: tmp = x + (x * z) 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 <= -9.8e-117) tmp = t_1; elseif (z <= 1.2e-12) tmp = Float64(x + Float64(x * z)); 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 <= -9.8e-117) tmp = t_1; elseif (z <= 1.2e-12) tmp = x + (x * z); 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, -9.8e-117], t$95$1, If[LessEqual[z, 1.2e-12], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -9.8 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-12}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.7999999999999995e-117 or 1.19999999999999994e-12 < z Initial program 67.5%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.5
Applied rewrites51.5%
if -9.7999999999999995e-117 < z < 1.19999999999999994e-12Initial program 67.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f6434.7
Applied rewrites34.7%
Taylor expanded in x around inf
lower-*.f6425.4
Applied rewrites25.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- x) (- z 1.0)))) (if (<= y -5.2e+60) t_1 (if (<= y 3.8e-37) (/ (- t a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -x / (z - 1.0);
double tmp;
if (y <= -5.2e+60) {
tmp = t_1;
} else if (y <= 3.8e-37) {
tmp = (t - a) / 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 = -x / (z - 1.0d0)
if (y <= (-5.2d+60)) then
tmp = t_1
else if (y <= 3.8d-37) then
tmp = (t - a) / 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 = -x / (z - 1.0);
double tmp;
if (y <= -5.2e+60) {
tmp = t_1;
} else if (y <= 3.8e-37) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -x / (z - 1.0) tmp = 0 if y <= -5.2e+60: tmp = t_1 elif y <= 3.8e-37: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-x) / Float64(z - 1.0)) tmp = 0.0 if (y <= -5.2e+60) tmp = t_1; elseif (y <= 3.8e-37) tmp = Float64(Float64(t - a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -x / (z - 1.0); tmp = 0.0; if (y <= -5.2e+60) tmp = t_1; elseif (y <= 3.8e-37) tmp = (t - a) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-x) / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.2e+60], t$95$1, If[LessEqual[y, 3.8e-37], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{z - 1}\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-37}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.20000000000000016e60 or 3.8000000000000004e-37 < y Initial program 67.5%
Taylor expanded in y around -inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f6432.8
Applied rewrites32.8%
if -5.20000000000000016e60 < y < 3.8000000000000004e-37Initial program 67.5%
Taylor expanded in y around 0
lower-/.f64N/A
lift--.f6435.3
Applied rewrites35.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) b))) (if (<= z -9.8e-117) t_1 (if (<= z 1.12e-12) (+ x (* x z)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double tmp;
if (z <= -9.8e-117) {
tmp = t_1;
} else if (z <= 1.12e-12) {
tmp = x + (x * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, 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
if (z <= (-9.8d-117)) then
tmp = t_1
else if (z <= 1.12d-12) then
tmp = x + (x * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double tmp;
if (z <= -9.8e-117) {
tmp = t_1;
} else if (z <= 1.12e-12) {
tmp = x + (x * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / b tmp = 0 if z <= -9.8e-117: tmp = t_1 elif z <= 1.12e-12: tmp = x + (x * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / b) tmp = 0.0 if (z <= -9.8e-117) tmp = t_1; elseif (z <= 1.12e-12) tmp = Float64(x + Float64(x * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / b; tmp = 0.0; if (z <= -9.8e-117) tmp = t_1; elseif (z <= 1.12e-12) tmp = x + (x * z); 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] / b), $MachinePrecision]}, If[LessEqual[z, -9.8e-117], t$95$1, If[LessEqual[z, 1.12e-12], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b}\\
\mathbf{if}\;z \leq -9.8 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-12}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.7999999999999995e-117 or 1.1200000000000001e-12 < z Initial program 67.5%
Taylor expanded in y around 0
lower-/.f64N/A
lift--.f6435.3
Applied rewrites35.3%
if -9.7999999999999995e-117 < z < 1.1200000000000001e-12Initial program 67.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f6434.7
Applied rewrites34.7%
Taylor expanded in x around inf
lower-*.f6425.4
Applied rewrites25.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -0.00088)
t_1
(if (<= z 8.2e-10) (+ x (* x z)) (if (<= z 3.1e+227) t_1 (/ a y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -0.00088) {
tmp = t_1;
} else if (z <= 8.2e-10) {
tmp = x + (x * z);
} else if (z <= 3.1e+227) {
tmp = t_1;
} else {
tmp = a / y;
}
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 / (b - y)
if (z <= (-0.00088d0)) then
tmp = t_1
else if (z <= 8.2d-10) then
tmp = x + (x * z)
else if (z <= 3.1d+227) then
tmp = t_1
else
tmp = a / y
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 / (b - y);
double tmp;
if (z <= -0.00088) {
tmp = t_1;
} else if (z <= 8.2e-10) {
tmp = x + (x * z);
} else if (z <= 3.1e+227) {
tmp = t_1;
} else {
tmp = a / y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -0.00088: tmp = t_1 elif z <= 8.2e-10: tmp = x + (x * z) elif z <= 3.1e+227: tmp = t_1 else: tmp = a / y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -0.00088) tmp = t_1; elseif (z <= 8.2e-10) tmp = Float64(x + Float64(x * z)); elseif (z <= 3.1e+227) tmp = t_1; else tmp = Float64(a / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -0.00088) tmp = t_1; elseif (z <= 8.2e-10) tmp = x + (x * z); elseif (z <= 3.1e+227) tmp = t_1; else tmp = a / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.00088], t$95$1, If[LessEqual[z, 8.2e-10], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+227], t$95$1, N[(a / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -0.00088:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-10}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+227}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{y}\\
\end{array}
\end{array}
if z < -8.80000000000000031e-4 or 8.1999999999999996e-10 < z < 3.0999999999999999e227Initial program 67.5%
Taylor expanded in t around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6426.5
Applied rewrites26.5%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f6428.5
Applied rewrites28.5%
if -8.80000000000000031e-4 < z < 8.1999999999999996e-10Initial program 67.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f6434.7
Applied rewrites34.7%
Taylor expanded in x around inf
lower-*.f6425.4
Applied rewrites25.4%
if 3.0999999999999999e227 < z Initial program 67.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6414.2
Applied rewrites14.2%
Taylor expanded in z around inf
lower-/.f6412.9
Applied rewrites12.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -0.00088) (/ t b) (if (<= z 6.6e-10) (+ x (* x z)) (if (<= z 1.45e+227) (/ t b) (/ a y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -0.00088) {
tmp = t / b;
} else if (z <= 6.6e-10) {
tmp = x + (x * z);
} else if (z <= 1.45e+227) {
tmp = t / b;
} else {
tmp = a / y;
}
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 <= (-0.00088d0)) then
tmp = t / b
else if (z <= 6.6d-10) then
tmp = x + (x * z)
else if (z <= 1.45d+227) then
tmp = t / b
else
tmp = a / y
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 <= -0.00088) {
tmp = t / b;
} else if (z <= 6.6e-10) {
tmp = x + (x * z);
} else if (z <= 1.45e+227) {
tmp = t / b;
} else {
tmp = a / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -0.00088: tmp = t / b elif z <= 6.6e-10: tmp = x + (x * z) elif z <= 1.45e+227: tmp = t / b else: tmp = a / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -0.00088) tmp = Float64(t / b); elseif (z <= 6.6e-10) tmp = Float64(x + Float64(x * z)); elseif (z <= 1.45e+227) tmp = Float64(t / b); else tmp = Float64(a / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -0.00088) tmp = t / b; elseif (z <= 6.6e-10) tmp = x + (x * z); elseif (z <= 1.45e+227) tmp = t / b; else tmp = a / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -0.00088], N[(t / b), $MachinePrecision], If[LessEqual[z, 6.6e-10], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+227], N[(t / b), $MachinePrecision], N[(a / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00088:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-10}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+227}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{y}\\
\end{array}
\end{array}
if z < -8.80000000000000031e-4 or 6.6e-10 < z < 1.4499999999999999e227Initial program 67.5%
Taylor expanded in y around 0
lower-/.f64N/A
lift--.f6435.3
Applied rewrites35.3%
Taylor expanded in t around inf
lower-/.f6420.3
Applied rewrites20.3%
if -8.80000000000000031e-4 < z < 6.6e-10Initial program 67.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f6434.7
Applied rewrites34.7%
Taylor expanded in x around inf
lower-*.f6425.4
Applied rewrites25.4%
if 1.4499999999999999e227 < z Initial program 67.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6414.2
Applied rewrites14.2%
Taylor expanded in z around inf
lower-/.f6412.9
Applied rewrites12.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -0.00088) (/ t b) (if (<= z 6.6e-10) (* x (+ 1.0 z)) (if (<= z 1.45e+227) (/ t b) (/ a y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -0.00088) {
tmp = t / b;
} else if (z <= 6.6e-10) {
tmp = x * (1.0 + z);
} else if (z <= 1.45e+227) {
tmp = t / b;
} else {
tmp = a / y;
}
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 <= (-0.00088d0)) then
tmp = t / b
else if (z <= 6.6d-10) then
tmp = x * (1.0d0 + z)
else if (z <= 1.45d+227) then
tmp = t / b
else
tmp = a / y
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 <= -0.00088) {
tmp = t / b;
} else if (z <= 6.6e-10) {
tmp = x * (1.0 + z);
} else if (z <= 1.45e+227) {
tmp = t / b;
} else {
tmp = a / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -0.00088: tmp = t / b elif z <= 6.6e-10: tmp = x * (1.0 + z) elif z <= 1.45e+227: tmp = t / b else: tmp = a / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -0.00088) tmp = Float64(t / b); elseif (z <= 6.6e-10) tmp = Float64(x * Float64(1.0 + z)); elseif (z <= 1.45e+227) tmp = Float64(t / b); else tmp = Float64(a / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -0.00088) tmp = t / b; elseif (z <= 6.6e-10) tmp = x * (1.0 + z); elseif (z <= 1.45e+227) tmp = t / b; else tmp = a / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -0.00088], N[(t / b), $MachinePrecision], If[LessEqual[z, 6.6e-10], N[(x * N[(1.0 + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+227], N[(t / b), $MachinePrecision], N[(a / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00088:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-10}:\\
\;\;\;\;x \cdot \left(1 + z\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+227}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{y}\\
\end{array}
\end{array}
if z < -8.80000000000000031e-4 or 6.6e-10 < z < 1.4499999999999999e227Initial program 67.5%
Taylor expanded in y around 0
lower-/.f64N/A
lift--.f6435.3
Applied rewrites35.3%
Taylor expanded in t around inf
lower-/.f6420.3
Applied rewrites20.3%
if -8.80000000000000031e-4 < z < 6.6e-10Initial program 67.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f6434.7
Applied rewrites34.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f6425.4
Applied rewrites25.4%
if 1.4499999999999999e227 < z Initial program 67.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6414.2
Applied rewrites14.2%
Taylor expanded in z around inf
lower-/.f6412.9
Applied rewrites12.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.6e+65) (/ a y) (if (<= y 1e+40) (/ t b) (/ a y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6e+65) {
tmp = a / y;
} else if (y <= 1e+40) {
tmp = t / b;
} else {
tmp = a / y;
}
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 <= (-1.6d+65)) then
tmp = a / y
else if (y <= 1d+40) then
tmp = t / b
else
tmp = a / y
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 <= -1.6e+65) {
tmp = a / y;
} else if (y <= 1e+40) {
tmp = t / b;
} else {
tmp = a / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.6e+65: tmp = a / y elif y <= 1e+40: tmp = t / b else: tmp = a / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.6e+65) tmp = Float64(a / y); elseif (y <= 1e+40) tmp = Float64(t / b); else tmp = Float64(a / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.6e+65) tmp = a / y; elseif (y <= 1e+40) tmp = t / b; else tmp = a / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.6e+65], N[(a / y), $MachinePrecision], If[LessEqual[y, 1e+40], N[(t / b), $MachinePrecision], N[(a / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+65}:\\
\;\;\;\;\frac{a}{y}\\
\mathbf{elif}\;y \leq 10^{+40}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{y}\\
\end{array}
\end{array}
if y < -1.60000000000000003e65 or 1.00000000000000003e40 < y Initial program 67.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6414.2
Applied rewrites14.2%
Taylor expanded in z around inf
lower-/.f6412.9
Applied rewrites12.9%
if -1.60000000000000003e65 < y < 1.00000000000000003e40Initial program 67.5%
Taylor expanded in y around 0
lower-/.f64N/A
lift--.f6435.3
Applied rewrites35.3%
Taylor expanded in t around inf
lower-/.f6420.3
Applied rewrites20.3%
(FPCore (x y z t a b) :precision binary64 (/ a y))
double code(double x, double y, double z, double t, double a, double b) {
return a / 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 = a / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a / y;
}
def code(x, y, z, t, a, b): return a / y
function code(x, y, z, t, a, b) return Float64(a / y) end
function tmp = code(x, y, z, t, a, b) tmp = a / y; end
code[x_, y_, z_, t_, a_, b_] := N[(a / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{a}{y}
\end{array}
Initial program 67.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6414.2
Applied rewrites14.2%
Taylor expanded in z around inf
lower-/.f6412.9
Applied rewrites12.9%
(FPCore (x y z t a b) :precision binary64 (* x z))
double code(double x, double y, double z, double t, double a, double b) {
return x * 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, 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 * z
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * z;
}
def code(x, y, z, t, a, b): return x * z
function code(x, y, z, t, a, b) return Float64(x * z) end
function tmp = code(x, y, z, t, a, b) tmp = x * z; end
code[x_, y_, z_, t_, a_, b_] := N[(x * z), $MachinePrecision]
\begin{array}{l}
\\
x \cdot z
\end{array}
Initial program 67.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f6434.7
Applied rewrites34.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f6425.4
Applied rewrites25.4%
Taylor expanded in z around inf
lower-*.f643.9
Applied rewrites3.9%
herbie shell --seed 2025139
(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)))))