
(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 18 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 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_2 (fma (- b y) z y)))
(if (<= t_1 (- INFINITY))
(fma (/ y t_2) x (* (/ (- t a) t_2) z))
(if (<= t_1 -2e-282)
t_1
(if (<= t_1 0.0)
(-
(fma
-1.0
(/
(fma -1.0 (/ (* x y) (- b y)) (/ (* y (- t a)) (pow (- b y) 2.0)))
z)
(/ t (- b y)))
(/ a (- b y)))
(if (<= t_1 1e+291)
t_1
(fma (/ -1.0 (- z 1.0)) x (/ (- t a) (- b y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_2 = fma((b - y), z, y);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma((y / t_2), x, (((t - a) / t_2) * z));
} else if (t_1 <= -2e-282) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = fma(-1.0, (fma(-1.0, ((x * y) / (b - y)), ((y * (t - a)) / pow((b - y), 2.0))) / z), (t / (b - y))) - (a / (b - y));
} else if (t_1 <= 1e+291) {
tmp = t_1;
} else {
tmp = fma((-1.0 / (z - 1.0)), x, ((t - a) / (b - y)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_2 = fma(Float64(b - y), z, y) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = fma(Float64(y / t_2), x, Float64(Float64(Float64(t - a) / t_2) * z)); elseif (t_1 <= -2e-282) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(fma(-1.0, Float64(fma(-1.0, Float64(Float64(x * y) / Float64(b - y)), Float64(Float64(y * Float64(t - a)) / (Float64(b - y) ^ 2.0))) / z), Float64(t / Float64(b - y))) - Float64(a / Float64(b - y))); elseif (t_1 <= 1e+291) tmp = t_1; else tmp = fma(Float64(-1.0 / Float64(z - 1.0)), x, Float64(Float64(t - a) / Float64(b - y))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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$2 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y / t$95$2), $MachinePrecision] * x + N[(N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-282], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(-1.0 * N[(N[(-1.0 * N[(N[(x * y), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(y * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $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$1, 1e+291], t$95$1, N[(N[(-1.0 / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * x + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_2 := \mathsf{fma}\left(b - y, z, y\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t\_2}, x, \frac{t - a}{t\_2} \cdot z\right)\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-282}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, \frac{x \cdot y}{b - y}, \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}\right)}{z}, \frac{t}{b - y}\right) - \frac{a}{b - y}\\
\mathbf{elif}\;t\_1 \leq 10^{+291}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{z - 1}, x, \frac{t - a}{b - y}\right)\\
\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 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -2e-282 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 9.9999999999999996e290Initial program 66.1%
if -2e-282 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around -inf
lower--.f64N/A
Applied rewrites47.6%
if 9.9999999999999996e290 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6467.8
Applied rewrites67.8%
(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 (- b y) z y))
(t_4 (/ y t_3)))
(if (<= t_2 (- INFINITY))
(fma t_4 x (* (/ (- t a) t_3) z))
(if (<= t_2 -2e-282)
t_2
(if (<= t_2 1e-231)
(fma t_4 x t_1)
(if (<= t_2 1e+291) t_2 (fma (/ -1.0 (- z 1.0)) x 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((b - y), z, y);
double t_4 = y / t_3;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma(t_4, x, (((t - a) / t_3) * z));
} else if (t_2 <= -2e-282) {
tmp = t_2;
} else if (t_2 <= 1e-231) {
tmp = fma(t_4, x, t_1);
} else if (t_2 <= 1e+291) {
tmp = t_2;
} else {
tmp = fma((-1.0 / (z - 1.0)), x, 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(Float64(b - y), z, y) t_4 = Float64(y / t_3) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = fma(t_4, x, Float64(Float64(Float64(t - a) / t_3) * z)); elseif (t_2 <= -2e-282) tmp = t_2; elseif (t_2 <= 1e-231) tmp = fma(t_4, x, t_1); elseif (t_2 <= 1e+291) tmp = t_2; else tmp = fma(Float64(-1.0 / Float64(z - 1.0)), x, 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[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$4 = N[(y / t$95$3), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$4 * x + N[(N[(N[(t - a), $MachinePrecision] / t$95$3), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e-282], t$95$2, If[LessEqual[t$95$2, 1e-231], N[(t$95$4 * x + t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e+291], t$95$2, N[(N[(-1.0 / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * x + t$95$1), $MachinePrecision]]]]]]]]]
\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(b - y, z, y\right)\\
t_4 := \frac{y}{t\_3}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(t\_4, x, \frac{t - a}{t\_3} \cdot z\right)\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-282}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 10^{-231}:\\
\;\;\;\;\mathsf{fma}\left(t\_4, x, t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+291}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{z - 1}, x, t\_1\right)\\
\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 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -2e-282 or 9.9999999999999999e-232 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 9.9999999999999996e290Initial program 66.1%
if -2e-282 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 9.9999999999999999e-232Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
if 9.9999999999999996e290 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6467.8
Applied rewrites67.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_2 (/ (- t a) (- b y)))
(t_3 (fma (/ y (fma (- b y) z y)) x t_2)))
(if (<= t_1 -4e+192)
t_3
(if (<= t_1 -2e-282)
t_1
(if (<= t_1 1e-231)
t_3
(if (<= t_1 1e+291) t_1 (fma (/ -1.0 (- z 1.0)) x t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_2 = (t - a) / (b - y);
double t_3 = fma((y / fma((b - y), z, y)), x, t_2);
double tmp;
if (t_1 <= -4e+192) {
tmp = t_3;
} else if (t_1 <= -2e-282) {
tmp = t_1;
} else if (t_1 <= 1e-231) {
tmp = t_3;
} else if (t_1 <= 1e+291) {
tmp = t_1;
} else {
tmp = fma((-1.0 / (z - 1.0)), x, t_2);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_2 = Float64(Float64(t - a) / Float64(b - y)) t_3 = fma(Float64(y / fma(Float64(b - y), z, y)), x, t_2) tmp = 0.0 if (t_1 <= -4e+192) tmp = t_3; elseif (t_1 <= -2e-282) tmp = t_1; elseif (t_1 <= 1e-231) tmp = t_3; elseif (t_1 <= 1e+291) tmp = t_1; else tmp = fma(Float64(-1.0 / Float64(z - 1.0)), x, t_2); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * x + t$95$2), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+192], t$95$3, If[LessEqual[t$95$1, -2e-282], t$95$1, If[LessEqual[t$95$1, 1e-231], t$95$3, If[LessEqual[t$95$1, 1e+291], t$95$1, N[(N[(-1.0 / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * x + t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_2 := \frac{t - a}{b - y}\\
t_3 := \mathsf{fma}\left(\frac{y}{\mathsf{fma}\left(b - y, z, y\right)}, x, t\_2\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+192}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-282}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{-231}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 10^{+291}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{z - 1}, x, t\_2\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.00000000000000016e192 or -2e-282 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 9.9999999999999999e-232Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
if -4.00000000000000016e192 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -2e-282 or 9.9999999999999999e-232 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 9.9999999999999996e290Initial program 66.1%
if 9.9999999999999996e290 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6467.8
Applied rewrites67.8%
(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 (/ -1.0 (- z 1.0)) x t_1)))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -2e-282)
t_2
(if (<= t_2 0.0) t_1 (if (<= t_2 1e+291) t_2 t_3))))))
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((-1.0 / (z - 1.0)), x, t_1);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -2e-282) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 1e+291) {
tmp = t_2;
} else {
tmp = t_3;
}
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(Float64(-1.0 / Float64(z - 1.0)), x, t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -2e-282) tmp = t_2; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 1e+291) tmp = t_2; else tmp = t_3; 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[(N[(-1.0 / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * x + t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -2e-282], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 1e+291], t$95$2, t$95$3]]]]]]]
\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(\frac{-1}{z - 1}, x, t\_1\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-282}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+291}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\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 9.9999999999999996e290 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6467.8
Applied rewrites67.8%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -2e-282 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 9.9999999999999996e290Initial program 66.1%
if -2e-282 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 66.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6452.6
Applied rewrites52.6%
(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 -10500000.0)
(fma (/ -1.0 z) x t_2)
(if (<= z -8.2e-87)
(fma (/ y t_1) x (/ (- t a) b))
(if (<= z 9000000.0)
(fma 1.0 x (* (/ (- t a) t_1) z))
(fma (/ -1.0 (- z 1.0)) x 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 <= -10500000.0) {
tmp = fma((-1.0 / z), x, t_2);
} else if (z <= -8.2e-87) {
tmp = fma((y / t_1), x, ((t - a) / b));
} else if (z <= 9000000.0) {
tmp = fma(1.0, x, (((t - a) / t_1) * z));
} else {
tmp = fma((-1.0 / (z - 1.0)), x, 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 <= -10500000.0) tmp = fma(Float64(-1.0 / z), x, t_2); elseif (z <= -8.2e-87) tmp = fma(Float64(y / t_1), x, Float64(Float64(t - a) / b)); elseif (z <= 9000000.0) tmp = fma(1.0, x, Float64(Float64(Float64(t - a) / t_1) * z)); else tmp = fma(Float64(-1.0 / Float64(z - 1.0)), x, 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, -10500000.0], N[(N[(-1.0 / z), $MachinePrecision] * x + t$95$2), $MachinePrecision], If[LessEqual[z, -8.2e-87], N[(N[(y / t$95$1), $MachinePrecision] * x + N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9000000.0], N[(1.0 * x + N[(N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * x + t$95$2), $MachinePrecision]]]]]]
\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 -10500000:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{z}, x, t\_2\right)\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-87}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t\_1}, x, \frac{t - a}{b}\right)\\
\mathbf{elif}\;z \leq 9000000:\\
\;\;\;\;\mathsf{fma}\left(1, x, \frac{t - a}{t\_1} \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{z - 1}, x, t\_2\right)\\
\end{array}
\end{array}
if z < -1.05e7Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6467.8
Applied rewrites67.8%
Taylor expanded in z around inf
lower-/.f6449.7
Applied rewrites49.7%
if -1.05e7 < z < -8.20000000000000066e-87Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6452.0
Applied rewrites52.0%
if -8.20000000000000066e-87 < z < 9e6Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around 0
Applied rewrites55.9%
if 9e6 < z Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6467.8
Applied rewrites67.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (/ -1.0 (- z 1.0)) x (/ (- t a) (- b y)))))
(if (<= z -8.2e-87)
t_1
(if (<= z 9000000.0)
(fma 1.0 x (* (/ (- t a) (fma (- b y) z y)) z))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((-1.0 / (z - 1.0)), x, ((t - a) / (b - y)));
double tmp;
if (z <= -8.2e-87) {
tmp = t_1;
} else if (z <= 9000000.0) {
tmp = fma(1.0, x, (((t - a) / fma((b - y), z, y)) * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(-1.0 / Float64(z - 1.0)), x, Float64(Float64(t - a) / Float64(b - y))) tmp = 0.0 if (z <= -8.2e-87) tmp = t_1; elseif (z <= 9000000.0) tmp = fma(1.0, x, Float64(Float64(Float64(t - a) / fma(Float64(b - y), z, y)) * z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(-1.0 / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * x + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e-87], t$95$1, If[LessEqual[z, 9000000.0], N[(1.0 * x + N[(N[(N[(t - a), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{-1}{z - 1}, x, \frac{t - a}{b - y}\right)\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9000000:\\
\;\;\;\;\mathsf{fma}\left(1, x, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)} \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.20000000000000066e-87 or 9e6 < z Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6467.8
Applied rewrites67.8%
if -8.20000000000000066e-87 < z < 9e6Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around 0
Applied rewrites55.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y))) (t_2 (fma (/ -1.0 (- z 1.0)) x t_1))) (if (<= y -8.8e+64) t_2 (if (<= y 2.9e+23) (fma (/ y (* b z)) x t_1) t_2))))
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((-1.0 / (z - 1.0)), x, t_1);
double tmp;
if (y <= -8.8e+64) {
tmp = t_2;
} else if (y <= 2.9e+23) {
tmp = fma((y / (b * z)), x, t_1);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = fma(Float64(-1.0 / Float64(z - 1.0)), x, t_1) tmp = 0.0 if (y <= -8.8e+64) tmp = t_2; elseif (y <= 2.9e+23) tmp = fma(Float64(y / Float64(b * z)), x, t_1); else tmp = t_2; 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[(-1.0 / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * x + t$95$1), $MachinePrecision]}, If[LessEqual[y, -8.8e+64], t$95$2, If[LessEqual[y, 2.9e+23], N[(N[(y / N[(b * z), $MachinePrecision]), $MachinePrecision] * x + t$95$1), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := \mathsf{fma}\left(\frac{-1}{z - 1}, x, t\_1\right)\\
\mathbf{if}\;y \leq -8.8 \cdot 10^{+64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{b \cdot z}, x, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -8.80000000000000007e64 or 2.90000000000000013e23 < y Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6467.8
Applied rewrites67.8%
if -8.80000000000000007e64 < y < 2.90000000000000013e23Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around 0
lower-*.f6451.2
Applied rewrites51.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (/ -1.0 z) x (/ (- t a) (- b y)))))
(if (<= z -3.5e-15)
t_1
(if (<= z 1.9e-42)
(/ (fma t z (* x y)) (+ y (* z b)))
(if (<= z 150000000.0) (/ (* 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 = fma((-1.0 / z), x, ((t - a) / (b - y)));
double tmp;
if (z <= -3.5e-15) {
tmp = t_1;
} else if (z <= 1.9e-42) {
tmp = fma(t, z, (x * y)) / (y + (z * b));
} else if (z <= 150000000.0) {
tmp = (z * (t - a)) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(-1.0 / z), x, Float64(Float64(t - a) / Float64(b - y))) tmp = 0.0 if (z <= -3.5e-15) tmp = t_1; elseif (z <= 1.9e-42) tmp = Float64(fma(t, z, Float64(x * y)) / Float64(y + Float64(z * b))); elseif (z <= 150000000.0) tmp = Float64(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[(-1.0 / z), $MachinePrecision] * x + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e-15], t$95$1, If[LessEqual[z, 1.9e-42], N[(N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 150000000.0], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{-1}{z}, x, \frac{t - a}{b - y}\right)\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-42}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, x \cdot y\right)}{y + z \cdot b}\\
\mathbf{elif}\;z \leq 150000000:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.5000000000000001e-15 or 1.5e8 < z Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6467.8
Applied rewrites67.8%
Taylor expanded in z around inf
lower-/.f6449.7
Applied rewrites49.7%
if -3.5000000000000001e-15 < z < 1.90000000000000009e-42Initial program 66.1%
Taylor expanded in t around inf
lower-*.f6423.4
Applied rewrites23.4%
Taylor expanded in y around 0
Applied rewrites20.0%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-*.f6441.5
Applied rewrites41.5%
if 1.90000000000000009e-42 < z < 1.5e8Initial program 66.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6441.8
Applied rewrites41.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (/ -1.0 (- z 1.0)) x (/ (- t a) (- b y)))))
(if (<= z -2.5e-32)
t_1
(if (<= z 1.46e-49) (/ (fma t z (* x y)) (+ y (* z b))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((-1.0 / (z - 1.0)), x, ((t - a) / (b - y)));
double tmp;
if (z <= -2.5e-32) {
tmp = t_1;
} else if (z <= 1.46e-49) {
tmp = fma(t, z, (x * y)) / (y + (z * b));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(-1.0 / Float64(z - 1.0)), x, Float64(Float64(t - a) / Float64(b - y))) tmp = 0.0 if (z <= -2.5e-32) tmp = t_1; elseif (z <= 1.46e-49) tmp = Float64(fma(t, z, Float64(x * y)) / 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[(-1.0 / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * x + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e-32], t$95$1, If[LessEqual[z, 1.46e-49], N[(N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{-1}{z - 1}, x, \frac{t - a}{b - y}\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.46 \cdot 10^{-49}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, x \cdot y\right)}{y + z \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.5e-32 or 1.46000000000000007e-49 < z Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6467.8
Applied rewrites67.8%
if -2.5e-32 < z < 1.46000000000000007e-49Initial program 66.1%
Taylor expanded in t around inf
lower-*.f6423.4
Applied rewrites23.4%
Taylor expanded in y around 0
Applied rewrites20.0%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-*.f6441.5
Applied rewrites41.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (/ -1.0 z) x (/ (- t a) (- b y)))) (t_2 (+ y (* z b))))
(if (<= z -3.5e-15)
t_1
(if (<= z 1.9e-42)
(/ (fma t z (* x y)) t_2)
(if (<= z 140.0) (/ (* z (- t a)) t_2) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((-1.0 / z), x, ((t - a) / (b - y)));
double t_2 = y + (z * b);
double tmp;
if (z <= -3.5e-15) {
tmp = t_1;
} else if (z <= 1.9e-42) {
tmp = fma(t, z, (x * y)) / t_2;
} else if (z <= 140.0) {
tmp = (z * (t - a)) / t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(-1.0 / z), x, Float64(Float64(t - a) / Float64(b - y))) t_2 = Float64(y + Float64(z * b)) tmp = 0.0 if (z <= -3.5e-15) tmp = t_1; elseif (z <= 1.9e-42) tmp = Float64(fma(t, z, Float64(x * y)) / t_2); elseif (z <= 140.0) tmp = Float64(Float64(z * Float64(t - a)) / t_2); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(-1.0 / z), $MachinePrecision] * x + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e-15], t$95$1, If[LessEqual[z, 1.9e-42], N[(N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[z, 140.0], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{-1}{z}, x, \frac{t - a}{b - y}\right)\\
t_2 := y + z \cdot b\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-42}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, x \cdot y\right)}{t\_2}\\
\mathbf{elif}\;z \leq 140:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.5000000000000001e-15 or 140 < z Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6467.8
Applied rewrites67.8%
Taylor expanded in z around inf
lower-/.f6449.7
Applied rewrites49.7%
if -3.5000000000000001e-15 < z < 1.90000000000000009e-42Initial program 66.1%
Taylor expanded in t around inf
lower-*.f6423.4
Applied rewrites23.4%
Taylor expanded in y around 0
Applied rewrites20.0%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-*.f6441.5
Applied rewrites41.5%
if 1.90000000000000009e-42 < z < 140Initial program 66.1%
Taylor expanded in t around inf
lower-*.f6423.4
Applied rewrites23.4%
Taylor expanded in y around 0
Applied rewrites20.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6434.7
Applied rewrites34.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (/ -1.0 z) x (/ (- t a) (- b y)))))
(if (<= z -1.05e-12)
t_1
(if (<= z -6.6e-87)
(/ (- (+ t (/ (* x y) z)) a) b)
(if (<= z 2.8e-164)
(+ x (* z (/ (- t a) y)))
(if (<= z 140.0) (/ (* 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 = fma((-1.0 / z), x, ((t - a) / (b - y)));
double tmp;
if (z <= -1.05e-12) {
tmp = t_1;
} else if (z <= -6.6e-87) {
tmp = ((t + ((x * y) / z)) - a) / b;
} else if (z <= 2.8e-164) {
tmp = x + (z * ((t - a) / y));
} else if (z <= 140.0) {
tmp = (z * (t - a)) / (y + (z * b));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(-1.0 / z), x, Float64(Float64(t - a) / Float64(b - y))) tmp = 0.0 if (z <= -1.05e-12) tmp = t_1; elseif (z <= -6.6e-87) tmp = Float64(Float64(Float64(t + Float64(Float64(x * y) / z)) - a) / b); elseif (z <= 2.8e-164) tmp = Float64(x + Float64(z * Float64(Float64(t - a) / y))); elseif (z <= 140.0) tmp = Float64(Float64(z * Float64(t - a)) / 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[(-1.0 / z), $MachinePrecision] * x + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e-12], t$95$1, If[LessEqual[z, -6.6e-87], N[(N[(N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[z, 2.8e-164], N[(x + N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 140.0], 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 := \mathsf{fma}\left(\frac{-1}{z}, x, \frac{t - a}{b - y}\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-87}:\\
\;\;\;\;\frac{\left(t + \frac{x \cdot y}{z}\right) - a}{b}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-164}:\\
\;\;\;\;x + z \cdot \frac{t - a}{y}\\
\mathbf{elif}\;z \leq 140:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.04999999999999997e-12 or 140 < z Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6467.8
Applied rewrites67.8%
Taylor expanded in z around inf
lower-/.f6449.7
Applied rewrites49.7%
if -1.04999999999999997e-12 < z < -6.6000000000000001e-87Initial program 66.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in b around inf
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.1
Applied rewrites40.1%
if -6.6000000000000001e-87 < z < 2.8000000000000001e-164Initial program 66.1%
Taylor expanded in b around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6441.7
Applied rewrites41.7%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6441.7
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity41.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f6433.8
Applied rewrites33.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6434.4
Applied rewrites34.4%
if 2.8000000000000001e-164 < z < 140Initial program 66.1%
Taylor expanded in t around inf
lower-*.f6423.4
Applied rewrites23.4%
Taylor expanded in y around 0
Applied rewrites20.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6434.7
Applied rewrites34.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -8.2e-87)
t_1
(if (<= z 2.8e-164)
(+ x (* z (/ (- t a) y)))
(if (<= z 1.0) (/ (* 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 <= -8.2e-87) {
tmp = t_1;
} else if (z <= 2.8e-164) {
tmp = x + (z * ((t - a) / y));
} else if (z <= 1.0) {
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 <= (-8.2d-87)) then
tmp = t_1
else if (z <= 2.8d-164) then
tmp = x + (z * ((t - a) / y))
else if (z <= 1.0d0) 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 <= -8.2e-87) {
tmp = t_1;
} else if (z <= 2.8e-164) {
tmp = x + (z * ((t - a) / y));
} else if (z <= 1.0) {
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 <= -8.2e-87: tmp = t_1 elif z <= 2.8e-164: tmp = x + (z * ((t - a) / y)) elif z <= 1.0: 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 <= -8.2e-87) tmp = t_1; elseif (z <= 2.8e-164) tmp = Float64(x + Float64(z * Float64(Float64(t - a) / y))); elseif (z <= 1.0) 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 <= -8.2e-87) tmp = t_1; elseif (z <= 2.8e-164) tmp = x + (z * ((t - a) / y)); elseif (z <= 1.0) 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, -8.2e-87], t$95$1, If[LessEqual[z, 2.8e-164], N[(x + N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], 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 -8.2 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-164}:\\
\;\;\;\;x + z \cdot \frac{t - a}{y}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.20000000000000066e-87 or 1 < z Initial program 66.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6452.6
Applied rewrites52.6%
if -8.20000000000000066e-87 < z < 2.8000000000000001e-164Initial program 66.1%
Taylor expanded in b around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6441.7
Applied rewrites41.7%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6441.7
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity41.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f6433.8
Applied rewrites33.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6434.4
Applied rewrites34.4%
if 2.8000000000000001e-164 < z < 1Initial program 66.1%
Taylor expanded in t around inf
lower-*.f6423.4
Applied rewrites23.4%
Taylor expanded in y around 0
Applied rewrites20.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6434.7
Applied rewrites34.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -8.2e-87) t_1 (if (<= z 6.8e-17) (+ 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 <= -8.2e-87) {
tmp = t_1;
} else if (z <= 6.8e-17) {
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 <= (-8.2d-87)) then
tmp = t_1
else if (z <= 6.8d-17) 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 <= -8.2e-87) {
tmp = t_1;
} else if (z <= 6.8e-17) {
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 <= -8.2e-87: tmp = t_1 elif z <= 6.8e-17: 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 <= -8.2e-87) tmp = t_1; elseif (z <= 6.8e-17) 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 <= -8.2e-87) tmp = t_1; elseif (z <= 6.8e-17) 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, -8.2e-87], t$95$1, If[LessEqual[z, 6.8e-17], 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 -8.2 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-17}:\\
\;\;\;\;x + z \cdot \frac{t - a}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.20000000000000066e-87 or 6.7999999999999996e-17 < z Initial program 66.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6452.6
Applied rewrites52.6%
if -8.20000000000000066e-87 < z < 6.7999999999999996e-17Initial program 66.1%
Taylor expanded in b around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6441.7
Applied rewrites41.7%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6441.7
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity41.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f6433.8
Applied rewrites33.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6434.4
Applied rewrites34.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -5e-87) t_1 (if (<= z 4.3e-153) (+ 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 <= -5e-87) {
tmp = t_1;
} else if (z <= 4.3e-153) {
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 <= (-5d-87)) then
tmp = t_1
else if (z <= 4.3d-153) 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 <= -5e-87) {
tmp = t_1;
} else if (z <= 4.3e-153) {
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 <= -5e-87: tmp = t_1 elif z <= 4.3e-153: 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 <= -5e-87) tmp = t_1; elseif (z <= 4.3e-153) 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 <= -5e-87) tmp = t_1; elseif (z <= 4.3e-153) 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, -5e-87], t$95$1, If[LessEqual[z, 4.3e-153], 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 -5 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-153}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.00000000000000042e-87 or 4.3e-153 < z Initial program 66.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6452.6
Applied rewrites52.6%
if -5.00000000000000042e-87 < z < 4.3e-153Initial program 66.1%
Taylor expanded in b around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6441.7
Applied rewrites41.7%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6441.7
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity41.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f6433.8
Applied rewrites33.8%
Taylor expanded in x around inf
lower-*.f6425.0
Applied rewrites25.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -5.8e+39) t_1 (if (<= y 4.6e+38) (/ (- t a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -5.8e+39) {
tmp = t_1;
} else if (y <= 4.6e+38) {
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 / (1.0d0 - z)
if (y <= (-5.8d+39)) then
tmp = t_1
else if (y <= 4.6d+38) 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 / (1.0 - z);
double tmp;
if (y <= -5.8e+39) {
tmp = t_1;
} else if (y <= 4.6e+38) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -5.8e+39: tmp = t_1 elif y <= 4.6e+38: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -5.8e+39) tmp = t_1; elseif (y <= 4.6e+38) 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 / (1.0 - z); tmp = 0.0; if (y <= -5.8e+39) tmp = t_1; elseif (y <= 4.6e+38) 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[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e+39], t$95$1, If[LessEqual[y, 4.6e+38], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+38}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.80000000000000059e39 or 4.6000000000000002e38 < y Initial program 66.1%
Taylor expanded in b around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6441.7
Applied rewrites41.7%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6441.7
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity41.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6432.6
Applied rewrites32.6%
if -5.80000000000000059e39 < y < 4.6000000000000002e38Initial program 66.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6435.6
Applied rewrites35.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -1.85e+34) t_1 (if (<= y 11000000.0) (/ t b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -1.85e+34) {
tmp = t_1;
} else if (y <= 11000000.0) {
tmp = t / 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 / (1.0d0 - z)
if (y <= (-1.85d+34)) then
tmp = t_1
else if (y <= 11000000.0d0) then
tmp = t / 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 / (1.0 - z);
double tmp;
if (y <= -1.85e+34) {
tmp = t_1;
} else if (y <= 11000000.0) {
tmp = t / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -1.85e+34: tmp = t_1 elif y <= 11000000.0: tmp = t / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -1.85e+34) tmp = t_1; elseif (y <= 11000000.0) tmp = Float64(t / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -1.85e+34) tmp = t_1; elseif (y <= 11000000.0) tmp = t / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.85e+34], t$95$1, If[LessEqual[y, 11000000.0], N[(t / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 11000000:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.85000000000000004e34 or 1.1e7 < y Initial program 66.1%
Taylor expanded in b around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6441.7
Applied rewrites41.7%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6441.7
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity41.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6432.6
Applied rewrites32.6%
if -1.85000000000000004e34 < y < 1.1e7Initial program 66.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6435.6
Applied rewrites35.6%
Taylor expanded in t around inf
lower-/.f6420.2
Applied rewrites20.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ x (* x z)))) (if (<= y -1.85e+34) t_1 (if (<= y 1.7e+38) (/ t b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (x * z);
double tmp;
if (y <= -1.85e+34) {
tmp = t_1;
} else if (y <= 1.7e+38) {
tmp = t / 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 + (x * z)
if (y <= (-1.85d+34)) then
tmp = t_1
else if (y <= 1.7d+38) then
tmp = t / 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 + (x * z);
double tmp;
if (y <= -1.85e+34) {
tmp = t_1;
} else if (y <= 1.7e+38) {
tmp = t / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (x * z) tmp = 0 if y <= -1.85e+34: tmp = t_1 elif y <= 1.7e+38: tmp = t / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(x * z)) tmp = 0.0 if (y <= -1.85e+34) tmp = t_1; elseif (y <= 1.7e+38) tmp = Float64(t / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (x * z); tmp = 0.0; if (y <= -1.85e+34) tmp = t_1; elseif (y <= 1.7e+38) tmp = t / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.85e+34], t$95$1, If[LessEqual[y, 1.7e+38], N[(t / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + x \cdot z\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+38}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.85000000000000004e34 or 1.69999999999999998e38 < y Initial program 66.1%
Taylor expanded in b around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6441.7
Applied rewrites41.7%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6441.7
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity41.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f6433.8
Applied rewrites33.8%
Taylor expanded in x around inf
lower-*.f6425.0
Applied rewrites25.0%
if -1.85000000000000004e34 < y < 1.69999999999999998e38Initial program 66.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6435.6
Applied rewrites35.6%
Taylor expanded in t around inf
lower-/.f6420.2
Applied rewrites20.2%
(FPCore (x y z t a b) :precision binary64 (/ t b))
double code(double x, double y, double z, double t, double a, double b) {
return t / b;
}
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 = t / b
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return t / b;
}
def code(x, y, z, t, a, b): return t / b
function code(x, y, z, t, a, b) return Float64(t / b) end
function tmp = code(x, y, z, t, a, b) tmp = t / b; end
code[x_, y_, z_, t_, a_, b_] := N[(t / b), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{b}
\end{array}
Initial program 66.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6435.6
Applied rewrites35.6%
Taylor expanded in t around inf
lower-/.f6420.2
Applied rewrites20.2%
herbie shell --seed 2025159
(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)))))