
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
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, c)
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), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
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, c)
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), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -2e-59)
(/ (fma (* -4.0 (fmax t a)) (fmin t a) (/ (fma (* 9.0 y) x b) z)) c)
(if (<= z 8.6e+46)
(/
(+ (- (* (* x 9.0) y) (* (* (* z 4.0) (fmin t a)) (fmax t a))) b)
(* z c))
(fma
(/ (* y 9.0) z)
(/ x c)
(*
(fmin t a)
(fma -4.0 (/ (fmax t a) c) (/ b (* c (* (fmin t a) z)))))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2e-59) {
tmp = fma((-4.0 * fmax(t, a)), fmin(t, a), (fma((9.0 * y), x, b) / z)) / c;
} else if (z <= 8.6e+46) {
tmp = ((((x * 9.0) * y) - (((z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / (z * c);
} else {
tmp = fma(((y * 9.0) / z), (x / c), (fmin(t, a) * fma(-4.0, (fmax(t, a) / c), (b / (c * (fmin(t, a) * z))))));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2e-59) tmp = Float64(fma(Float64(-4.0 * fmax(t, a)), fmin(t, a), Float64(fma(Float64(9.0 * y), x, b) / z)) / c); elseif (z <= 8.6e+46) tmp = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / Float64(z * c)); else tmp = fma(Float64(Float64(y * 9.0) / z), Float64(x / c), Float64(fmin(t, a) * fma(-4.0, Float64(fmax(t, a) / c), Float64(b / Float64(c * Float64(fmin(t, a) * z)))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -2e-59], N[(N[(N[(-4.0 * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[Min[t, a], $MachinePrecision] + N[(N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 8.6e+46], N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * 9.0), $MachinePrecision] / z), $MachinePrecision] * N[(x / c), $MachinePrecision] + N[(N[Min[t, a], $MachinePrecision] * N[(-4.0 * N[(N[Max[t, a], $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * N[(N[Min[t, a], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-59}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot \mathsf{max}\left(t, a\right), \mathsf{min}\left(t, a\right), \frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{+46}:\\
\;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot \mathsf{min}\left(t, a\right)\right) \cdot \mathsf{max}\left(t, a\right)\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y \cdot 9}{z}, \frac{x}{c}, \mathsf{min}\left(t, a\right) \cdot \mathsf{fma}\left(-4, \frac{\mathsf{max}\left(t, a\right)}{c}, \frac{b}{c \cdot \left(\mathsf{min}\left(t, a\right) \cdot z\right)}\right)\right)\\
\end{array}
if z < -2.0000000000000001e-59Initial program 80.1%
lift-/.f64N/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites79.7%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites87.1%
if -2.0000000000000001e-59 < z < 8.60000000000000009e46Initial program 80.1%
if 8.60000000000000009e46 < z Initial program 80.1%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites73.4%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6472.6%
Applied rewrites72.6%
(FPCore (x y z t a b c)
:precision binary64
(*
(copysign 1.0 c)
(if (<= (fabs c) 7.5e+37)
(/ (fma (* -4.0 (fmax t a)) (fmin t a) (/ (fma (* 9.0 y) x b) z)) (fabs c))
(fma
(/ (* y 9.0) z)
(/ x (fabs c))
(*
(fmax t a)
(fma
-4.0
(/ (fmin t a) (fabs c))
(/ b (* (fmax t a) (* (fabs c) z)))))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (fabs(c) <= 7.5e+37) {
tmp = fma((-4.0 * fmax(t, a)), fmin(t, a), (fma((9.0 * y), x, b) / z)) / fabs(c);
} else {
tmp = fma(((y * 9.0) / z), (x / fabs(c)), (fmax(t, a) * fma(-4.0, (fmin(t, a) / fabs(c)), (b / (fmax(t, a) * (fabs(c) * z))))));
}
return copysign(1.0, c) * tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (abs(c) <= 7.5e+37) tmp = Float64(fma(Float64(-4.0 * fmax(t, a)), fmin(t, a), Float64(fma(Float64(9.0 * y), x, b) / z)) / abs(c)); else tmp = fma(Float64(Float64(y * 9.0) / z), Float64(x / abs(c)), Float64(fmax(t, a) * fma(-4.0, Float64(fmin(t, a) / abs(c)), Float64(b / Float64(fmax(t, a) * Float64(abs(c) * z)))))); end return Float64(copysign(1.0, c) * tmp) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[c], $MachinePrecision], 7.5e+37], N[(N[(N[(-4.0 * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[Min[t, a], $MachinePrecision] + N[(N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / N[Abs[c], $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * 9.0), $MachinePrecision] / z), $MachinePrecision] * N[(x / N[Abs[c], $MachinePrecision]), $MachinePrecision] + N[(N[Max[t, a], $MachinePrecision] * N[(-4.0 * N[(N[Min[t, a], $MachinePrecision] / N[Abs[c], $MachinePrecision]), $MachinePrecision] + N[(b / N[(N[Max[t, a], $MachinePrecision] * N[(N[Abs[c], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|c\right| \leq 7.5 \cdot 10^{+37}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot \mathsf{max}\left(t, a\right), \mathsf{min}\left(t, a\right), \frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{z}\right)}{\left|c\right|}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y \cdot 9}{z}, \frac{x}{\left|c\right|}, \mathsf{max}\left(t, a\right) \cdot \mathsf{fma}\left(-4, \frac{\mathsf{min}\left(t, a\right)}{\left|c\right|}, \frac{b}{\mathsf{max}\left(t, a\right) \cdot \left(\left|c\right| \cdot z\right)}\right)\right)\\
\end{array}
if c < 7.5000000000000003e37Initial program 80.1%
lift-/.f64N/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites79.7%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites87.1%
if 7.5000000000000003e37 < c Initial program 80.1%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites73.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6473.4%
Applied rewrites73.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (fma (* -4.0 a) t (/ (fma (* 9.0 y) x b) z)) c)))
(if (<= z -2e-62)
t_1
(if (<= z 3.45e-50)
(/ (fma (* (* -4.0 z) a) t (fma (* y x) 9.0 b)) (* z c))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((-4.0 * a), t, (fma((9.0 * y), x, b) / z)) / c;
double tmp;
if (z <= -2e-62) {
tmp = t_1;
} else if (z <= 3.45e-50) {
tmp = fma(((-4.0 * z) * a), t, fma((y * x), 9.0, b)) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(fma(Float64(-4.0 * a), t, Float64(fma(Float64(9.0 * y), x, b) / z)) / c) tmp = 0.0 if (z <= -2e-62) tmp = t_1; elseif (z <= 3.45e-50) tmp = Float64(fma(Float64(Float64(-4.0 * z) * a), t, fma(Float64(y * x), 9.0, b)) / Float64(z * c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(-4.0 * a), $MachinePrecision] * t + N[(N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2e-62], t$95$1, If[LessEqual[z, 3.45e-50], N[(N[(N[(N[(-4.0 * z), $MachinePrecision] * a), $MachinePrecision] * t + N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(-4 \cdot a, t, \frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{z}\right)}{c}\\
\mathbf{if}\;z \leq -2 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.45 \cdot 10^{-50}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.0000000000000001e-62 or 3.4500000000000001e-50 < z Initial program 80.1%
lift-/.f64N/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites79.7%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites87.1%
if -2.0000000000000001e-62 < z < 3.4500000000000001e-50Initial program 80.1%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
Applied rewrites79.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 9.0 (fmax x y))) (t_2 (* (* (fmin x y) 9.0) (fmax x y))))
(if (<= t_2 -5e+300)
(* (/ t_1 z) (/ (fmin x y) c))
(if (<= t_2 1e+156)
(/ (fma (* -4.0 a) t (/ (fma t_1 (fmin x y) b) z)) c)
(/ (* (fmin x y) (/ (* (fmax x y) 9.0) c)) z)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * fmax(x, y);
double t_2 = (fmin(x, y) * 9.0) * fmax(x, y);
double tmp;
if (t_2 <= -5e+300) {
tmp = (t_1 / z) * (fmin(x, y) / c);
} else if (t_2 <= 1e+156) {
tmp = fma((-4.0 * a), t, (fma(t_1, fmin(x, y), b) / z)) / c;
} else {
tmp = (fmin(x, y) * ((fmax(x, y) * 9.0) / c)) / z;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * fmax(x, y)) t_2 = Float64(Float64(fmin(x, y) * 9.0) * fmax(x, y)) tmp = 0.0 if (t_2 <= -5e+300) tmp = Float64(Float64(t_1 / z) * Float64(fmin(x, y) / c)); elseif (t_2 <= 1e+156) tmp = Float64(fma(Float64(-4.0 * a), t, Float64(fma(t_1, fmin(x, y), b) / z)) / c); else tmp = Float64(Float64(fmin(x, y) * Float64(Float64(fmax(x, y) * 9.0) / c)) / z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(9.0 * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+300], N[(N[(t$95$1 / z), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+156], N[(N[(N[(-4.0 * a), $MachinePrecision] * t + N[(N[(t$95$1 * N[Min[x, y], $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] * N[(N[(N[Max[x, y], $MachinePrecision] * 9.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := 9 \cdot \mathsf{max}\left(x, y\right)\\
t_2 := \left(\mathsf{min}\left(x, y\right) \cdot 9\right) \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+300}:\\
\;\;\;\;\frac{t\_1}{z} \cdot \frac{\mathsf{min}\left(x, y\right)}{c}\\
\mathbf{elif}\;t\_2 \leq 10^{+156}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot a, t, \frac{\mathsf{fma}\left(t\_1, \mathsf{min}\left(x, y\right), b\right)}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right) \cdot 9}{c}}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.00000000000000026e300Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6436.8%
Applied rewrites36.8%
if -5.00000000000000026e300 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999998e155Initial program 80.1%
lift-/.f64N/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites79.7%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites87.1%
if 9.9999999999999998e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6437.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6437.5%
Applied rewrites37.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* (fmin x y) 9.0) (fmax x y))))
(if (<= t_1 -1e+189)
(* (/ (* 9.0 (fmax x y)) z) (/ (fmin x y) c))
(if (<= t_1 1e-7)
(fma -4.0 (/ (* a t) c) (/ b (* c z)))
(if (<= t_1 1e+73)
(/ (fma 9.0 (/ (* (fmin x y) (fmax x y)) c) (/ b c)) z)
(if (<= t_1 1e+156)
(/ (fma (* -4.0 a) t (/ b z)) c)
(/ (* (fmin x y) (/ (* (fmax x y) 9.0) c)) z)))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (fmin(x, y) * 9.0) * fmax(x, y);
double tmp;
if (t_1 <= -1e+189) {
tmp = ((9.0 * fmax(x, y)) / z) * (fmin(x, y) / c);
} else if (t_1 <= 1e-7) {
tmp = fma(-4.0, ((a * t) / c), (b / (c * z)));
} else if (t_1 <= 1e+73) {
tmp = fma(9.0, ((fmin(x, y) * fmax(x, y)) / c), (b / c)) / z;
} else if (t_1 <= 1e+156) {
tmp = fma((-4.0 * a), t, (b / z)) / c;
} else {
tmp = (fmin(x, y) * ((fmax(x, y) * 9.0) / c)) / z;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(fmin(x, y) * 9.0) * fmax(x, y)) tmp = 0.0 if (t_1 <= -1e+189) tmp = Float64(Float64(Float64(9.0 * fmax(x, y)) / z) * Float64(fmin(x, y) / c)); elseif (t_1 <= 1e-7) tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(b / Float64(c * z))); elseif (t_1 <= 1e+73) tmp = Float64(fma(9.0, Float64(Float64(fmin(x, y) * fmax(x, y)) / c), Float64(b / c)) / z); elseif (t_1 <= 1e+156) tmp = Float64(fma(Float64(-4.0 * a), t, Float64(b / z)) / c); else tmp = Float64(Float64(fmin(x, y) * Float64(Float64(fmax(x, y) * 9.0) / c)) / z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+189], N[(N[(N[(9.0 * N[Max[x, y], $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-7], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+73], N[(N[(9.0 * N[(N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] + N[(b / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 1e+156], N[(N[(N[(-4.0 * a), $MachinePrecision] * t + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] * N[(N[(N[Max[x, y], $MachinePrecision] * 9.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \left(\mathsf{min}\left(x, y\right) \cdot 9\right) \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+189}:\\
\;\;\;\;\frac{9 \cdot \mathsf{max}\left(x, y\right)}{z} \cdot \frac{\mathsf{min}\left(x, y\right)}{c}\\
\mathbf{elif}\;t\_1 \leq 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+73}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9, \frac{\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)}{c}, \frac{b}{c}\right)}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{+156}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot a, t, \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right) \cdot 9}{c}}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e189Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6436.8%
Applied rewrites36.8%
if -1e189 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999995e-8Initial program 80.1%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites73.4%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6462.5%
Applied rewrites62.5%
if 9.9999999999999995e-8 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999983e72Initial program 80.1%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites73.4%
Taylor expanded in z around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6459.0%
Applied rewrites59.0%
if 9.99999999999999983e72 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999998e155Initial program 80.1%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6480.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
+-commutativeN/A
Applied rewrites79.8%
Taylor expanded in x around 0
Applied rewrites56.9%
lift-/.f64N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f6457.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6457.0%
Applied rewrites57.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites64.2%
if 9.9999999999999998e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6437.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6437.5%
Applied rewrites37.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* (fmin x y) 9.0) (fmax x y))))
(if (<= t_1 -1e+189)
(* (/ (* 9.0 (fmax x y)) z) (/ (fmin x y) c))
(if (<= t_1 1e+156)
(/ (fma (* -4.0 a) t (/ b z)) c)
(/ (* (fmin x y) (/ (* (fmax x y) 9.0) c)) z)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (fmin(x, y) * 9.0) * fmax(x, y);
double tmp;
if (t_1 <= -1e+189) {
tmp = ((9.0 * fmax(x, y)) / z) * (fmin(x, y) / c);
} else if (t_1 <= 1e+156) {
tmp = fma((-4.0 * a), t, (b / z)) / c;
} else {
tmp = (fmin(x, y) * ((fmax(x, y) * 9.0) / c)) / z;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(fmin(x, y) * 9.0) * fmax(x, y)) tmp = 0.0 if (t_1 <= -1e+189) tmp = Float64(Float64(Float64(9.0 * fmax(x, y)) / z) * Float64(fmin(x, y) / c)); elseif (t_1 <= 1e+156) tmp = Float64(fma(Float64(-4.0 * a), t, Float64(b / z)) / c); else tmp = Float64(Float64(fmin(x, y) * Float64(Float64(fmax(x, y) * 9.0) / c)) / z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+189], N[(N[(N[(9.0 * N[Max[x, y], $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+156], N[(N[(N[(-4.0 * a), $MachinePrecision] * t + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] * N[(N[(N[Max[x, y], $MachinePrecision] * 9.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\mathsf{min}\left(x, y\right) \cdot 9\right) \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+189}:\\
\;\;\;\;\frac{9 \cdot \mathsf{max}\left(x, y\right)}{z} \cdot \frac{\mathsf{min}\left(x, y\right)}{c}\\
\mathbf{elif}\;t\_1 \leq 10^{+156}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot a, t, \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right) \cdot 9}{c}}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e189Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6436.8%
Applied rewrites36.8%
if -1e189 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999998e155Initial program 80.1%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6480.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
+-commutativeN/A
Applied rewrites79.8%
Taylor expanded in x around 0
Applied rewrites56.9%
lift-/.f64N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f6457.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6457.0%
Applied rewrites57.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites64.2%
if 9.9999999999999998e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6437.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6437.5%
Applied rewrites37.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* (fmin x y) 9.0) (fmax x y))) (t_2 (* -4.0 (/ (* a t) c))))
(if (<= t_1 -1e+189)
(* (/ (* 9.0 (fmax x y)) z) (/ (fmin x y) c))
(if (<= t_1 -2e-163)
t_2
(if (<= t_1 1000.0)
(/ (/ b c) z)
(if (<= t_1 5e+75)
(/ (* (* (fmin x y) (fmax x y)) 9.0) (* c z))
(if (<= t_1 1e+156)
t_2
(/ (* (fmin x y) (/ (* (fmax x y) 9.0) c)) z))))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (fmin(x, y) * 9.0) * fmax(x, y);
double t_2 = -4.0 * ((a * t) / c);
double tmp;
if (t_1 <= -1e+189) {
tmp = ((9.0 * fmax(x, y)) / z) * (fmin(x, y) / c);
} else if (t_1 <= -2e-163) {
tmp = t_2;
} else if (t_1 <= 1000.0) {
tmp = (b / c) / z;
} else if (t_1 <= 5e+75) {
tmp = ((fmin(x, y) * fmax(x, y)) * 9.0) / (c * z);
} else if (t_1 <= 1e+156) {
tmp = t_2;
} else {
tmp = (fmin(x, y) * ((fmax(x, y) * 9.0) / c)) / 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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (fmin(x, y) * 9.0d0) * fmax(x, y)
t_2 = (-4.0d0) * ((a * t) / c)
if (t_1 <= (-1d+189)) then
tmp = ((9.0d0 * fmax(x, y)) / z) * (fmin(x, y) / c)
else if (t_1 <= (-2d-163)) then
tmp = t_2
else if (t_1 <= 1000.0d0) then
tmp = (b / c) / z
else if (t_1 <= 5d+75) then
tmp = ((fmin(x, y) * fmax(x, y)) * 9.0d0) / (c * z)
else if (t_1 <= 1d+156) then
tmp = t_2
else
tmp = (fmin(x, y) * ((fmax(x, y) * 9.0d0) / c)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (fmin(x, y) * 9.0) * fmax(x, y);
double t_2 = -4.0 * ((a * t) / c);
double tmp;
if (t_1 <= -1e+189) {
tmp = ((9.0 * fmax(x, y)) / z) * (fmin(x, y) / c);
} else if (t_1 <= -2e-163) {
tmp = t_2;
} else if (t_1 <= 1000.0) {
tmp = (b / c) / z;
} else if (t_1 <= 5e+75) {
tmp = ((fmin(x, y) * fmax(x, y)) * 9.0) / (c * z);
} else if (t_1 <= 1e+156) {
tmp = t_2;
} else {
tmp = (fmin(x, y) * ((fmax(x, y) * 9.0) / c)) / z;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (fmin(x, y) * 9.0) * fmax(x, y) t_2 = -4.0 * ((a * t) / c) tmp = 0 if t_1 <= -1e+189: tmp = ((9.0 * fmax(x, y)) / z) * (fmin(x, y) / c) elif t_1 <= -2e-163: tmp = t_2 elif t_1 <= 1000.0: tmp = (b / c) / z elif t_1 <= 5e+75: tmp = ((fmin(x, y) * fmax(x, y)) * 9.0) / (c * z) elif t_1 <= 1e+156: tmp = t_2 else: tmp = (fmin(x, y) * ((fmax(x, y) * 9.0) / c)) / z return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(fmin(x, y) * 9.0) * fmax(x, y)) t_2 = Float64(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (t_1 <= -1e+189) tmp = Float64(Float64(Float64(9.0 * fmax(x, y)) / z) * Float64(fmin(x, y) / c)); elseif (t_1 <= -2e-163) tmp = t_2; elseif (t_1 <= 1000.0) tmp = Float64(Float64(b / c) / z); elseif (t_1 <= 5e+75) tmp = Float64(Float64(Float64(fmin(x, y) * fmax(x, y)) * 9.0) / Float64(c * z)); elseif (t_1 <= 1e+156) tmp = t_2; else tmp = Float64(Float64(fmin(x, y) * Float64(Float64(fmax(x, y) * 9.0) / c)) / z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (min(x, y) * 9.0) * max(x, y); t_2 = -4.0 * ((a * t) / c); tmp = 0.0; if (t_1 <= -1e+189) tmp = ((9.0 * max(x, y)) / z) * (min(x, y) / c); elseif (t_1 <= -2e-163) tmp = t_2; elseif (t_1 <= 1000.0) tmp = (b / c) / z; elseif (t_1 <= 5e+75) tmp = ((min(x, y) * max(x, y)) * 9.0) / (c * z); elseif (t_1 <= 1e+156) tmp = t_2; else tmp = (min(x, y) * ((max(x, y) * 9.0) / c)) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+189], N[(N[(N[(9.0 * N[Max[x, y], $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-163], t$95$2, If[LessEqual[t$95$1, 1000.0], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 5e+75], N[(N[(N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+156], t$95$2, N[(N[(N[Min[x, y], $MachinePrecision] * N[(N[(N[Max[x, y], $MachinePrecision] * 9.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := \left(\mathsf{min}\left(x, y\right) \cdot 9\right) \cdot \mathsf{max}\left(x, y\right)\\
t_2 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+189}:\\
\;\;\;\;\frac{9 \cdot \mathsf{max}\left(x, y\right)}{z} \cdot \frac{\mathsf{min}\left(x, y\right)}{c}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-163}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 1000:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+75}:\\
\;\;\;\;\frac{\left(\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\right) \cdot 9}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq 10^{+156}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right) \cdot 9}{c}}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e189Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6436.8%
Applied rewrites36.8%
if -1e189 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.99999999999999985e-163 or 5.0000000000000002e75 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999998e155Initial program 80.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -1.99999999999999985e-163 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e3Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in b around inf
lower-/.f6434.7%
Applied rewrites34.7%
if 1e3 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000002e75Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
if 9.9999999999999998e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6437.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6437.5%
Applied rewrites37.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -1e+189)
(* (/ (* 9.0 y) z) (/ x c))
(if (<= t_1 -2e-163)
(* -4.0 (/ (* a t) c))
(if (<= t_1 1e+34) (/ (/ b c) z) (/ (* (/ x c) (* y 9.0)) z))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -1e+189) {
tmp = ((9.0 * y) / z) * (x / c);
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 1e+34) {
tmp = (b / c) / z;
} else {
tmp = ((x / c) * (y * 9.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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 9.0d0) * y
if (t_1 <= (-1d+189)) then
tmp = ((9.0d0 * y) / z) * (x / c)
else if (t_1 <= (-2d-163)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (t_1 <= 1d+34) then
tmp = (b / c) / z
else
tmp = ((x / c) * (y * 9.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 c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -1e+189) {
tmp = ((9.0 * y) / z) * (x / c);
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 1e+34) {
tmp = (b / c) / z;
} else {
tmp = ((x / c) * (y * 9.0)) / z;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -1e+189: tmp = ((9.0 * y) / z) * (x / c) elif t_1 <= -2e-163: tmp = -4.0 * ((a * t) / c) elif t_1 <= 1e+34: tmp = (b / c) / z else: tmp = ((x / c) * (y * 9.0)) / z return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -1e+189) tmp = Float64(Float64(Float64(9.0 * y) / z) * Float64(x / c)); elseif (t_1 <= -2e-163) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (t_1 <= 1e+34) tmp = Float64(Float64(b / c) / z); else tmp = Float64(Float64(Float64(x / c) * Float64(y * 9.0)) / z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; tmp = 0.0; if (t_1 <= -1e+189) tmp = ((9.0 * y) / z) * (x / c); elseif (t_1 <= -2e-163) tmp = -4.0 * ((a * t) / c); elseif (t_1 <= 1e+34) tmp = (b / c) / z; else tmp = ((x / c) * (y * 9.0)) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+189], N[(N[(N[(9.0 * y), $MachinePrecision] / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-163], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+34], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(x / c), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+189}:\\
\;\;\;\;\frac{9 \cdot y}{z} \cdot \frac{x}{c}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-163}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;t\_1 \leq 10^{+34}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{c} \cdot \left(y \cdot 9\right)}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e189Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6436.8%
Applied rewrites36.8%
if -1e189 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.99999999999999985e-163Initial program 80.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -1.99999999999999985e-163 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999946e33Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in b around inf
lower-/.f6434.7%
Applied rewrites34.7%
if 9.99999999999999946e33 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6437.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6437.5%
Applied rewrites37.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -1e+189)
(* (/ (* 9.0 y) z) (/ x c))
(if (<= t_1 -2e-163)
(* -4.0 (/ (* a t) c))
(if (<= t_1 5e+29) (/ (/ b c) z) (/ (* (* (/ x c) y) 9.0) z))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -1e+189) {
tmp = ((9.0 * y) / z) * (x / c);
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 5e+29) {
tmp = (b / c) / z;
} else {
tmp = (((x / c) * y) * 9.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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 9.0d0) * y
if (t_1 <= (-1d+189)) then
tmp = ((9.0d0 * y) / z) * (x / c)
else if (t_1 <= (-2d-163)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (t_1 <= 5d+29) then
tmp = (b / c) / z
else
tmp = (((x / c) * y) * 9.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 c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -1e+189) {
tmp = ((9.0 * y) / z) * (x / c);
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 5e+29) {
tmp = (b / c) / z;
} else {
tmp = (((x / c) * y) * 9.0) / z;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -1e+189: tmp = ((9.0 * y) / z) * (x / c) elif t_1 <= -2e-163: tmp = -4.0 * ((a * t) / c) elif t_1 <= 5e+29: tmp = (b / c) / z else: tmp = (((x / c) * y) * 9.0) / z return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -1e+189) tmp = Float64(Float64(Float64(9.0 * y) / z) * Float64(x / c)); elseif (t_1 <= -2e-163) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (t_1 <= 5e+29) tmp = Float64(Float64(b / c) / z); else tmp = Float64(Float64(Float64(Float64(x / c) * y) * 9.0) / z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; tmp = 0.0; if (t_1 <= -1e+189) tmp = ((9.0 * y) / z) * (x / c); elseif (t_1 <= -2e-163) tmp = -4.0 * ((a * t) / c); elseif (t_1 <= 5e+29) tmp = (b / c) / z; else tmp = (((x / c) * y) * 9.0) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+189], N[(N[(N[(9.0 * y), $MachinePrecision] / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-163], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+29], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(x / c), $MachinePrecision] * y), $MachinePrecision] * 9.0), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+189}:\\
\;\;\;\;\frac{9 \cdot y}{z} \cdot \frac{x}{c}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-163}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+29}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{x}{c} \cdot y\right) \cdot 9}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e189Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6436.8%
Applied rewrites36.8%
if -1e189 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.99999999999999985e-163Initial program 80.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -1.99999999999999985e-163 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000001e29Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in b around inf
lower-/.f6434.7%
Applied rewrites34.7%
if 5.0000000000000001e29 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6437.5%
Applied rewrites37.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -1e+189)
(* (/ (* 9.0 y) z) (/ x c))
(if (<= t_1 -2e-163)
(* -4.0 (/ (* a t) c))
(if (<= t_1 5e+29) (/ (/ b c) z) (* 9.0 (/ (* (/ x c) y) z)))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -1e+189) {
tmp = ((9.0 * y) / z) * (x / c);
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 5e+29) {
tmp = (b / c) / z;
} else {
tmp = 9.0 * (((x / c) * y) / 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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 9.0d0) * y
if (t_1 <= (-1d+189)) then
tmp = ((9.0d0 * y) / z) * (x / c)
else if (t_1 <= (-2d-163)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (t_1 <= 5d+29) then
tmp = (b / c) / z
else
tmp = 9.0d0 * (((x / c) * y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -1e+189) {
tmp = ((9.0 * y) / z) * (x / c);
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 5e+29) {
tmp = (b / c) / z;
} else {
tmp = 9.0 * (((x / c) * y) / z);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -1e+189: tmp = ((9.0 * y) / z) * (x / c) elif t_1 <= -2e-163: tmp = -4.0 * ((a * t) / c) elif t_1 <= 5e+29: tmp = (b / c) / z else: tmp = 9.0 * (((x / c) * y) / z) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -1e+189) tmp = Float64(Float64(Float64(9.0 * y) / z) * Float64(x / c)); elseif (t_1 <= -2e-163) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (t_1 <= 5e+29) tmp = Float64(Float64(b / c) / z); else tmp = Float64(9.0 * Float64(Float64(Float64(x / c) * y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; tmp = 0.0; if (t_1 <= -1e+189) tmp = ((9.0 * y) / z) * (x / c); elseif (t_1 <= -2e-163) tmp = -4.0 * ((a * t) / c); elseif (t_1 <= 5e+29) tmp = (b / c) / z; else tmp = 9.0 * (((x / c) * y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+189], N[(N[(N[(9.0 * y), $MachinePrecision] / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-163], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+29], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(9.0 * N[(N[(N[(x / c), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+189}:\\
\;\;\;\;\frac{9 \cdot y}{z} \cdot \frac{x}{c}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-163}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+29}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{\frac{x}{c} \cdot y}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e189Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6436.8%
Applied rewrites36.8%
if -1e189 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.99999999999999985e-163Initial program 80.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -1.99999999999999985e-163 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000001e29Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in b around inf
lower-/.f6434.7%
Applied rewrites34.7%
if 5.0000000000000001e29 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* 9.0 (/ (* (/ x c) y) z))))
(if (<= t_1 -1e+189)
t_2
(if (<= t_1 -2e-163)
(* -4.0 (/ (* a t) c))
(if (<= t_1 5e+29) (/ (/ b c) z) t_2)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * (((x / c) * y) / z);
double tmp;
if (t_1 <= -1e+189) {
tmp = t_2;
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 5e+29) {
tmp = (b / c) / z;
} else {
tmp = t_2;
}
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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 9.0d0) * y
t_2 = 9.0d0 * (((x / c) * y) / z)
if (t_1 <= (-1d+189)) then
tmp = t_2
else if (t_1 <= (-2d-163)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (t_1 <= 5d+29) then
tmp = (b / c) / z
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * (((x / c) * y) / z);
double tmp;
if (t_1 <= -1e+189) {
tmp = t_2;
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 5e+29) {
tmp = (b / c) / z;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = 9.0 * (((x / c) * y) / z) tmp = 0 if t_1 <= -1e+189: tmp = t_2 elif t_1 <= -2e-163: tmp = -4.0 * ((a * t) / c) elif t_1 <= 5e+29: tmp = (b / c) / z else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(9.0 * Float64(Float64(Float64(x / c) * y) / z)) tmp = 0.0 if (t_1 <= -1e+189) tmp = t_2; elseif (t_1 <= -2e-163) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (t_1 <= 5e+29) tmp = Float64(Float64(b / c) / z); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; t_2 = 9.0 * (((x / c) * y) / z); tmp = 0.0; if (t_1 <= -1e+189) tmp = t_2; elseif (t_1 <= -2e-163) tmp = -4.0 * ((a * t) / c); elseif (t_1 <= 5e+29) tmp = (b / c) / z; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(N[(x / c), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+189], t$95$2, If[LessEqual[t$95$1, -2e-163], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+29], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := 9 \cdot \frac{\frac{x}{c} \cdot y}{z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+189}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-163}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+29}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e189 or 5.0000000000000001e29 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
if -1e189 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.99999999999999985e-163Initial program 80.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -1.99999999999999985e-163 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000001e29Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in b around inf
lower-/.f6434.7%
Applied rewrites34.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* (fmin x y) 9.0) (fmax x y))))
(if (<= t_1 -1e+189)
(* 9.0 (* (fmax x y) (/ (fmin x y) (* c z))))
(if (<= t_1 -2e-163)
(* -4.0 (/ (* a t) c))
(if (<= t_1 5e+29)
(/ (/ b c) z)
(* (fmax x y) (/ (* 9.0 (fmin x y)) (* c z))))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (fmin(x, y) * 9.0) * fmax(x, y);
double tmp;
if (t_1 <= -1e+189) {
tmp = 9.0 * (fmax(x, y) * (fmin(x, y) / (c * z)));
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 5e+29) {
tmp = (b / c) / z;
} else {
tmp = fmax(x, y) * ((9.0 * fmin(x, y)) / (c * 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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (fmin(x, y) * 9.0d0) * fmax(x, y)
if (t_1 <= (-1d+189)) then
tmp = 9.0d0 * (fmax(x, y) * (fmin(x, y) / (c * z)))
else if (t_1 <= (-2d-163)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (t_1 <= 5d+29) then
tmp = (b / c) / z
else
tmp = fmax(x, y) * ((9.0d0 * fmin(x, y)) / (c * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (fmin(x, y) * 9.0) * fmax(x, y);
double tmp;
if (t_1 <= -1e+189) {
tmp = 9.0 * (fmax(x, y) * (fmin(x, y) / (c * z)));
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 5e+29) {
tmp = (b / c) / z;
} else {
tmp = fmax(x, y) * ((9.0 * fmin(x, y)) / (c * z));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (fmin(x, y) * 9.0) * fmax(x, y) tmp = 0 if t_1 <= -1e+189: tmp = 9.0 * (fmax(x, y) * (fmin(x, y) / (c * z))) elif t_1 <= -2e-163: tmp = -4.0 * ((a * t) / c) elif t_1 <= 5e+29: tmp = (b / c) / z else: tmp = fmax(x, y) * ((9.0 * fmin(x, y)) / (c * z)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(fmin(x, y) * 9.0) * fmax(x, y)) tmp = 0.0 if (t_1 <= -1e+189) tmp = Float64(9.0 * Float64(fmax(x, y) * Float64(fmin(x, y) / Float64(c * z)))); elseif (t_1 <= -2e-163) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (t_1 <= 5e+29) tmp = Float64(Float64(b / c) / z); else tmp = Float64(fmax(x, y) * Float64(Float64(9.0 * fmin(x, y)) / Float64(c * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (min(x, y) * 9.0) * max(x, y); tmp = 0.0; if (t_1 <= -1e+189) tmp = 9.0 * (max(x, y) * (min(x, y) / (c * z))); elseif (t_1 <= -2e-163) tmp = -4.0 * ((a * t) / c); elseif (t_1 <= 5e+29) tmp = (b / c) / z; else tmp = max(x, y) * ((9.0 * min(x, y)) / (c * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+189], N[(9.0 * N[(N[Max[x, y], $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-163], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+29], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] * N[(N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(\mathsf{min}\left(x, y\right) \cdot 9\right) \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+189}:\\
\;\;\;\;9 \cdot \left(\mathsf{max}\left(x, y\right) \cdot \frac{\mathsf{min}\left(x, y\right)}{c \cdot z}\right)\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-163}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+29}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x, y\right) \cdot \frac{9 \cdot \mathsf{min}\left(x, y\right)}{c \cdot z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e189Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6438.5%
Applied rewrites38.5%
if -1e189 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.99999999999999985e-163Initial program 80.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -1.99999999999999985e-163 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000001e29Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in b around inf
lower-/.f6434.7%
Applied rewrites34.7%
if 5.0000000000000001e29 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
associate-/l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-/.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* 9.0 (* y (/ x (* c z))))))
(if (<= t_1 -1e+189)
t_2
(if (<= t_1 -2e-163)
(* -4.0 (/ (* a t) c))
(if (<= t_1 5e+29) (/ (/ b c) z) t_2)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * (y * (x / (c * z)));
double tmp;
if (t_1 <= -1e+189) {
tmp = t_2;
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 5e+29) {
tmp = (b / c) / z;
} else {
tmp = t_2;
}
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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 9.0d0) * y
t_2 = 9.0d0 * (y * (x / (c * z)))
if (t_1 <= (-1d+189)) then
tmp = t_2
else if (t_1 <= (-2d-163)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (t_1 <= 5d+29) then
tmp = (b / c) / z
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * (y * (x / (c * z)));
double tmp;
if (t_1 <= -1e+189) {
tmp = t_2;
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 5e+29) {
tmp = (b / c) / z;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = 9.0 * (y * (x / (c * z))) tmp = 0 if t_1 <= -1e+189: tmp = t_2 elif t_1 <= -2e-163: tmp = -4.0 * ((a * t) / c) elif t_1 <= 5e+29: tmp = (b / c) / z else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(9.0 * Float64(y * Float64(x / Float64(c * z)))) tmp = 0.0 if (t_1 <= -1e+189) tmp = t_2; elseif (t_1 <= -2e-163) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (t_1 <= 5e+29) tmp = Float64(Float64(b / c) / z); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; t_2 = 9.0 * (y * (x / (c * z))); tmp = 0.0; if (t_1 <= -1e+189) tmp = t_2; elseif (t_1 <= -2e-163) tmp = -4.0 * ((a * t) / c); elseif (t_1 <= 5e+29) tmp = (b / c) / z; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(y * N[(x / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+189], t$95$2, If[LessEqual[t$95$1, -2e-163], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+29], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := 9 \cdot \left(y \cdot \frac{x}{c \cdot z}\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+189}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-163}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+29}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e189 or 5.0000000000000001e29 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6438.5%
Applied rewrites38.5%
if -1e189 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.99999999999999985e-163Initial program 80.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -1.99999999999999985e-163 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000001e29Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in b around inf
lower-/.f6434.7%
Applied rewrites34.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* 9.0 (/ (* x y) (* c z)))))
(if (<= t_1 -1e+189)
t_2
(if (<= t_1 -2e-163)
(* -4.0 (/ (* a t) c))
(if (<= t_1 1000.0) (/ (/ b c) z) t_2)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * ((x * y) / (c * z));
double tmp;
if (t_1 <= -1e+189) {
tmp = t_2;
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 1000.0) {
tmp = (b / c) / z;
} else {
tmp = t_2;
}
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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 9.0d0) * y
t_2 = 9.0d0 * ((x * y) / (c * z))
if (t_1 <= (-1d+189)) then
tmp = t_2
else if (t_1 <= (-2d-163)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (t_1 <= 1000.0d0) then
tmp = (b / c) / z
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * ((x * y) / (c * z));
double tmp;
if (t_1 <= -1e+189) {
tmp = t_2;
} else if (t_1 <= -2e-163) {
tmp = -4.0 * ((a * t) / c);
} else if (t_1 <= 1000.0) {
tmp = (b / c) / z;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = 9.0 * ((x * y) / (c * z)) tmp = 0 if t_1 <= -1e+189: tmp = t_2 elif t_1 <= -2e-163: tmp = -4.0 * ((a * t) / c) elif t_1 <= 1000.0: tmp = (b / c) / z else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z))) tmp = 0.0 if (t_1 <= -1e+189) tmp = t_2; elseif (t_1 <= -2e-163) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (t_1 <= 1000.0) tmp = Float64(Float64(b / c) / z); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; t_2 = 9.0 * ((x * y) / (c * z)); tmp = 0.0; if (t_1 <= -1e+189) tmp = t_2; elseif (t_1 <= -2e-163) tmp = -4.0 * ((a * t) / c); elseif (t_1 <= 1000.0) tmp = (b / c) / z; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+189], t$95$2, If[LessEqual[t$95$1, -2e-163], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1000.0], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := 9 \cdot \frac{x \cdot y}{c \cdot z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+189}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-163}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;t\_1 \leq 1000:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e189 or 1e3 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
if -1e189 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.99999999999999985e-163Initial program 80.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -1.99999999999999985e-163 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e3Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in b around inf
lower-/.f6434.7%
Applied rewrites34.7%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* -4.0 (/ (* a t) c)))) (if (<= z -3.4e-76) t_1 (if (<= z 3.3e-143) (/ b (* c z)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * ((a * t) / c);
double tmp;
if (z <= -3.4e-76) {
tmp = t_1;
} else if (z <= 3.3e-143) {
tmp = b / (c * 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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * ((a * t) / c)
if (z <= (-3.4d-76)) then
tmp = t_1
else if (z <= 3.3d-143) then
tmp = b / (c * 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 c) {
double t_1 = -4.0 * ((a * t) / c);
double tmp;
if (z <= -3.4e-76) {
tmp = t_1;
} else if (z <= 3.3e-143) {
tmp = b / (c * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = -4.0 * ((a * t) / c) tmp = 0 if z <= -3.4e-76: tmp = t_1 elif z <= 3.3e-143: tmp = b / (c * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (z <= -3.4e-76) tmp = t_1; elseif (z <= 3.3e-143) tmp = Float64(b / Float64(c * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = -4.0 * ((a * t) / c); tmp = 0.0; if (z <= -3.4e-76) tmp = t_1; elseif (z <= 3.3e-143) tmp = b / (c * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e-76], t$95$1, If[LessEqual[z, 3.3e-143], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{-76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-143}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.3999999999999999e-76 or 3.3000000000000001e-143 < z Initial program 80.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -3.3999999999999999e-76 < z < 3.3000000000000001e-143Initial program 80.1%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
(FPCore (x y z t a b c) :precision binary64 (/ (/ b c) z))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (b / c) / 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, c)
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), intent (in) :: c
code = (b / c) / z
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (b / c) / z;
}
def code(x, y, z, t, a, b, c): return (b / c) / z
function code(x, y, z, t, a, b, c) return Float64(Float64(b / c) / z) end
function tmp = code(x, y, z, t, a, b, c) tmp = (b / c) / z; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]
\frac{\frac{b}{c}}{z}
Initial program 80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in b around inf
lower-/.f6434.7%
Applied rewrites34.7%
(FPCore (x y z t a b c) :precision binary64 (/ b (* c z)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * 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, c)
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), intent (in) :: c
code = b / (c * z)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
def code(x, y, z, t, a, b, c): return b / (c * z)
function code(x, y, z, t, a, b, c) return Float64(b / Float64(c * z)) end
function tmp = code(x, y, z, t, a, b, c) tmp = b / (c * z); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]
\frac{b}{c \cdot z}
Initial program 80.1%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
herbie shell --seed 2025187
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))