
(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}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_3 (fma (- t a) (/ z t_1) (* y (/ x t_1)))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -1e-277)
t_2
(if (<= t_2 0.0)
(-
(/
(+
(/
(* (/ (fma (- x) y (/ (* (- t a) y) (- b y))) (- b y)) y)
(* z z))
(fma (/ y z) x t))
(- b y))
(/ (+ (/ (* y (/ (- t a) z)) (- b y)) a) (- b y)))
(if (<= t_2 5e+260)
t_2
(if (<= t_2 INFINITY) t_3 (/ (- t a) (- b y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((b - y), z, y);
double t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_3 = fma((t - a), (z / t_1), (y * (x / t_1)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -1e-277) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (((((fma(-x, y, (((t - a) * y) / (b - y))) / (b - y)) * y) / (z * z)) + fma((y / z), x, t)) / (b - y)) - ((((y * ((t - a) / z)) / (b - y)) + a) / (b - y));
} else if (t_2 <= 5e+260) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_3 = fma(Float64(t - a), Float64(z / t_1), Float64(y * Float64(x / t_1))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -1e-277) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(fma(Float64(-x), y, Float64(Float64(Float64(t - a) * y) / Float64(b - y))) / Float64(b - y)) * y) / Float64(z * z)) + fma(Float64(y / z), x, t)) / Float64(b - y)) - Float64(Float64(Float64(Float64(y * Float64(Float64(t - a) / z)) / Float64(b - y)) + a) / Float64(b - y))); elseif (t_2 <= 5e+260) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(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[(t - a), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision] + N[(y * N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -1e-277], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(N[(N[(N[(N[(N[((-x) * y + N[(N[(N[(t - a), $MachinePrecision] * y), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * x + t), $MachinePrecision]), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(y * N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+260], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_3 := \mathsf{fma}\left(t - a, \frac{z}{t\_1}, y \cdot \frac{x}{t\_1}\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-277}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\frac{\frac{\mathsf{fma}\left(-x, y, \frac{\left(t - a\right) \cdot y}{b - y}\right)}{b - y} \cdot y}{z \cdot z} + \mathsf{fma}\left(\frac{y}{z}, x, t\right)}{b - y} - \frac{\frac{y \cdot \frac{t - a}{z}}{b - y} + a}{b - y}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+260}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 4.9999999999999996e260 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 27.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/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
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -9.99999999999999969e-278 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.9999999999999996e260Initial program 99.6%
if -9.99999999999999969e-278 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 11.2%
Taylor expanded in z around inf
Applied rewrites88.2%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 0.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.8
Applied rewrites84.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_3 (fma (- t a) (/ z t_1) (* y (/ x t_1)))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 5e+260) t_2 (if (<= t_2 INFINITY) t_3 (/ (- t a) (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((b - y), z, y);
double t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_3 = fma((t - a), (z / t_1), (y * (x / t_1)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= 5e+260) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_3 = fma(Float64(t - a), Float64(z / t_1), Float64(y * Float64(x / t_1))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= 5e+260) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(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[(t - a), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision] + N[(y * N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 5e+260], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_3 := \mathsf{fma}\left(t - a, \frac{z}{t\_1}, y \cdot \frac{x}{t\_1}\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+260}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 4.9999999999999996e260 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 27.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/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
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.9999999999999996e260Initial program 90.4%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 0.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.8
Applied rewrites84.8%
(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 -9000000.0)
t_2
(if (<= z -4.4e-33)
(* (/ x t_1) y)
(if (<= z -3.8e-70)
(* (/ z (fma b z y)) (- t a))
(if (<= z 1.15e-147)
(/ (+ (* x y) (* z (- t a))) y)
(if (<= z 1.35e+16) (* (- t a) (/ z 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 <= -9000000.0) {
tmp = t_2;
} else if (z <= -4.4e-33) {
tmp = (x / t_1) * y;
} else if (z <= -3.8e-70) {
tmp = (z / fma(b, z, y)) * (t - a);
} else if (z <= 1.15e-147) {
tmp = ((x * y) + (z * (t - a))) / y;
} else if (z <= 1.35e+16) {
tmp = (t - a) * (z / 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 <= -9000000.0) tmp = t_2; elseif (z <= -4.4e-33) tmp = Float64(Float64(x / t_1) * y); elseif (z <= -3.8e-70) tmp = Float64(Float64(z / fma(b, z, y)) * Float64(t - a)); elseif (z <= 1.15e-147) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / y); elseif (z <= 1.35e+16) tmp = Float64(Float64(t - a) * Float64(z / 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, -9000000.0], t$95$2, If[LessEqual[z, -4.4e-33], N[(N[(x / t$95$1), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, -3.8e-70], N[(N[(z / N[(b * z + y), $MachinePrecision]), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e-147], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.35e+16], N[(N[(t - a), $MachinePrecision] * N[(z / t$95$1), $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 -9000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{t\_1} \cdot y\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-70}:\\
\;\;\;\;\frac{z}{\mathsf{fma}\left(b, z, y\right)} \cdot \left(t - a\right)\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-147}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y}\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+16}:\\
\;\;\;\;\left(t - a\right) \cdot \frac{z}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -9e6 or 1.35e16 < z Initial program 39.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6485.4
Applied rewrites85.4%
if -9e6 < z < -4.40000000000000011e-33Initial program 74.7%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/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
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
Taylor expanded in x around inf
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
div-add-revN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
Applied rewrites81.0%
if -4.40000000000000011e-33 < z < -3.7999999999999998e-70Initial program 78.0%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/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
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
Taylor expanded in x around 0
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
div-add-revN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-*r/N/A
Applied rewrites66.8%
Taylor expanded in y around 0
Applied rewrites66.8%
if -3.7999999999999998e-70 < z < 1.14999999999999995e-147Initial program 92.0%
Taylor expanded in z around 0
Applied rewrites74.1%
if 1.14999999999999995e-147 < z < 1.35e16Initial program 89.9%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6467.9
Applied rewrites67.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))) (t_2 (* (/ z (fma b z y)) (- t a))))
(if (<= z -9000000.0)
t_1
(if (<= z -4.4e-33)
(* (/ x (fma (- b y) z y)) y)
(if (<= z -3.8e-70)
t_2
(if (<= z 1.15e-147)
(/ (+ (* x y) (* z (- t a))) y)
(if (<= z 1.0) t_2 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double t_2 = (z / fma(b, z, y)) * (t - a);
double tmp;
if (z <= -9000000.0) {
tmp = t_1;
} else if (z <= -4.4e-33) {
tmp = (x / fma((b - y), z, y)) * y;
} else if (z <= -3.8e-70) {
tmp = t_2;
} else if (z <= 1.15e-147) {
tmp = ((x * y) + (z * (t - a))) / y;
} else if (z <= 1.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = Float64(Float64(z / fma(b, z, y)) * Float64(t - a)) tmp = 0.0 if (z <= -9000000.0) tmp = t_1; elseif (z <= -4.4e-33) tmp = Float64(Float64(x / fma(Float64(b - y), z, y)) * y); elseif (z <= -3.8e-70) tmp = t_2; elseif (z <= 1.15e-147) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / y); elseif (z <= 1.0) tmp = t_2; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z / N[(b * z + y), $MachinePrecision]), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9000000.0], t$95$1, If[LessEqual[z, -4.4e-33], N[(N[(x / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, -3.8e-70], t$95$2, If[LessEqual[z, 1.15e-147], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.0], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := \frac{z}{\mathsf{fma}\left(b, z, y\right)} \cdot \left(t - a\right)\\
\mathbf{if}\;z \leq -9000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(b - y, z, y\right)} \cdot y\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-70}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-147}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9e6 or 1 < z Initial program 40.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.4
Applied rewrites84.4%
if -9e6 < z < -4.40000000000000011e-33Initial program 74.7%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/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
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
Taylor expanded in x around inf
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
div-add-revN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
Applied rewrites81.0%
if -4.40000000000000011e-33 < z < -3.7999999999999998e-70 or 1.14999999999999995e-147 < z < 1Initial program 87.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/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
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6491.6
Applied rewrites91.6%
Taylor expanded in x around 0
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
div-add-revN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-*r/N/A
Applied rewrites68.2%
Taylor expanded in y around 0
Applied rewrites68.2%
if -3.7999999999999998e-70 < z < 1.14999999999999995e-147Initial program 92.0%
Taylor expanded in z around 0
Applied rewrites74.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (/ (- t a) (- b y)))
(t_3 (* (/ z (fma b z y)) (- t a))))
(if (<= z -9000000.0)
t_2
(if (<= z -4.4e-33)
(* (/ x t_1) y)
(if (<= z -4.5e-175)
t_3
(if (<= z 6e-197) (* (/ y t_1) x) (if (<= z 1.0) t_3 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 t_3 = (z / fma(b, z, y)) * (t - a);
double tmp;
if (z <= -9000000.0) {
tmp = t_2;
} else if (z <= -4.4e-33) {
tmp = (x / t_1) * y;
} else if (z <= -4.5e-175) {
tmp = t_3;
} else if (z <= 6e-197) {
tmp = (y / t_1) * x;
} else if (z <= 1.0) {
tmp = t_3;
} 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)) t_3 = Float64(Float64(z / fma(b, z, y)) * Float64(t - a)) tmp = 0.0 if (z <= -9000000.0) tmp = t_2; elseif (z <= -4.4e-33) tmp = Float64(Float64(x / t_1) * y); elseif (z <= -4.5e-175) tmp = t_3; elseif (z <= 6e-197) tmp = Float64(Float64(y / t_1) * x); elseif (z <= 1.0) tmp = t_3; 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]}, Block[{t$95$3 = N[(N[(z / N[(b * z + y), $MachinePrecision]), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9000000.0], t$95$2, If[LessEqual[z, -4.4e-33], N[(N[(x / t$95$1), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, -4.5e-175], t$95$3, If[LessEqual[z, 6e-197], N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.0], t$95$3, 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}\\
t_3 := \frac{z}{\mathsf{fma}\left(b, z, y\right)} \cdot \left(t - a\right)\\
\mathbf{if}\;z \leq -9000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{t\_1} \cdot y\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-175}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-197}:\\
\;\;\;\;\frac{y}{t\_1} \cdot x\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -9e6 or 1 < z Initial program 40.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.4
Applied rewrites84.4%
if -9e6 < z < -4.40000000000000011e-33Initial program 74.7%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/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
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
Taylor expanded in x around inf
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
div-add-revN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
Applied rewrites81.0%
if -4.40000000000000011e-33 < z < -4.49999999999999998e-175 or 6.00000000000000051e-197 < z < 1Initial program 90.4%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/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
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6493.5
Applied rewrites93.5%
Taylor expanded in x around 0
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
div-add-revN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-*r/N/A
Applied rewrites68.4%
Taylor expanded in y around 0
Applied rewrites68.4%
if -4.49999999999999998e-175 < z < 6.00000000000000051e-197Initial program 89.1%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6473.6
Applied rewrites73.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.4e+40) (not (<= z 5e+19))) (/ (- t a) (- b y)) (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.4e+40) || !(z <= 5e+19)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - 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 <= (-4.4d+40)) .or. (.not. (z <= 5d+19))) then
tmp = (t - a) / (b - y)
else
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - 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 <= -4.4e+40) || !(z <= 5e+19)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.4e+40) or not (z <= 5e+19): tmp = (t - a) / (b - y) else: tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.4e+40) || !(z <= 5e+19)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4.4e+40) || ~((z <= 5e+19))) tmp = (t - a) / (b - y); else tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.4e+40], N[Not[LessEqual[z, 5e+19]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+40} \lor \neg \left(z \leq 5 \cdot 10^{+19}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -4.3999999999999998e40 or 5e19 < z Initial program 37.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6485.8
Applied rewrites85.8%
if -4.3999999999999998e40 < z < 5e19Initial program 87.9%
Final simplification86.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -9000000.0)
t_1
(if (<= z -3.4e-70)
(* (/ x (fma (- b y) z y)) y)
(if (<= z -1.52e-276)
(/ (fma x y (* z t)) y)
(if (<= z 6.2e-34) (/ (fma (- a) z (* x y)) y) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -9000000.0) {
tmp = t_1;
} else if (z <= -3.4e-70) {
tmp = (x / fma((b - y), z, y)) * y;
} else if (z <= -1.52e-276) {
tmp = fma(x, y, (z * t)) / y;
} else if (z <= 6.2e-34) {
tmp = fma(-a, z, (x * y)) / y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -9000000.0) tmp = t_1; elseif (z <= -3.4e-70) tmp = Float64(Float64(x / fma(Float64(b - y), z, y)) * y); elseif (z <= -1.52e-276) tmp = Float64(fma(x, y, Float64(z * t)) / y); elseif (z <= 6.2e-34) tmp = Float64(fma(Float64(-a), z, Float64(x * y)) / y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9000000.0], t$95$1, If[LessEqual[z, -3.4e-70], N[(N[(x / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, -1.52e-276], N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 6.2e-34], N[(N[((-a) * z + N[(x * y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -9000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-70}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(b - y, z, y\right)} \cdot y\\
\mathbf{elif}\;z \leq -1.52 \cdot 10^{-276}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot t\right)}{y}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-34}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-a, z, x \cdot y\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9e6 or 6.1999999999999996e-34 < z Initial program 42.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.6
Applied rewrites83.6%
if -9e6 < z < -3.39999999999999995e-70Initial program 76.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/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
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6493.9
Applied rewrites93.9%
Taylor expanded in x around inf
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
div-add-revN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
Applied rewrites54.7%
if -3.39999999999999995e-70 < z < -1.51999999999999994e-276Initial program 96.5%
Taylor expanded in z around 0
Applied rewrites72.5%
Taylor expanded in a around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6464.9
Applied rewrites64.9%
if -1.51999999999999994e-276 < z < 6.1999999999999996e-34Initial program 89.1%
Taylor expanded in z around 0
Applied rewrites65.6%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6459.9
Applied rewrites59.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -135000.0)
t_1
(if (<= z -3.4e-70)
(* (/ y (fma (- z) y y)) x)
(if (<= z -1.52e-276)
(/ (fma x y (* z t)) y)
(if (<= z 6.2e-34) (/ (fma (- a) z (* x y)) y) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -135000.0) {
tmp = t_1;
} else if (z <= -3.4e-70) {
tmp = (y / fma(-z, y, y)) * x;
} else if (z <= -1.52e-276) {
tmp = fma(x, y, (z * t)) / y;
} else if (z <= 6.2e-34) {
tmp = fma(-a, z, (x * y)) / y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -135000.0) tmp = t_1; elseif (z <= -3.4e-70) tmp = Float64(Float64(y / fma(Float64(-z), y, y)) * x); elseif (z <= -1.52e-276) tmp = Float64(fma(x, y, Float64(z * t)) / y); elseif (z <= 6.2e-34) tmp = Float64(fma(Float64(-a), z, Float64(x * y)) / y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -135000.0], t$95$1, If[LessEqual[z, -3.4e-70], N[(N[(y / N[((-z) * y + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, -1.52e-276], N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 6.2e-34], N[(N[((-a) * z + N[(x * y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -135000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-70}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(-z, y, y\right)} \cdot x\\
\mathbf{elif}\;z \leq -1.52 \cdot 10^{-276}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot t\right)}{y}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-34}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-a, z, x \cdot y\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -135000 or 6.1999999999999996e-34 < z Initial program 43.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.1
Applied rewrites83.1%
if -135000 < z < -3.39999999999999995e-70Initial program 75.7%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6454.0
Applied rewrites54.0%
Taylor expanded in b around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6447.8
Applied rewrites47.8%
if -3.39999999999999995e-70 < z < -1.51999999999999994e-276Initial program 96.5%
Taylor expanded in z around 0
Applied rewrites72.5%
Taylor expanded in a around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6464.9
Applied rewrites64.9%
if -1.51999999999999994e-276 < z < 6.1999999999999996e-34Initial program 89.1%
Taylor expanded in z around 0
Applied rewrites65.6%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6459.9
Applied rewrites59.9%
Final simplification71.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -0.046)
t_1
(if (<= z 7.5e-125)
(fma z (/ (- t a) y) (* x (/ y y)))
(if (<= z 1.35e+16) (* (- t a) (/ z (fma (- b y) z y))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -0.046) {
tmp = t_1;
} else if (z <= 7.5e-125) {
tmp = fma(z, ((t - a) / y), (x * (y / y)));
} else if (z <= 1.35e+16) {
tmp = (t - a) * (z / fma((b - y), z, y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -0.046) tmp = t_1; elseif (z <= 7.5e-125) tmp = fma(z, Float64(Float64(t - a) / y), Float64(x * Float64(y / y))); elseif (z <= 1.35e+16) tmp = Float64(Float64(t - a) * Float64(z / fma(Float64(b - y), z, y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.046], t$95$1, If[LessEqual[z, 7.5e-125], N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision] + N[(x * N[(y / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e+16], N[(N[(t - a), $MachinePrecision] * N[(z / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -0.046:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-125}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{y}, x \cdot \frac{y}{y}\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+16}:\\
\;\;\;\;\left(t - a\right) \cdot \frac{z}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.045999999999999999 or 1.35e16 < z Initial program 41.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.3
Applied rewrites84.3%
if -0.045999999999999999 < z < 7.5e-125Initial program 85.3%
Taylor expanded in z around 0
Applied rewrites61.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6470.9
Applied rewrites70.9%
if 7.5e-125 < z < 1.35e16Initial program 93.6%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6470.2
Applied rewrites70.2%
(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 -3.9e+31)
t_2
(if (<= z 6.8e-197)
(/ (fma t z (* y x)) t_1)
(if (<= z 1.35e+16) (* (- t a) (/ z 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 <= -3.9e+31) {
tmp = t_2;
} else if (z <= 6.8e-197) {
tmp = fma(t, z, (y * x)) / t_1;
} else if (z <= 1.35e+16) {
tmp = (t - a) * (z / 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 <= -3.9e+31) tmp = t_2; elseif (z <= 6.8e-197) tmp = Float64(fma(t, z, Float64(y * x)) / t_1); elseif (z <= 1.35e+16) tmp = Float64(Float64(t - a) * Float64(z / 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, -3.9e+31], t$95$2, If[LessEqual[z, 6.8e-197], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 1.35e+16], N[(N[(t - a), $MachinePrecision] * N[(z / t$95$1), $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 -3.9 \cdot 10^{+31}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-197}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{t\_1}\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+16}:\\
\;\;\;\;\left(t - a\right) \cdot \frac{z}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -3.89999999999999999e31 or 1.35e16 < z Initial program 38.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6485.9
Applied rewrites85.9%
if -3.89999999999999999e31 < z < 6.7999999999999996e-197Initial program 86.6%
Taylor expanded in a around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6468.3
Applied rewrites68.3%
if 6.7999999999999996e-197 < z < 1.35e16Initial program 90.7%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6467.8
Applied rewrites67.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -0.15)
t_1
(if (<= z 1.65e-255)
(* (/ y (fma (- b y) z y)) x)
(if (<= z 6.2e-34) (/ (fma (- a) z (* x y)) y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -0.15) {
tmp = t_1;
} else if (z <= 1.65e-255) {
tmp = (y / fma((b - y), z, y)) * x;
} else if (z <= 6.2e-34) {
tmp = fma(-a, z, (x * y)) / y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -0.15) tmp = t_1; elseif (z <= 1.65e-255) tmp = Float64(Float64(y / fma(Float64(b - y), z, y)) * x); elseif (z <= 6.2e-34) tmp = Float64(fma(Float64(-a), z, Float64(x * y)) / y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.15], t$95$1, If[LessEqual[z, 1.65e-255], N[(N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 6.2e-34], N[(N[((-a) * z + N[(x * y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -0.15:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-255}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(b - y, z, y\right)} \cdot x\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-34}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-a, z, x \cdot y\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.149999999999999994 or 6.1999999999999996e-34 < z Initial program 43.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6482.6
Applied rewrites82.6%
if -0.149999999999999994 < z < 1.64999999999999994e-255Initial program 84.3%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6459.5
Applied rewrites59.5%
if 1.64999999999999994e-255 < z < 6.1999999999999996e-34Initial program 91.8%
Taylor expanded in z around 0
Applied rewrites63.4%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6455.9
Applied rewrites55.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -135000.0)
t_1
(if (<= z 3.9e-123)
(* (/ y (fma (- z) y y)) x)
(if (<= z 2.1e-29) (/ (* (- t a) z) y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -135000.0) {
tmp = t_1;
} else if (z <= 3.9e-123) {
tmp = (y / fma(-z, y, y)) * x;
} else if (z <= 2.1e-29) {
tmp = ((t - a) * z) / y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -135000.0) tmp = t_1; elseif (z <= 3.9e-123) tmp = Float64(Float64(y / fma(Float64(-z), y, y)) * x); elseif (z <= 2.1e-29) tmp = Float64(Float64(Float64(t - a) * z) / y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -135000.0], t$95$1, If[LessEqual[z, 3.9e-123], N[(N[(y / N[((-z) * y + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 2.1e-29], N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -135000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-123}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(-z, y, y\right)} \cdot x\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-29}:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -135000 or 2.09999999999999989e-29 < z Initial program 42.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.7
Applied rewrites83.7%
if -135000 < z < 3.89999999999999976e-123Initial program 85.7%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6457.6
Applied rewrites57.6%
Taylor expanded in b around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6452.2
Applied rewrites52.2%
if 3.89999999999999976e-123 < z < 2.09999999999999989e-29Initial program 95.6%
Taylor expanded in z around 0
Applied rewrites62.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6450.3
Applied rewrites50.3%
Final simplification68.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -135000.0)
t_1
(if (<= z 3.9e-123)
(/ x (- 1.0 z))
(if (<= z 2.1e-29) (/ (* (- t a) z) y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -135000.0) {
tmp = t_1;
} else if (z <= 3.9e-123) {
tmp = x / (1.0 - z);
} else if (z <= 2.1e-29) {
tmp = ((t - a) * z) / 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 <= (-135000.0d0)) then
tmp = t_1
else if (z <= 3.9d-123) then
tmp = x / (1.0d0 - z)
else if (z <= 2.1d-29) then
tmp = ((t - a) * z) / 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 <= -135000.0) {
tmp = t_1;
} else if (z <= 3.9e-123) {
tmp = x / (1.0 - z);
} else if (z <= 2.1e-29) {
tmp = ((t - a) * z) / 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 <= -135000.0: tmp = t_1 elif z <= 3.9e-123: tmp = x / (1.0 - z) elif z <= 2.1e-29: tmp = ((t - a) * z) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -135000.0) tmp = t_1; elseif (z <= 3.9e-123) tmp = Float64(x / Float64(1.0 - z)); elseif (z <= 2.1e-29) tmp = Float64(Float64(Float64(t - a) * z) / 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 <= -135000.0) tmp = t_1; elseif (z <= 3.9e-123) tmp = x / (1.0 - z); elseif (z <= 2.1e-29) tmp = ((t - a) * z) / 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, -135000.0], t$95$1, If[LessEqual[z, 3.9e-123], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-29], N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -135000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-123}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-29}:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -135000 or 2.09999999999999989e-29 < z Initial program 42.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.7
Applied rewrites83.7%
if -135000 < z < 3.89999999999999976e-123Initial program 85.7%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6452.2
Applied rewrites52.2%
if 3.89999999999999976e-123 < z < 2.09999999999999989e-29Initial program 95.6%
Taylor expanded in z around 0
Applied rewrites62.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6450.3
Applied rewrites50.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -135000.0)
t_1
(if (<= z 1.3e-122)
(/ x (- 1.0 z))
(if (<= z 2.1e-29) (* (/ z y) (- t a)) 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 <= -135000.0) {
tmp = t_1;
} else if (z <= 1.3e-122) {
tmp = x / (1.0 - z);
} else if (z <= 2.1e-29) {
tmp = (z / y) * (t - a);
} 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 <= (-135000.0d0)) then
tmp = t_1
else if (z <= 1.3d-122) then
tmp = x / (1.0d0 - z)
else if (z <= 2.1d-29) then
tmp = (z / y) * (t - a)
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 <= -135000.0) {
tmp = t_1;
} else if (z <= 1.3e-122) {
tmp = x / (1.0 - z);
} else if (z <= 2.1e-29) {
tmp = (z / y) * (t - a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -135000.0: tmp = t_1 elif z <= 1.3e-122: tmp = x / (1.0 - z) elif z <= 2.1e-29: tmp = (z / y) * (t - a) 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 <= -135000.0) tmp = t_1; elseif (z <= 1.3e-122) tmp = Float64(x / Float64(1.0 - z)); elseif (z <= 2.1e-29) tmp = Float64(Float64(z / y) * Float64(t - a)); 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 <= -135000.0) tmp = t_1; elseif (z <= 1.3e-122) tmp = x / (1.0 - z); elseif (z <= 2.1e-29) tmp = (z / y) * (t - a); 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, -135000.0], t$95$1, If[LessEqual[z, 1.3e-122], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-29], N[(N[(z / y), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -135000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-122}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-29}:\\
\;\;\;\;\frac{z}{y} \cdot \left(t - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -135000 or 2.09999999999999989e-29 < z Initial program 42.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.7
Applied rewrites83.7%
if -135000 < z < 1.29999999999999988e-122Initial program 85.7%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6452.2
Applied rewrites52.2%
if 1.29999999999999988e-122 < z < 2.09999999999999989e-29Initial program 95.6%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/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
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
Taylor expanded in x around 0
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
div-add-revN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-*r/N/A
Applied rewrites64.2%
Taylor expanded in z around 0
+-commutative48.2
*-commutative48.2
Applied rewrites48.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -2.05e+96)
t_1
(if (<= y -4e-42)
(/ (- t a) (- y))
(if (<= y 24000000.0) (/ (- 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 <= -2.05e+96) {
tmp = t_1;
} else if (y <= -4e-42) {
tmp = (t - a) / -y;
} else if (y <= 24000000.0) {
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 <= (-2.05d+96)) then
tmp = t_1
else if (y <= (-4d-42)) then
tmp = (t - a) / -y
else if (y <= 24000000.0d0) 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 <= -2.05e+96) {
tmp = t_1;
} else if (y <= -4e-42) {
tmp = (t - a) / -y;
} else if (y <= 24000000.0) {
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 <= -2.05e+96: tmp = t_1 elif y <= -4e-42: tmp = (t - a) / -y elif y <= 24000000.0: 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 <= -2.05e+96) tmp = t_1; elseif (y <= -4e-42) tmp = Float64(Float64(t - a) / Float64(-y)); elseif (y <= 24000000.0) 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 <= -2.05e+96) tmp = t_1; elseif (y <= -4e-42) tmp = (t - a) / -y; elseif (y <= 24000000.0) 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, -2.05e+96], t$95$1, If[LessEqual[y, -4e-42], N[(N[(t - a), $MachinePrecision] / (-y)), $MachinePrecision], If[LessEqual[y, 24000000.0], 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 -2.05 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4 \cdot 10^{-42}:\\
\;\;\;\;\frac{t - a}{-y}\\
\mathbf{elif}\;y \leq 24000000:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.04999999999999999e96 or 2.4e7 < y Initial program 51.2%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6452.0
Applied rewrites52.0%
if -2.04999999999999999e96 < y < -4.00000000000000015e-42Initial program 53.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6456.5
Applied rewrites56.5%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6441.9
Applied rewrites41.9%
if -4.00000000000000015e-42 < y < 2.4e7Initial program 77.2%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6462.5
Applied rewrites62.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= t -1.2e-19)
t_1
(if (<= t 8e+15) (/ x (- 1.0 z)) (if (<= t 2.9e+55) (/ (- a) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (t <= -1.2e-19) {
tmp = t_1;
} else if (t <= 8e+15) {
tmp = x / (1.0 - z);
} else if (t <= 2.9e+55) {
tmp = -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 = t / (b - y)
if (t <= (-1.2d-19)) then
tmp = t_1
else if (t <= 8d+15) then
tmp = x / (1.0d0 - z)
else if (t <= 2.9d+55) then
tmp = -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 = t / (b - y);
double tmp;
if (t <= -1.2e-19) {
tmp = t_1;
} else if (t <= 8e+15) {
tmp = x / (1.0 - z);
} else if (t <= 2.9e+55) {
tmp = -a / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if t <= -1.2e-19: tmp = t_1 elif t <= 8e+15: tmp = x / (1.0 - z) elif t <= 2.9e+55: tmp = -a / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (t <= -1.2e-19) tmp = t_1; elseif (t <= 8e+15) tmp = Float64(x / Float64(1.0 - z)); elseif (t <= 2.9e+55) tmp = Float64(Float64(-a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (t <= -1.2e-19) tmp = t_1; elseif (t <= 8e+15) tmp = x / (1.0 - z); elseif (t <= 2.9e+55) tmp = -a / b; else tmp = t_1; 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[t, -1.2e-19], t$95$1, If[LessEqual[t, 8e+15], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e+55], N[((-a) / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;t \leq -1.2 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8 \cdot 10^{+15}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+55}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.20000000000000011e-19 or 2.8999999999999999e55 < t Initial program 60.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6463.3
Applied rewrites63.3%
Taylor expanded in t around inf
Applied rewrites52.5%
if -1.20000000000000011e-19 < t < 8e15Initial program 68.4%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6443.5
Applied rewrites43.5%
if 8e15 < t < 2.8999999999999999e55Initial program 56.7%
Taylor expanded in b around inf
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6445.7
Applied rewrites45.7%
Taylor expanded in a around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6473.3
Applied rewrites73.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -6.5e-44)
t_1
(if (<= y 2.8e-171) (/ t b) (if (<= y 1.6e-102) (/ (- 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 <= -6.5e-44) {
tmp = t_1;
} else if (y <= 2.8e-171) {
tmp = t / b;
} else if (y <= 1.6e-102) {
tmp = -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 <= (-6.5d-44)) then
tmp = t_1
else if (y <= 2.8d-171) then
tmp = t / b
else if (y <= 1.6d-102) then
tmp = -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 <= -6.5e-44) {
tmp = t_1;
} else if (y <= 2.8e-171) {
tmp = t / b;
} else if (y <= 1.6e-102) {
tmp = -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 <= -6.5e-44: tmp = t_1 elif y <= 2.8e-171: tmp = t / b elif y <= 1.6e-102: tmp = -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 <= -6.5e-44) tmp = t_1; elseif (y <= 2.8e-171) tmp = Float64(t / b); elseif (y <= 1.6e-102) tmp = Float64(Float64(-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 <= -6.5e-44) tmp = t_1; elseif (y <= 2.8e-171) tmp = t / b; elseif (y <= 1.6e-102) tmp = -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, -6.5e-44], t$95$1, If[LessEqual[y, 2.8e-171], N[(t / b), $MachinePrecision], If[LessEqual[y, 1.6e-102], N[((-a) / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-171}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-102}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.5e-44 or 1.59999999999999993e-102 < y Initial program 56.9%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6443.5
Applied rewrites43.5%
if -6.5e-44 < y < 2.80000000000000023e-171Initial program 74.7%
Taylor expanded in b around inf
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
Taylor expanded in t around inf
lower-/.f6442.0
Applied rewrites42.0%
if 2.80000000000000023e-171 < y < 1.59999999999999993e-102Initial program 77.7%
Taylor expanded in b around inf
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6452.2
Applied rewrites52.2%
Taylor expanded in a around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6443.0
Applied rewrites43.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -135000.0) (not (<= z 1.8e-131))) (/ (- t a) (- b y)) (/ x (- 1.0 z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -135000.0) || !(z <= 1.8e-131)) {
tmp = (t - a) / (b - y);
} else {
tmp = x / (1.0 - z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, 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 <= (-135000.0d0)) .or. (.not. (z <= 1.8d-131))) then
tmp = (t - a) / (b - y)
else
tmp = x / (1.0d0 - z)
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 <= -135000.0) || !(z <= 1.8e-131)) {
tmp = (t - a) / (b - y);
} else {
tmp = x / (1.0 - z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -135000.0) or not (z <= 1.8e-131): tmp = (t - a) / (b - y) else: tmp = x / (1.0 - z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -135000.0) || !(z <= 1.8e-131)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x / Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -135000.0) || ~((z <= 1.8e-131))) tmp = (t - a) / (b - y); else tmp = x / (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -135000.0], N[Not[LessEqual[z, 1.8e-131]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -135000 \lor \neg \left(z \leq 1.8 \cdot 10^{-131}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - z}\\
\end{array}
\end{array}
if z < -135000 or 1.8e-131 < z Initial program 51.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6474.8
Applied rewrites74.8%
if -135000 < z < 1.8e-131Initial program 85.3%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6452.7
Applied rewrites52.7%
Final simplification66.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4e-42) (not (<= y 24000000.0))) (/ x (- 1.0 z)) (/ (- t a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4e-42) || !(y <= 24000000.0)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-4d-42)) .or. (.not. (y <= 24000000.0d0))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4e-42) || !(y <= 24000000.0)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4e-42) or not (y <= 24000000.0): tmp = x / (1.0 - z) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4e-42) || !(y <= 24000000.0)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4e-42) || ~((y <= 24000000.0))) tmp = x / (1.0 - z); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4e-42], N[Not[LessEqual[y, 24000000.0]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{-42} \lor \neg \left(y \leq 24000000\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -4.00000000000000015e-42 or 2.4e7 < y Initial program 51.7%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6446.4
Applied rewrites46.4%
if -4.00000000000000015e-42 < y < 2.4e7Initial program 77.2%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6462.5
Applied rewrites62.5%
Final simplification54.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -320000000.0) (not (<= z 7.5e-125))) (/ t b) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -320000000.0) || !(z <= 7.5e-125)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, 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 <= (-320000000.0d0)) .or. (.not. (z <= 7.5d-125))) then
tmp = t / b
else
tmp = x
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 <= -320000000.0) || !(z <= 7.5e-125)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -320000000.0) or not (z <= 7.5e-125): tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -320000000.0) || !(z <= 7.5e-125)) tmp = Float64(t / b); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -320000000.0) || ~((z <= 7.5e-125))) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -320000000.0], N[Not[LessEqual[z, 7.5e-125]], $MachinePrecision]], N[(t / b), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -320000000 \lor \neg \left(z \leq 7.5 \cdot 10^{-125}\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.2e8 or 7.5e-125 < z Initial program 49.8%
Taylor expanded in b around inf
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6434.4
Applied rewrites34.4%
Taylor expanded in t around inf
lower-/.f6429.1
Applied rewrites29.1%
if -3.2e8 < z < 7.5e-125Initial program 86.0%
Taylor expanded in z around 0
Applied rewrites48.8%
Final simplification36.8%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 64.1%
Taylor expanded in z around 0
Applied rewrites22.6%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / 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 = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2025026
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))