
(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]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
Herbie found 15 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]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (fma (- b y) z y))
(t_3 (/ (+ (* x y) (* z (- t a))) t_1))
(t_4 (fma (/ z t_2) (- t a) (* (/ x t_2) y))))
(if (<= t_3 (- INFINITY))
t_4
(if (<= t_3 -2e-241)
(/ (fma (- t a) z (* y x)) t_2)
(if (<= t_3 0.0)
(-
(fma
-1.0
(/
(-
(* -1.0 (/ (* x y) (- b y)))
(* -1.0 (/ (* y (- t a)) (pow (- b y) 2.0))))
z)
(/ t (- b y)))
(/ a (- b y)))
(if (<= t_3 1e+270)
(/ (fma y x (* (- t a) z)) t_1)
(if (<= t_3 INFINITY) t_4 (/ (- t a) (- b y)))))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = fma((b - y), z, y);
double t_3 = ((x * y) + (z * (t - a))) / t_1;
double t_4 = fma((z / t_2), (t - a), ((x / t_2) * y));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_3 <= -2e-241) {
tmp = fma((t - a), z, (y * x)) / t_2;
} else if (t_3 <= 0.0) {
tmp = fma(-1.0, (((-1.0 * ((x * y) / (b - y))) - (-1.0 * ((y * (t - a)) / pow((b - y), 2.0)))) / z), (t / (b - y))) - (a / (b - y));
} else if (t_3 <= 1e+270) {
tmp = fma(y, x, ((t - a) * z)) / t_1;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = fma(Float64(b - y), z, y) t_3 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_1) t_4 = fma(Float64(z / t_2), Float64(t - a), Float64(Float64(x / t_2) * y)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_4; elseif (t_3 <= -2e-241) tmp = Float64(fma(Float64(t - a), z, Float64(y * x)) / t_2); elseif (t_3 <= 0.0) tmp = Float64(fma(-1.0, Float64(Float64(Float64(-1.0 * Float64(Float64(x * y) / Float64(b - y))) - Float64(-1.0 * Float64(Float64(y * Float64(t - a)) / (Float64(b - y) ^ 2.0)))) / z), Float64(t / Float64(b - y))) - Float64(a / Float64(b - y))); elseif (t_3 <= 1e+270) tmp = Float64(fma(y, x, Float64(Float64(t - a) * z)) / t_1); elseif (t_3 <= Inf) tmp = t_4; 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[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z / t$95$2), $MachinePrecision] * N[(t - a), $MachinePrecision] + N[(N[(x / t$95$2), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$4, If[LessEqual[t$95$3, -2e-241], N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(N[(-1.0 * N[(N[(N[(-1.0 * N[(N[(x * y), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-1.0 * N[(N[(y * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+270], N[(N[(y * x + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$4, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \mathsf{fma}\left(b - y, z, y\right)\\
t_3 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\
t_4 := \mathsf{fma}\left(\frac{z}{t\_2}, t - a, \frac{x}{t\_2} \cdot y\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-241}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{t\_2}\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z}, \frac{t}{b - y}\right) - \frac{a}{b - y}\\
\mathbf{elif}\;t\_3 \leq 10^{+270}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{t\_1}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 1e270 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 66.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/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
*-commutativeN/A
associate-/l*N/A
Applied rewrites72.2%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.9999999999999999e-241Initial program 66.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
Applied rewrites66.5%
if -1.9999999999999999e-241 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0Initial program 66.5%
Taylor expanded in z around -inf
lower--.f64N/A
Applied rewrites47.2%
if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1e270Initial program 66.5%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.5%
Applied rewrites66.5%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5%
Applied rewrites51.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (/ (- t a) (- b y)))
(t_3 (fma (- b y) z y))
(t_4 (/ (+ (* x y) (* z (- t a))) t_1))
(t_5 (fma (/ z t_3) (- t a) (* (/ x t_3) y))))
(if (<= t_4 (- INFINITY))
t_5
(if (<= t_4 -1e-294)
(/ (fma (- t a) z (* y x)) t_3)
(if (<= t_4 0.0)
t_2
(if (<= t_4 1e+270)
(/ (fma y x (* (- t a) z)) t_1)
(if (<= t_4 INFINITY) t_5 t_2)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = (t - a) / (b - y);
double t_3 = fma((b - y), z, y);
double t_4 = ((x * y) + (z * (t - a))) / t_1;
double t_5 = fma((z / t_3), (t - a), ((x / t_3) * y));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_4 <= -1e-294) {
tmp = fma((t - a), z, (y * x)) / t_3;
} else if (t_4 <= 0.0) {
tmp = t_2;
} else if (t_4 <= 1e+270) {
tmp = fma(y, x, ((t - a) * z)) / t_1;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(Float64(t - a) / Float64(b - y)) t_3 = fma(Float64(b - y), z, y) t_4 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_1) t_5 = fma(Float64(z / t_3), Float64(t - a), Float64(Float64(x / t_3) * y)) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_5; elseif (t_4 <= -1e-294) tmp = Float64(fma(Float64(t - a), z, Float64(y * x)) / t_3); elseif (t_4 <= 0.0) tmp = t_2; elseif (t_4 <= 1e+270) tmp = Float64(fma(y, x, Float64(Float64(t - a) * z)) / t_1); elseif (t_4 <= Inf) tmp = t_5; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(N[(z / t$95$3), $MachinePrecision] * N[(t - a), $MachinePrecision] + N[(N[(x / t$95$3), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, -1e-294], N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[t$95$4, 0.0], t$95$2, If[LessEqual[t$95$4, 1e+270], N[(N[(y * x + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$5, t$95$2]]]]]]]]]]
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{t - a}{b - y}\\
t_3 := \mathsf{fma}\left(b - y, z, y\right)\\
t_4 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\
t_5 := \mathsf{fma}\left(\frac{z}{t\_3}, t - a, \frac{x}{t\_3} \cdot y\right)\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq -1 \cdot 10^{-294}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{t\_3}\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 10^{+270}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{t\_1}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 1e270 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 66.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/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
*-commutativeN/A
associate-/l*N/A
Applied rewrites72.2%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1e-294Initial program 66.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
Applied rewrites66.5%
if -1e-294 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5%
Applied rewrites51.5%
if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1e270Initial program 66.5%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.5%
Applied rewrites66.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -5.2e+106)
t_1
(if (<= z 8.8e+51)
(/ (fma (- t a) z (* y x)) (fma (- b y) z y))
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -5.2e+106) {
tmp = t_1;
} else if (z <= 8.8e+51) {
tmp = fma((t - a), z, (y * x)) / fma((b - y), z, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -5.2e+106) tmp = t_1; elseif (z <= 8.8e+51) tmp = Float64(fma(Float64(t - a), z, Float64(y * x)) / fma(Float64(b - y), z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+106], t$95$1, If[LessEqual[z, 8.8e+51], N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+51}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -5.2000000000000004e106 or 8.7999999999999997e51 < z Initial program 66.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5%
Applied rewrites51.5%
if -5.2000000000000004e106 < z < 8.7999999999999997e51Initial program 66.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
Applied rewrites66.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (/ (* z (- t a)) t_1))
(t_3 (/ (- t a) (- b y))))
(if (<= z -48000000000000.0)
t_3
(if (<= z -1.05e-147)
t_2
(if (<= z 8e-215)
(* x (/ y t_1))
(if (<= z 3.4e-140)
(* (fma (- t a) z (* y x)) (/ 1.0 y))
(if (<= z 8.8e+51) t_2 t_3)))))))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 = (z * (t - a)) / t_1;
double t_3 = (t - a) / (b - y);
double tmp;
if (z <= -48000000000000.0) {
tmp = t_3;
} else if (z <= -1.05e-147) {
tmp = t_2;
} else if (z <= 8e-215) {
tmp = x * (y / t_1);
} else if (z <= 3.4e-140) {
tmp = fma((t - a), z, (y * x)) * (1.0 / y);
} else if (z <= 8.8e+51) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(z * Float64(t - a)) / t_1) t_3 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -48000000000000.0) tmp = t_3; elseif (z <= -1.05e-147) tmp = t_2; elseif (z <= 8e-215) tmp = Float64(x * Float64(y / t_1)); elseif (z <= 3.4e-140) tmp = Float64(fma(Float64(t - a), z, Float64(y * x)) * Float64(1.0 / y)); elseif (z <= 8.8e+51) tmp = t_2; else tmp = t_3; 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[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -48000000000000.0], t$95$3, If[LessEqual[z, -1.05e-147], t$95$2, If[LessEqual[z, 8e-215], N[(x * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e-140], N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e+51], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{z \cdot \left(t - a\right)}{t\_1}\\
t_3 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -48000000000000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-147}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-215}:\\
\;\;\;\;x \cdot \frac{y}{t\_1}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-140}:\\
\;\;\;\;\mathsf{fma}\left(t - a, z, y \cdot x\right) \cdot \frac{1}{y}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+51}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
if z < -4.8e13 or 8.7999999999999997e51 < z Initial program 66.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5%
Applied rewrites51.5%
if -4.8e13 < z < -1.05e-147 or 3.4000000000000001e-140 < z < 8.7999999999999997e51Initial program 66.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
Applied rewrites66.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6441.7%
Applied rewrites41.7%
if -1.05e-147 < z < 8.0000000000000003e-215Initial program 66.5%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6429.5%
Applied rewrites29.5%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f6430.9%
Applied rewrites30.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.7%
Applied rewrites36.7%
if 8.0000000000000003e-215 < z < 3.4000000000000001e-140Initial program 66.5%
lift-/.f64N/A
mult-flipN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6466.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.4%
Applied rewrites66.4%
Taylor expanded in z around 0
lower-/.f6432.9%
Applied rewrites32.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (/ (* z (- t a)) t_1))
(t_3 (/ (- t a) (- b y))))
(if (<= z -48000000000000.0)
t_3
(if (<= z -1.05e-147)
t_2
(if (<= z 7.6e-216)
(* x (/ y t_1))
(if (<= z 2.45e-133)
(+ x (* -1.0 (/ (* a z) y)))
(if (<= z 8.8e+51) t_2 t_3)))))))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 = (z * (t - a)) / t_1;
double t_3 = (t - a) / (b - y);
double tmp;
if (z <= -48000000000000.0) {
tmp = t_3;
} else if (z <= -1.05e-147) {
tmp = t_2;
} else if (z <= 7.6e-216) {
tmp = x * (y / t_1);
} else if (z <= 2.45e-133) {
tmp = x + (-1.0 * ((a * z) / y));
} else if (z <= 8.8e+51) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(z * Float64(t - a)) / t_1) t_3 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -48000000000000.0) tmp = t_3; elseif (z <= -1.05e-147) tmp = t_2; elseif (z <= 7.6e-216) tmp = Float64(x * Float64(y / t_1)); elseif (z <= 2.45e-133) tmp = Float64(x + Float64(-1.0 * Float64(Float64(a * z) / y))); elseif (z <= 8.8e+51) tmp = t_2; else tmp = t_3; 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[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -48000000000000.0], t$95$3, If[LessEqual[z, -1.05e-147], t$95$2, If[LessEqual[z, 7.6e-216], N[(x * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e-133], N[(x + N[(-1.0 * N[(N[(a * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e+51], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{z \cdot \left(t - a\right)}{t\_1}\\
t_3 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -48000000000000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-147}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-216}:\\
\;\;\;\;x \cdot \frac{y}{t\_1}\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-133}:\\
\;\;\;\;x + -1 \cdot \frac{a \cdot z}{y}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+51}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
if z < -4.8e13 or 8.7999999999999997e51 < z Initial program 66.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5%
Applied rewrites51.5%
if -4.8e13 < z < -1.05e-147 or 2.45e-133 < z < 8.7999999999999997e51Initial program 66.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
Applied rewrites66.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6441.7%
Applied rewrites41.7%
if -1.05e-147 < z < 7.6000000000000001e-216Initial program 66.5%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6429.5%
Applied rewrites29.5%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f6430.9%
Applied rewrites30.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.7%
Applied rewrites36.7%
if 7.6000000000000001e-216 < z < 2.45e-133Initial program 66.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6427.6%
Applied rewrites27.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6432.1%
Applied rewrites32.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* z (- t a)) (fma b z y))) (t_2 (/ (- t a) (- b y))))
(if (<= z -10.6)
t_2
(if (<= z -1.05e-147)
t_1
(if (<= z 7.6e-216)
(* x (/ y (fma (- b y) z y)))
(if (<= z 2.45e-133)
(+ x (* -1.0 (/ (* a z) y)))
(if (<= z 8.8e+51) t_1 t_2)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * (t - a)) / fma(b, z, y);
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -10.6) {
tmp = t_2;
} else if (z <= -1.05e-147) {
tmp = t_1;
} else if (z <= 7.6e-216) {
tmp = x * (y / fma((b - y), z, y));
} else if (z <= 2.45e-133) {
tmp = x + (-1.0 * ((a * z) / y));
} else if (z <= 8.8e+51) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(t - a)) / fma(b, z, y)) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -10.6) tmp = t_2; elseif (z <= -1.05e-147) tmp = t_1; elseif (z <= 7.6e-216) tmp = Float64(x * Float64(y / fma(Float64(b - y), z, y))); elseif (z <= 2.45e-133) tmp = Float64(x + Float64(-1.0 * Float64(Float64(a * z) / y))); elseif (z <= 8.8e+51) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(b * z + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -10.6], t$95$2, If[LessEqual[z, -1.05e-147], t$95$1, If[LessEqual[z, 7.6e-216], N[(x * N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e-133], N[(x + N[(-1.0 * N[(N[(a * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e+51], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
t_1 := \frac{z \cdot \left(t - a\right)}{\mathsf{fma}\left(b, z, y\right)}\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -10.6:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-216}:\\
\;\;\;\;x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-133}:\\
\;\;\;\;x + -1 \cdot \frac{a \cdot z}{y}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if z < -10.6 or 8.7999999999999997e51 < z Initial program 66.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5%
Applied rewrites51.5%
if -10.6 < z < -1.05e-147 or 2.45e-133 < z < 8.7999999999999997e51Initial program 66.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.5%
Applied rewrites66.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6441.7%
Applied rewrites41.7%
Taylor expanded in y around 0
Applied rewrites35.2%
if -1.05e-147 < z < 7.6000000000000001e-216Initial program 66.5%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6429.5%
Applied rewrites29.5%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f6430.9%
Applied rewrites30.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.7%
Applied rewrites36.7%
if 7.6000000000000001e-216 < z < 2.45e-133Initial program 66.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6427.6%
Applied rewrites27.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6432.1%
Applied rewrites32.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.05e-147)
t_1
(if (<= z 7.6e-216)
(* x (/ y (fma (- b y) z y)))
(if (<= z 1.8e-123) (+ x (* -1.0 (/ (* 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 <= -1.05e-147) {
tmp = t_1;
} else if (z <= 7.6e-216) {
tmp = x * (y / fma((b - y), z, y));
} else if (z <= 1.8e-123) {
tmp = x + (-1.0 * ((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 <= -1.05e-147) tmp = t_1; elseif (z <= 7.6e-216) tmp = Float64(x * Float64(y / fma(Float64(b - y), z, y))); elseif (z <= 1.8e-123) tmp = Float64(x + Float64(-1.0 * Float64(Float64(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, -1.05e-147], t$95$1, If[LessEqual[z, 7.6e-216], N[(x * N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-123], N[(x + N[(-1.0 * N[(N[(a * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{-147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-216}:\\
\;\;\;\;x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-123}:\\
\;\;\;\;x + -1 \cdot \frac{a \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.05e-147 or 1.7999999999999998e-123 < z Initial program 66.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5%
Applied rewrites51.5%
if -1.05e-147 < z < 7.6000000000000001e-216Initial program 66.5%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6429.5%
Applied rewrites29.5%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f6430.9%
Applied rewrites30.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.7%
Applied rewrites36.7%
if 7.6000000000000001e-216 < z < 1.7999999999999998e-123Initial program 66.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6427.6%
Applied rewrites27.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6432.1%
Applied rewrites32.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.05e-147)
t_1
(if (<= z 1.8e-123) (+ x (* -1.0 (/ (* 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 <= -1.05e-147) {
tmp = t_1;
} else if (z <= 1.8e-123) {
tmp = x + (-1.0 * ((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 <= (-1.05d-147)) then
tmp = t_1
else if (z <= 1.8d-123) then
tmp = x + ((-1.0d0) * ((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 <= -1.05e-147) {
tmp = t_1;
} else if (z <= 1.8e-123) {
tmp = x + (-1.0 * ((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 <= -1.05e-147: tmp = t_1 elif z <= 1.8e-123: tmp = x + (-1.0 * ((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 <= -1.05e-147) tmp = t_1; elseif (z <= 1.8e-123) tmp = Float64(x + Float64(-1.0 * Float64(Float64(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 <= -1.05e-147) tmp = t_1; elseif (z <= 1.8e-123) tmp = x + (-1.0 * ((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, -1.05e-147], t$95$1, If[LessEqual[z, 1.8e-123], N[(x + N[(-1.0 * N[(N[(a * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{-147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-123}:\\
\;\;\;\;x + -1 \cdot \frac{a \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.05e-147 or 1.7999999999999998e-123 < z Initial program 66.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5%
Applied rewrites51.5%
if -1.05e-147 < z < 1.7999999999999998e-123Initial program 66.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6427.6%
Applied rewrites27.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6432.1%
Applied rewrites32.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -9.6e-135)
t_1
(if (<= z 1.8e-123) (+ x (/ (* t 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 <= -9.6e-135) {
tmp = t_1;
} else if (z <= 1.8e-123) {
tmp = x + ((t * 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 <= (-9.6d-135)) then
tmp = t_1
else if (z <= 1.8d-123) then
tmp = x + ((t * 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 <= -9.6e-135) {
tmp = t_1;
} else if (z <= 1.8e-123) {
tmp = x + ((t * 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 <= -9.6e-135: tmp = t_1 elif z <= 1.8e-123: tmp = x + ((t * 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 <= -9.6e-135) tmp = t_1; elseif (z <= 1.8e-123) tmp = Float64(x + Float64(Float64(t * 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 <= -9.6e-135) tmp = t_1; elseif (z <= 1.8e-123) tmp = x + ((t * 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, -9.6e-135], t$95$1, If[LessEqual[z, 1.8e-123], N[(x + N[(N[(t * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{-135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-123}:\\
\;\;\;\;x + \frac{t \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -9.5999999999999994e-135 or 1.7999999999999998e-123 < z Initial program 66.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5%
Applied rewrites51.5%
if -9.5999999999999994e-135 < z < 1.7999999999999998e-123Initial program 66.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6427.6%
Applied rewrites27.6%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f6432.2%
Applied rewrites32.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -9.6e-135)
t_1
(if (<= z 1.8e-123) (fma (/ t y) z 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 tmp;
if (z <= -9.6e-135) {
tmp = t_1;
} else if (z <= 1.8e-123) {
tmp = fma((t / y), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -9.6e-135) tmp = t_1; elseif (z <= 1.8e-123) tmp = fma(Float64(t / y), z, x); 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, -9.6e-135], t$95$1, If[LessEqual[z, 1.8e-123], N[(N[(t / y), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{-135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-123}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{y}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -9.5999999999999994e-135 or 1.7999999999999998e-123 < z Initial program 66.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5%
Applied rewrites51.5%
if -9.5999999999999994e-135 < z < 1.7999999999999998e-123Initial program 66.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6427.6%
Applied rewrites27.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f6430.5%
Applied rewrites30.5%
Taylor expanded in t around inf
lower-/.f6430.6%
Applied rewrites30.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6430.6%
Applied rewrites30.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) b)))
(if (<= z -9.6e-135)
t_1
(if (<= z 1.46e-133) (fma (/ t y) z x) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double tmp;
if (z <= -9.6e-135) {
tmp = t_1;
} else if (z <= 1.46e-133) {
tmp = fma((t / y), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / b) tmp = 0.0 if (z <= -9.6e-135) tmp = t_1; elseif (z <= 1.46e-133) tmp = fma(Float64(t / y), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[z, -9.6e-135], t$95$1, If[LessEqual[z, 1.46e-133], N[(N[(t / y), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b}\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{-135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.46 \cdot 10^{-133}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{y}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -9.5999999999999994e-135 or 1.4600000000000001e-133 < z Initial program 66.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6435.3%
Applied rewrites35.3%
if -9.5999999999999994e-135 < z < 1.4600000000000001e-133Initial program 66.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6427.6%
Applied rewrites27.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f6430.5%
Applied rewrites30.5%
Taylor expanded in t around inf
lower-/.f6430.6%
Applied rewrites30.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6430.6%
Applied rewrites30.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) b))) (if (<= z -9.6e-135) t_1 (if (<= z 1.46e-133) (+ x (* x z)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double tmp;
if (z <= -9.6e-135) {
tmp = t_1;
} else if (z <= 1.46e-133) {
tmp = x + (x * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / b
if (z <= (-9.6d-135)) then
tmp = t_1
else if (z <= 1.46d-133) then
tmp = x + (x * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double tmp;
if (z <= -9.6e-135) {
tmp = t_1;
} else if (z <= 1.46e-133) {
tmp = x + (x * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / b tmp = 0 if z <= -9.6e-135: tmp = t_1 elif z <= 1.46e-133: tmp = x + (x * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / b) tmp = 0.0 if (z <= -9.6e-135) tmp = t_1; elseif (z <= 1.46e-133) tmp = Float64(x + Float64(x * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / b; tmp = 0.0; if (z <= -9.6e-135) tmp = t_1; elseif (z <= 1.46e-133) tmp = x + (x * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[z, -9.6e-135], t$95$1, If[LessEqual[z, 1.46e-133], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b}\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{-135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.46 \cdot 10^{-133}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -9.5999999999999994e-135 or 1.4600000000000001e-133 < z Initial program 66.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6435.3%
Applied rewrites35.3%
if -9.5999999999999994e-135 < z < 1.4600000000000001e-133Initial program 66.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6427.6%
Applied rewrites27.6%
Taylor expanded in y around inf
lower-*.f6425.1%
Applied rewrites25.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ t (- b y)))) (if (<= z -1.8e-109) t_1 (if (<= z 3e-140) (+ x (* x z)) 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 (z <= -1.8e-109) {
tmp = t_1;
} else if (z <= 3e-140) {
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 / (b - y)
if (z <= (-1.8d-109)) then
tmp = t_1
else if (z <= 3d-140) 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 / (b - y);
double tmp;
if (z <= -1.8e-109) {
tmp = t_1;
} else if (z <= 3e-140) {
tmp = x + (x * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -1.8e-109: tmp = t_1 elif z <= 3e-140: tmp = x + (x * z) 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 (z <= -1.8e-109) tmp = t_1; elseif (z <= 3e-140) 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 / (b - y); tmp = 0.0; if (z <= -1.8e-109) tmp = t_1; elseif (z <= 3e-140) 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[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e-109], t$95$1, If[LessEqual[z, 3e-140], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-140}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.8e-109 or 3.0000000000000002e-140 < z Initial program 66.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.5%
Applied rewrites51.5%
Taylor expanded in t around inf
lower-/.f64N/A
lower--.f6427.4%
Applied rewrites27.4%
if -1.8e-109 < z < 3.0000000000000002e-140Initial program 66.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6427.6%
Applied rewrites27.6%
Taylor expanded in y around inf
lower-*.f6425.1%
Applied rewrites25.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.25e-109) (/ t b) (if (<= z 3.4e-140) (+ x (* x z)) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.25e-109) {
tmp = t / b;
} else if (z <= 3.4e-140) {
tmp = x + (x * z);
} else {
tmp = t / b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.25d-109)) then
tmp = t / b
else if (z <= 3.4d-140) then
tmp = x + (x * z)
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.25e-109) {
tmp = t / b;
} else if (z <= 3.4e-140) {
tmp = x + (x * z);
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.25e-109: tmp = t / b elif z <= 3.4e-140: tmp = x + (x * z) else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.25e-109) tmp = Float64(t / b); elseif (z <= 3.4e-140) tmp = Float64(x + Float64(x * z)); else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.25e-109) tmp = t / b; elseif (z <= 3.4e-140) tmp = x + (x * z); else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.25e-109], N[(t / b), $MachinePrecision], If[LessEqual[z, 3.4e-140], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{-109}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-140}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
if z < -2.25e-109 or 3.4000000000000001e-140 < z Initial program 66.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6435.3%
Applied rewrites35.3%
Taylor expanded in t around inf
lower-/.f6420.1%
Applied rewrites20.1%
if -2.25e-109 < z < 3.4000000000000001e-140Initial program 66.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6427.6%
Applied rewrites27.6%
Taylor expanded in y around inf
lower-*.f6425.1%
Applied rewrites25.1%
(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]
\frac{t}{b}
Initial program 66.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6435.3%
Applied rewrites35.3%
Taylor expanded in t around inf
lower-/.f6420.1%
Applied rewrites20.1%
herbie shell --seed 2025212
(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)))))