
(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 15 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
(let* ((t_1 (* (fabs c) (* (fmin t a) z))))
(*
(copysign 1.0 c)
(if (<= (fabs c) 4.5e-111)
(/
(fma
(* (fmax x y) 9.0)
(fmin x y)
(fma -4.0 (* (* (fmax t a) (fmin t a)) z) b))
(* z (fabs c)))
(if (<= (fabs c) 7.6e+200)
(fma
(* -4.0 (fmax t a))
(/ (fmin t a) (fabs c))
(/ (fma (* (fmax x y) (fmin x y)) 9.0 b) (* (fabs c) z)))
(*
(fmin t a)
(fma
-4.0
(/ (fmax t a) (fabs c))
(fma 9.0 (/ (* (fmin x y) (fmax x y)) t_1) (/ b t_1)))))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fabs(c) * (fmin(t, a) * z);
double tmp;
if (fabs(c) <= 4.5e-111) {
tmp = fma((fmax(x, y) * 9.0), fmin(x, y), fma(-4.0, ((fmax(t, a) * fmin(t, a)) * z), b)) / (z * fabs(c));
} else if (fabs(c) <= 7.6e+200) {
tmp = fma((-4.0 * fmax(t, a)), (fmin(t, a) / fabs(c)), (fma((fmax(x, y) * fmin(x, y)), 9.0, b) / (fabs(c) * z)));
} else {
tmp = fmin(t, a) * fma(-4.0, (fmax(t, a) / fabs(c)), fma(9.0, ((fmin(x, y) * fmax(x, y)) / t_1), (b / t_1)));
}
return copysign(1.0, c) * tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(abs(c) * Float64(fmin(t, a) * z)) tmp = 0.0 if (abs(c) <= 4.5e-111) tmp = Float64(fma(Float64(fmax(x, y) * 9.0), fmin(x, y), fma(-4.0, Float64(Float64(fmax(t, a) * fmin(t, a)) * z), b)) / Float64(z * abs(c))); elseif (abs(c) <= 7.6e+200) tmp = fma(Float64(-4.0 * fmax(t, a)), Float64(fmin(t, a) / abs(c)), Float64(fma(Float64(fmax(x, y) * fmin(x, y)), 9.0, b) / Float64(abs(c) * z))); else tmp = Float64(fmin(t, a) * fma(-4.0, Float64(fmax(t, a) / abs(c)), fma(9.0, Float64(Float64(fmin(x, y) * fmax(x, y)) / t_1), Float64(b / t_1)))); end return Float64(copysign(1.0, c) * tmp) end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[Abs[c], $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[c], $MachinePrecision], 4.5e-111], N[(N[(N[(N[Max[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Min[x, y], $MachinePrecision] + N[(-4.0 * N[(N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * N[Abs[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[c], $MachinePrecision], 7.6e+200], N[(N[(-4.0 * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] / N[Abs[c], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(N[Abs[c], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Min[t, a], $MachinePrecision] * N[(-4.0 * N[(N[Max[t, a], $MachinePrecision] / N[Abs[c], $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t_1 := \left|c\right| \cdot \left(\mathsf{min}\left(t, a\right) \cdot z\right)\\
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|c\right| \leq 4.5 \cdot 10^{-111}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{max}\left(x, y\right) \cdot 9, \mathsf{min}\left(x, y\right), \mathsf{fma}\left(-4, \left(\mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)\right) \cdot z, b\right)\right)}{z \cdot \left|c\right|}\\
\mathbf{elif}\;\left|c\right| \leq 7.6 \cdot 10^{+200}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot \mathsf{max}\left(t, a\right), \frac{\mathsf{min}\left(t, a\right)}{\left|c\right|}, \frac{\mathsf{fma}\left(\mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right), 9, b\right)}{\left|c\right| \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{min}\left(t, a\right) \cdot \mathsf{fma}\left(-4, \frac{\mathsf{max}\left(t, a\right)}{\left|c\right|}, \mathsf{fma}\left(9, \frac{\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)}{t\_1}, \frac{b}{t\_1}\right)\right)\\
\end{array}
\end{array}
if c < 4.49999999999999994e-111Initial program 79.7%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
add-flip-revN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites80.7%
if 4.49999999999999994e-111 < c < 7.59999999999999963e200Initial program 79.7%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6478.8%
Applied rewrites78.8%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.2%
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites85.0%
if 7.59999999999999963e200 < c Initial program 79.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6470.1%
Applied rewrites70.1%
(FPCore (x y z t a b c)
:precision binary64
(*
(copysign 1.0 c)
(if (<= (fabs c) 4.5e-111)
(/
(fma (* (fmax x y) 9.0) (fmin x y) (fma -4.0 (* (* a t) z) b))
(* z (fabs c)))
(fma
(* -4.0 a)
(/ t (fabs c))
(/ (fma (* (fmax x y) (fmin x y)) 9.0 b) (* (fabs c) z))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (fabs(c) <= 4.5e-111) {
tmp = fma((fmax(x, y) * 9.0), fmin(x, y), fma(-4.0, ((a * t) * z), b)) / (z * fabs(c));
} else {
tmp = fma((-4.0 * a), (t / fabs(c)), (fma((fmax(x, y) * fmin(x, y)), 9.0, b) / (fabs(c) * z)));
}
return copysign(1.0, c) * tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (abs(c) <= 4.5e-111) tmp = Float64(fma(Float64(fmax(x, y) * 9.0), fmin(x, y), fma(-4.0, Float64(Float64(a * t) * z), b)) / Float64(z * abs(c))); else tmp = fma(Float64(-4.0 * a), Float64(t / abs(c)), Float64(fma(Float64(fmax(x, y) * fmin(x, y)), 9.0, b) / 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], 4.5e-111], N[(N[(N[(N[Max[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Min[x, y], $MachinePrecision] + N[(-4.0 * N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * N[Abs[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / N[Abs[c], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(N[Abs[c], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|c\right| \leq 4.5 \cdot 10^{-111}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{max}\left(x, y\right) \cdot 9, \mathsf{min}\left(x, y\right), \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot \left|c\right|}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{\left|c\right|}, \frac{\mathsf{fma}\left(\mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right), 9, b\right)}{\left|c\right| \cdot z}\right)\\
\end{array}
if c < 4.49999999999999994e-111Initial program 79.7%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
add-flip-revN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites80.7%
if 4.49999999999999994e-111 < c Initial program 79.7%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6478.8%
Applied rewrites78.8%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.2%
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites85.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(/
(fma
(* (fmax x y) 9.0)
(fmin x y)
(fma -4.0 (* (* (fmax t a) (fmin t a)) z) b))
(* z c)))
(t_2
(/
(+
(-
(* (* (fmin x y) 9.0) (fmax x y))
(* (* (* z 4.0) (fmin t a)) (fmax t a)))
b)
(* z c)))
(t_3 (* -4.0 (fmax t a))))
(if (<= t_2 -5e-223)
t_1
(if (<= t_2 0.0)
(/ (/ (fma (* (fmin t a) t_3) z (* (fmax x y) (* 9.0 (fmin x y)))) z) c)
(if (<= t_2 INFINITY) t_1 (fma t_3 (/ (fmin t a) c) (/ b (* c z))))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((fmax(x, y) * 9.0), fmin(x, y), fma(-4.0, ((fmax(t, a) * fmin(t, a)) * z), b)) / (z * c);
double t_2 = ((((fmin(x, y) * 9.0) * fmax(x, y)) - (((z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / (z * c);
double t_3 = -4.0 * fmax(t, a);
double tmp;
if (t_2 <= -5e-223) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = (fma((fmin(t, a) * t_3), z, (fmax(x, y) * (9.0 * fmin(x, y)))) / z) / c;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(t_3, (fmin(t, a) / c), (b / (c * z)));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(fma(Float64(fmax(x, y) * 9.0), fmin(x, y), fma(-4.0, Float64(Float64(fmax(t, a) * fmin(t, a)) * z), b)) / Float64(z * c)) t_2 = Float64(Float64(Float64(Float64(Float64(fmin(x, y) * 9.0) * fmax(x, y)) - Float64(Float64(Float64(z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / Float64(z * c)) t_3 = Float64(-4.0 * fmax(t, a)) tmp = 0.0 if (t_2 <= -5e-223) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(Float64(fma(Float64(fmin(t, a) * t_3), z, Float64(fmax(x, y) * Float64(9.0 * fmin(x, y)))) / z) / c); elseif (t_2 <= Inf) tmp = t_1; else tmp = fma(t_3, Float64(fmin(t, a) / c), Float64(b / Float64(c * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[Max[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Min[x, y], $MachinePrecision] + N[(-4.0 * N[(N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $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]}, Block[{t$95$3 = N[(-4.0 * N[Max[t, a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-223], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(N[(N[(N[Min[t, a], $MachinePrecision] * t$95$3), $MachinePrecision] * z + N[(N[Max[x, y], $MachinePrecision] * N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$1, N[(t$95$3 * N[(N[Min[t, a], $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(\mathsf{max}\left(x, y\right) \cdot 9, \mathsf{min}\left(x, y\right), \mathsf{fma}\left(-4, \left(\mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)\right) \cdot z, b\right)\right)}{z \cdot c}\\
t_2 := \frac{\left(\left(\mathsf{min}\left(x, y\right) \cdot 9\right) \cdot \mathsf{max}\left(x, y\right) - \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}\\
t_3 := -4 \cdot \mathsf{max}\left(t, a\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-223}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{min}\left(t, a\right) \cdot t\_3, z, \mathsf{max}\left(x, y\right) \cdot \left(9 \cdot \mathsf{min}\left(x, y\right)\right)\right)}{z}}{c}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_3, \frac{\mathsf{min}\left(t, a\right)}{c}, \frac{b}{c \cdot z}\right)\\
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -5.00000000000000024e-223 or -0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 79.7%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
add-flip-revN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites80.7%
if -5.00000000000000024e-223 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -0.0Initial program 79.7%
Taylor expanded in b around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6455.9%
Applied rewrites55.9%
Applied rewrites58.3%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 79.7%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6478.8%
Applied rewrites78.8%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.2%
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites85.0%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6463.9%
Applied rewrites63.9%
(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 (fmax t a))))
(if (<= t_1 -2e+212)
(/ (* (* (fmin x y) (/ (fmax x y) c)) 9.0) z)
(if (<= t_1 5e+50)
(fma (/ t_2 c) (fmin t a) (/ b (* c z)))
(/
(/ (fma (* (fmin t a) t_2) z (* (fmax x y) (* 9.0 (fmin x y)))) z)
c)))))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 * fmax(t, a);
double tmp;
if (t_1 <= -2e+212) {
tmp = ((fmin(x, y) * (fmax(x, y) / c)) * 9.0) / z;
} else if (t_1 <= 5e+50) {
tmp = fma((t_2 / c), fmin(t, a), (b / (c * z)));
} else {
tmp = (fma((fmin(t, a) * t_2), z, (fmax(x, y) * (9.0 * fmin(x, y)))) / z) / c;
}
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 * fmax(t, a)) tmp = 0.0 if (t_1 <= -2e+212) tmp = Float64(Float64(Float64(fmin(x, y) * Float64(fmax(x, y) / c)) * 9.0) / z); elseif (t_1 <= 5e+50) tmp = fma(Float64(t_2 / c), fmin(t, a), Float64(b / Float64(c * z))); else tmp = Float64(Float64(fma(Float64(fmin(t, a) * t_2), z, Float64(fmax(x, y) * Float64(9.0 * fmin(x, y)))) / z) / c); 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]}, Block[{t$95$2 = N[(-4.0 * N[Max[t, a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+212], N[(N[(N[(N[Min[x, y], $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 5e+50], N[(N[(t$95$2 / c), $MachinePrecision] * N[Min[t, a], $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[Min[t, a], $MachinePrecision] * t$95$2), $MachinePrecision] * z + N[(N[Max[x, y], $MachinePrecision] * N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $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 \mathsf{max}\left(t, a\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+212}:\\
\;\;\;\;\frac{\left(\mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right)}{c}\right) \cdot 9}{z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+50}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_2}{c}, \mathsf{min}\left(t, a\right), \frac{b}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{min}\left(t, a\right) \cdot t\_2, z, \mathsf{max}\left(x, y\right) \cdot \left(9 \cdot \mathsf{min}\left(x, y\right)\right)\right)}{z}}{c}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.9999999999999998e212Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.5%
Applied rewrites36.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.1%
Applied rewrites36.1%
if -1.9999999999999998e212 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5e50Initial program 79.7%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6478.8%
Applied rewrites78.8%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.2%
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites85.0%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6463.9%
Applied rewrites63.9%
lift-fma.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6464.2%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6464.2%
Applied rewrites64.2%
if 5e50 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.7%
Taylor expanded in b around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6455.9%
Applied rewrites55.9%
Applied rewrites58.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* (fmin x y) 9.0) (fmax x y))))
(if (<= t_1 -2e+212)
(/ (* (* (fmin x y) (/ (fmax x y) c)) 9.0) z)
(if (<= t_1 5e+121)
(fma (/ (* -4.0 (fmax t a)) c) (fmin t a) (/ b (* c z)))
(* (fmax x y) (/ (* (/ (fmin x y) c) 9.0) 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 <= -2e+212) {
tmp = ((fmin(x, y) * (fmax(x, y) / c)) * 9.0) / z;
} else if (t_1 <= 5e+121) {
tmp = fma(((-4.0 * fmax(t, a)) / c), fmin(t, a), (b / (c * z)));
} else {
tmp = fmax(x, y) * (((fmin(x, y) / c) * 9.0) / 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 <= -2e+212) tmp = Float64(Float64(Float64(fmin(x, y) * Float64(fmax(x, y) / c)) * 9.0) / z); elseif (t_1 <= 5e+121) tmp = fma(Float64(Float64(-4.0 * fmax(t, a)) / c), fmin(t, a), Float64(b / Float64(c * z))); else tmp = Float64(fmax(x, y) * Float64(Float64(Float64(fmin(x, y) / c) * 9.0) / 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, -2e+212], N[(N[(N[(N[Min[x, y], $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 5e+121], N[(N[(N[(-4.0 * N[Max[t, a], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] * N[Min[t, a], $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] * N[(N[(N[(N[Min[x, y], $MachinePrecision] / c), $MachinePrecision] * 9.0), $MachinePrecision] / z), $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 -2 \cdot 10^{+212}:\\
\;\;\;\;\frac{\left(\mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right)}{c}\right) \cdot 9}{z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+121}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-4 \cdot \mathsf{max}\left(t, a\right)}{c}, \mathsf{min}\left(t, a\right), \frac{b}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x, y\right) \cdot \frac{\frac{\mathsf{min}\left(x, y\right)}{c} \cdot 9}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.9999999999999998e212Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.5%
Applied rewrites36.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.1%
Applied rewrites36.1%
if -1.9999999999999998e212 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.00000000000000007e121Initial program 79.7%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6478.8%
Applied rewrites78.8%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.2%
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites85.0%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6463.9%
Applied rewrites63.9%
lift-fma.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6464.2%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6464.2%
Applied rewrites64.2%
if 5.00000000000000007e121 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.5%
Applied rewrites36.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.4%
Applied rewrites37.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* (fmin x y) 9.0) (fmax x y))))
(if (<= t_1 -2e+212)
(/ (* (* (fmin x y) (/ (fmax x y) c)) 9.0) z)
(if (<= t_1 5e+121)
(fma (* -4.0 a) (/ t c) (/ b (* c z)))
(* (fmax x y) (/ (* (/ (fmin x y) c) 9.0) 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 <= -2e+212) {
tmp = ((fmin(x, y) * (fmax(x, y) / c)) * 9.0) / z;
} else if (t_1 <= 5e+121) {
tmp = fma((-4.0 * a), (t / c), (b / (c * z)));
} else {
tmp = fmax(x, y) * (((fmin(x, y) / c) * 9.0) / 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 <= -2e+212) tmp = Float64(Float64(Float64(fmin(x, y) * Float64(fmax(x, y) / c)) * 9.0) / z); elseif (t_1 <= 5e+121) tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(b / Float64(c * z))); else tmp = Float64(fmax(x, y) * Float64(Float64(Float64(fmin(x, y) / c) * 9.0) / 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, -2e+212], N[(N[(N[(N[Min[x, y], $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 5e+121], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] * N[(N[(N[(N[Min[x, y], $MachinePrecision] / c), $MachinePrecision] * 9.0), $MachinePrecision] / z), $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 -2 \cdot 10^{+212}:\\
\;\;\;\;\frac{\left(\mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right)}{c}\right) \cdot 9}{z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+121}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x, y\right) \cdot \frac{\frac{\mathsf{min}\left(x, y\right)}{c} \cdot 9}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.9999999999999998e212Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.5%
Applied rewrites36.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.1%
Applied rewrites36.1%
if -1.9999999999999998e212 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.00000000000000007e121Initial program 79.7%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6478.8%
Applied rewrites78.8%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.2%
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites85.0%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6463.9%
Applied rewrites63.9%
if 5.00000000000000007e121 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.5%
Applied rewrites36.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.4%
Applied rewrites37.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* (fmin x y) 9.0) (fmax x y))))
(if (<= t_1 -2e+212)
(/ (* (* (fmin x y) (/ (fmax x y) c)) 9.0) z)
(if (<= t_1 5e+121)
(fma -4.0 (/ (* a t) c) (/ b (* c z)))
(* (fmax x y) (/ (* (/ (fmin x y) c) 9.0) 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 <= -2e+212) {
tmp = ((fmin(x, y) * (fmax(x, y) / c)) * 9.0) / z;
} else if (t_1 <= 5e+121) {
tmp = fma(-4.0, ((a * t) / c), (b / (c * z)));
} else {
tmp = fmax(x, y) * (((fmin(x, y) / c) * 9.0) / 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 <= -2e+212) tmp = Float64(Float64(Float64(fmin(x, y) * Float64(fmax(x, y) / c)) * 9.0) / z); elseif (t_1 <= 5e+121) tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(b / Float64(c * z))); else tmp = Float64(fmax(x, y) * Float64(Float64(Float64(fmin(x, y) / c) * 9.0) / 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, -2e+212], N[(N[(N[(N[Min[x, y], $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 5e+121], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] * N[(N[(N[(N[Min[x, y], $MachinePrecision] / c), $MachinePrecision] * 9.0), $MachinePrecision] / z), $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 -2 \cdot 10^{+212}:\\
\;\;\;\;\frac{\left(\mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right)}{c}\right) \cdot 9}{z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+121}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x, y\right) \cdot \frac{\frac{\mathsf{min}\left(x, y\right)}{c} \cdot 9}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.9999999999999998e212Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.5%
Applied rewrites36.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.1%
Applied rewrites36.1%
if -1.9999999999999998e212 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.00000000000000007e121Initial program 79.7%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6478.8%
Applied rewrites78.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6463.4%
Applied rewrites63.4%
if 5.00000000000000007e121 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.5%
Applied rewrites36.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.4%
Applied rewrites37.4%
(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+142)
(/ (* (* (fmin x y) (/ (fmax x y) c)) 9.0) z)
(if (<= t_1 5e+121)
(/ (fma (* (* -4.0 z) (fmax t a)) (fmin t a) b) (* c z))
(* (fmax x y) (/ (* (/ (fmin x y) c) 9.0) 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+142) {
tmp = ((fmin(x, y) * (fmax(x, y) / c)) * 9.0) / z;
} else if (t_1 <= 5e+121) {
tmp = fma(((-4.0 * z) * fmax(t, a)), fmin(t, a), b) / (c * z);
} else {
tmp = fmax(x, y) * (((fmin(x, y) / c) * 9.0) / 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+142) tmp = Float64(Float64(Float64(fmin(x, y) * Float64(fmax(x, y) / c)) * 9.0) / z); elseif (t_1 <= 5e+121) tmp = Float64(fma(Float64(Float64(-4.0 * z) * fmax(t, a)), fmin(t, a), b) / Float64(c * z)); else tmp = Float64(fmax(x, y) * Float64(Float64(Float64(fmin(x, y) / c) * 9.0) / 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+142], N[(N[(N[(N[Min[x, y], $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 5e+121], N[(N[(N[(N[(-4.0 * z), $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[Min[t, a], $MachinePrecision] + b), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] * N[(N[(N[(N[Min[x, y], $MachinePrecision] / c), $MachinePrecision] * 9.0), $MachinePrecision] / z), $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^{+142}:\\
\;\;\;\;\frac{\left(\mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right)}{c}\right) \cdot 9}{z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+121}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot \mathsf{max}\left(t, a\right), \mathsf{min}\left(t, a\right), b\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x, y\right) \cdot \frac{\frac{\mathsf{min}\left(x, y\right)}{c} \cdot 9}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.00000000000000005e142Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.5%
Applied rewrites36.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.1%
Applied rewrites36.1%
if -1.00000000000000005e142 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.00000000000000007e121Initial program 79.7%
lift-/.f64N/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites79.6%
Taylor expanded in x around 0
Applied rewrites57.1%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6457.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6457.1%
Applied rewrites57.1%
if 5.00000000000000007e121 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.5%
Applied rewrites36.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.4%
Applied rewrites37.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (/ (* a t) c))))
(if (<= t -1.26e+141)
t_1
(if (<= t 1.8e-25) (/ (+ b (* 9.0 (* x y))) (* z c)) 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 (t <= -1.26e+141) {
tmp = t_1;
} else if (t <= 1.8e-25) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} 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 (t <= (-1.26d+141)) then
tmp = t_1
else if (t <= 1.8d-25) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
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 (t <= -1.26e+141) {
tmp = t_1;
} else if (t <= 1.8e-25) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} 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 t <= -1.26e+141: tmp = t_1 elif t <= 1.8e-25: tmp = (b + (9.0 * (x * y))) / (z * c) 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 (t <= -1.26e+141) tmp = t_1; elseif (t <= 1.8e-25) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); 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 (t <= -1.26e+141) tmp = t_1; elseif (t <= 1.8e-25) tmp = (b + (9.0 * (x * y))) / (z * c); 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[t, -1.26e+141], t$95$1, If[LessEqual[t, 1.8e-25], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;t \leq -1.26 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-25}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.25999999999999994e141 or 1.8e-25 < t Initial program 79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
if -1.25999999999999994e141 < t < 1.8e-25Initial program 79.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.3%
Applied rewrites60.3%
(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 -5e+48)
(/ (* (* (fmin x y) (/ (fmax x y) c)) 9.0) z)
(if (<= t_1 -1e-203)
t_2
(if (<= t_1 1e-296)
(/ 1.0 (/ c (/ b z)))
(if (<= t_1 5e+87)
t_2
(* (fmax x y) (/ (* (/ (fmin x y) c) 9.0) 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 <= -5e+48) {
tmp = ((fmin(x, y) * (fmax(x, y) / c)) * 9.0) / z;
} else if (t_1 <= -1e-203) {
tmp = t_2;
} else if (t_1 <= 1e-296) {
tmp = 1.0 / (c / (b / z));
} else if (t_1 <= 5e+87) {
tmp = t_2;
} else {
tmp = fmax(x, y) * (((fmin(x, y) / c) * 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) :: 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 <= (-5d+48)) then
tmp = ((fmin(x, y) * (fmax(x, y) / c)) * 9.0d0) / z
else if (t_1 <= (-1d-203)) then
tmp = t_2
else if (t_1 <= 1d-296) then
tmp = 1.0d0 / (c / (b / z))
else if (t_1 <= 5d+87) then
tmp = t_2
else
tmp = fmax(x, y) * (((fmin(x, y) / c) * 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 = (fmin(x, y) * 9.0) * fmax(x, y);
double t_2 = -4.0 * ((a * t) / c);
double tmp;
if (t_1 <= -5e+48) {
tmp = ((fmin(x, y) * (fmax(x, y) / c)) * 9.0) / z;
} else if (t_1 <= -1e-203) {
tmp = t_2;
} else if (t_1 <= 1e-296) {
tmp = 1.0 / (c / (b / z));
} else if (t_1 <= 5e+87) {
tmp = t_2;
} else {
tmp = fmax(x, y) * (((fmin(x, y) / c) * 9.0) / 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 <= -5e+48: tmp = ((fmin(x, y) * (fmax(x, y) / c)) * 9.0) / z elif t_1 <= -1e-203: tmp = t_2 elif t_1 <= 1e-296: tmp = 1.0 / (c / (b / z)) elif t_1 <= 5e+87: tmp = t_2 else: tmp = fmax(x, y) * (((fmin(x, y) / c) * 9.0) / 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 <= -5e+48) tmp = Float64(Float64(Float64(fmin(x, y) * Float64(fmax(x, y) / c)) * 9.0) / z); elseif (t_1 <= -1e-203) tmp = t_2; elseif (t_1 <= 1e-296) tmp = Float64(1.0 / Float64(c / Float64(b / z))); elseif (t_1 <= 5e+87) tmp = t_2; else tmp = Float64(fmax(x, y) * Float64(Float64(Float64(fmin(x, y) / c) * 9.0) / 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 <= -5e+48) tmp = ((min(x, y) * (max(x, y) / c)) * 9.0) / z; elseif (t_1 <= -1e-203) tmp = t_2; elseif (t_1 <= 1e-296) tmp = 1.0 / (c / (b / z)); elseif (t_1 <= 5e+87) tmp = t_2; else tmp = max(x, y) * (((min(x, y) / c) * 9.0) / 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, -5e+48], N[(N[(N[(N[Min[x, y], $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, -1e-203], t$95$2, If[LessEqual[t$95$1, 1e-296], N[(1.0 / N[(c / N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+87], t$95$2, N[(N[Max[x, y], $MachinePrecision] * N[(N[(N[(N[Min[x, y], $MachinePrecision] / c), $MachinePrecision] * 9.0), $MachinePrecision] / z), $MachinePrecision]), $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 -5 \cdot 10^{+48}:\\
\;\;\;\;\frac{\left(\mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right)}{c}\right) \cdot 9}{z}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-203}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-296}:\\
\;\;\;\;\frac{1}{\frac{c}{\frac{b}{z}}}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+87}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x, y\right) \cdot \frac{\frac{\mathsf{min}\left(x, y\right)}{c} \cdot 9}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -4.99999999999999973e48Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.5%
Applied rewrites36.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.1%
Applied rewrites36.1%
if -4.99999999999999973e48 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e-203 or 1e-296 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.9999999999999998e87Initial program 79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
if -1e-203 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e-296Initial program 79.7%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6436.1%
Applied rewrites36.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6434.1%
Applied rewrites34.1%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6434.1%
Applied rewrites34.1%
if 4.9999999999999998e87 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.5%
Applied rewrites36.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.4%
Applied rewrites37.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (/ (* a t) c)))
(t_2 (* (* x 9.0) y))
(t_3 (* y (/ (* (/ x c) 9.0) z))))
(if (<= t_2 -1e+43)
t_3
(if (<= t_2 -1e-203)
t_1
(if (<= t_2 1e-296)
(/ 1.0 (/ c (/ b z)))
(if (<= t_2 5e+87) t_1 t_3))))))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 t_2 = (x * 9.0) * y;
double t_3 = y * (((x / c) * 9.0) / z);
double tmp;
if (t_2 <= -1e+43) {
tmp = t_3;
} else if (t_2 <= -1e-203) {
tmp = t_1;
} else if (t_2 <= 1e-296) {
tmp = 1.0 / (c / (b / z));
} else if (t_2 <= 5e+87) {
tmp = t_1;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = (-4.0d0) * ((a * t) / c)
t_2 = (x * 9.0d0) * y
t_3 = y * (((x / c) * 9.0d0) / z)
if (t_2 <= (-1d+43)) then
tmp = t_3
else if (t_2 <= (-1d-203)) then
tmp = t_1
else if (t_2 <= 1d-296) then
tmp = 1.0d0 / (c / (b / z))
else if (t_2 <= 5d+87) then
tmp = t_1
else
tmp = t_3
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 t_2 = (x * 9.0) * y;
double t_3 = y * (((x / c) * 9.0) / z);
double tmp;
if (t_2 <= -1e+43) {
tmp = t_3;
} else if (t_2 <= -1e-203) {
tmp = t_1;
} else if (t_2 <= 1e-296) {
tmp = 1.0 / (c / (b / z));
} else if (t_2 <= 5e+87) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = -4.0 * ((a * t) / c) t_2 = (x * 9.0) * y t_3 = y * (((x / c) * 9.0) / z) tmp = 0 if t_2 <= -1e+43: tmp = t_3 elif t_2 <= -1e-203: tmp = t_1 elif t_2 <= 1e-296: tmp = 1.0 / (c / (b / z)) elif t_2 <= 5e+87: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(Float64(a * t) / c)) t_2 = Float64(Float64(x * 9.0) * y) t_3 = Float64(y * Float64(Float64(Float64(x / c) * 9.0) / z)) tmp = 0.0 if (t_2 <= -1e+43) tmp = t_3; elseif (t_2 <= -1e-203) tmp = t_1; elseif (t_2 <= 1e-296) tmp = Float64(1.0 / Float64(c / Float64(b / z))); elseif (t_2 <= 5e+87) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = -4.0 * ((a * t) / c); t_2 = (x * 9.0) * y; t_3 = y * (((x / c) * 9.0) / z); tmp = 0.0; if (t_2 <= -1e+43) tmp = t_3; elseif (t_2 <= -1e-203) tmp = t_1; elseif (t_2 <= 1e-296) tmp = 1.0 / (c / (b / z)); elseif (t_2 <= 5e+87) tmp = t_1; else tmp = t_3; 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]}, Block[{t$95$2 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$3 = N[(y * N[(N[(N[(x / c), $MachinePrecision] * 9.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+43], t$95$3, If[LessEqual[t$95$2, -1e-203], t$95$1, If[LessEqual[t$95$2, 1e-296], N[(1.0 / N[(c / N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+87], t$95$1, t$95$3]]]]]]]
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
t_2 := \left(x \cdot 9\right) \cdot y\\
t_3 := y \cdot \frac{\frac{x}{c} \cdot 9}{z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+43}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-203}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-296}:\\
\;\;\;\;\frac{1}{\frac{c}{\frac{b}{z}}}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.00000000000000001e43 or 4.9999999999999998e87 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.5%
Applied rewrites36.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.4%
Applied rewrites37.4%
if -1.00000000000000001e43 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e-203 or 1e-296 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.9999999999999998e87Initial program 79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
if -1e-203 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e-296Initial program 79.7%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6436.1%
Applied rewrites36.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6434.1%
Applied rewrites34.1%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6434.1%
Applied rewrites34.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (/ (fmax x y) (* c z)) (* 9.0 (fmin x y))))
(t_2 (* (* (fmin x y) 9.0) (fmax x y)))
(t_3 (* -4.0 (/ (* a t) c))))
(if (<= t_2 -1e+142)
t_1
(if (<= t_2 -1e-203)
t_3
(if (<= t_2 1e-296)
(/ 1.0 (/ c (/ b z)))
(if (<= t_2 1e+79) t_3 t_1))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (fmax(x, y) / (c * z)) * (9.0 * fmin(x, y));
double t_2 = (fmin(x, y) * 9.0) * fmax(x, y);
double t_3 = -4.0 * ((a * t) / c);
double tmp;
if (t_2 <= -1e+142) {
tmp = t_1;
} else if (t_2 <= -1e-203) {
tmp = t_3;
} else if (t_2 <= 1e-296) {
tmp = 1.0 / (c / (b / z));
} else if (t_2 <= 1e+79) {
tmp = t_3;
} 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (fmax(x, y) / (c * z)) * (9.0d0 * fmin(x, y))
t_2 = (fmin(x, y) * 9.0d0) * fmax(x, y)
t_3 = (-4.0d0) * ((a * t) / c)
if (t_2 <= (-1d+142)) then
tmp = t_1
else if (t_2 <= (-1d-203)) then
tmp = t_3
else if (t_2 <= 1d-296) then
tmp = 1.0d0 / (c / (b / z))
else if (t_2 <= 1d+79) then
tmp = t_3
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 = (fmax(x, y) / (c * z)) * (9.0 * fmin(x, y));
double t_2 = (fmin(x, y) * 9.0) * fmax(x, y);
double t_3 = -4.0 * ((a * t) / c);
double tmp;
if (t_2 <= -1e+142) {
tmp = t_1;
} else if (t_2 <= -1e-203) {
tmp = t_3;
} else if (t_2 <= 1e-296) {
tmp = 1.0 / (c / (b / z));
} else if (t_2 <= 1e+79) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (fmax(x, y) / (c * z)) * (9.0 * fmin(x, y)) t_2 = (fmin(x, y) * 9.0) * fmax(x, y) t_3 = -4.0 * ((a * t) / c) tmp = 0 if t_2 <= -1e+142: tmp = t_1 elif t_2 <= -1e-203: tmp = t_3 elif t_2 <= 1e-296: tmp = 1.0 / (c / (b / z)) elif t_2 <= 1e+79: tmp = t_3 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(fmax(x, y) / Float64(c * z)) * Float64(9.0 * fmin(x, y))) t_2 = Float64(Float64(fmin(x, y) * 9.0) * fmax(x, y)) t_3 = Float64(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (t_2 <= -1e+142) tmp = t_1; elseif (t_2 <= -1e-203) tmp = t_3; elseif (t_2 <= 1e-296) tmp = Float64(1.0 / Float64(c / Float64(b / z))); elseif (t_2 <= 1e+79) tmp = t_3; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (max(x, y) / (c * z)) * (9.0 * min(x, y)); t_2 = (min(x, y) * 9.0) * max(x, y); t_3 = -4.0 * ((a * t) / c); tmp = 0.0; if (t_2 <= -1e+142) tmp = t_1; elseif (t_2 <= -1e-203) tmp = t_3; elseif (t_2 <= 1e-296) tmp = 1.0 / (c / (b / z)); elseif (t_2 <= 1e+79) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[Max[x, y], $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision] * N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+142], t$95$1, If[LessEqual[t$95$2, -1e-203], t$95$3, If[LessEqual[t$95$2, 1e-296], N[(1.0 / N[(c / N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+79], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
t_1 := \frac{\mathsf{max}\left(x, y\right)}{c \cdot z} \cdot \left(9 \cdot \mathsf{min}\left(x, y\right)\right)\\
t_2 := \left(\mathsf{min}\left(x, y\right) \cdot 9\right) \cdot \mathsf{max}\left(x, y\right)\\
t_3 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-203}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{-296}:\\
\;\;\;\;\frac{1}{\frac{c}{\frac{b}{z}}}\\
\mathbf{elif}\;t\_2 \leq 10^{+79}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.00000000000000005e142 or 9.99999999999999967e78 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.4%
Applied rewrites37.4%
if -1.00000000000000005e142 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e-203 or 1e-296 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999967e78Initial program 79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
if -1e-203 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e-296Initial program 79.7%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6436.1%
Applied rewrites36.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6434.1%
Applied rewrites34.1%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6434.1%
Applied rewrites34.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (/ (* a t) c)))
(t_2 (* (* x 9.0) y))
(t_3 (* 9.0 (* y (/ x (* c z))))))
(if (<= t_2 -1e+142)
t_3
(if (<= t_2 -1e-203)
t_1
(if (<= t_2 1e-296)
(/ 1.0 (/ c (/ b z)))
(if (<= t_2 5e+87) t_1 t_3))))))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 t_2 = (x * 9.0) * y;
double t_3 = 9.0 * (y * (x / (c * z)));
double tmp;
if (t_2 <= -1e+142) {
tmp = t_3;
} else if (t_2 <= -1e-203) {
tmp = t_1;
} else if (t_2 <= 1e-296) {
tmp = 1.0 / (c / (b / z));
} else if (t_2 <= 5e+87) {
tmp = t_1;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = (-4.0d0) * ((a * t) / c)
t_2 = (x * 9.0d0) * y
t_3 = 9.0d0 * (y * (x / (c * z)))
if (t_2 <= (-1d+142)) then
tmp = t_3
else if (t_2 <= (-1d-203)) then
tmp = t_1
else if (t_2 <= 1d-296) then
tmp = 1.0d0 / (c / (b / z))
else if (t_2 <= 5d+87) then
tmp = t_1
else
tmp = t_3
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 t_2 = (x * 9.0) * y;
double t_3 = 9.0 * (y * (x / (c * z)));
double tmp;
if (t_2 <= -1e+142) {
tmp = t_3;
} else if (t_2 <= -1e-203) {
tmp = t_1;
} else if (t_2 <= 1e-296) {
tmp = 1.0 / (c / (b / z));
} else if (t_2 <= 5e+87) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = -4.0 * ((a * t) / c) t_2 = (x * 9.0) * y t_3 = 9.0 * (y * (x / (c * z))) tmp = 0 if t_2 <= -1e+142: tmp = t_3 elif t_2 <= -1e-203: tmp = t_1 elif t_2 <= 1e-296: tmp = 1.0 / (c / (b / z)) elif t_2 <= 5e+87: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(Float64(a * t) / c)) t_2 = Float64(Float64(x * 9.0) * y) t_3 = Float64(9.0 * Float64(y * Float64(x / Float64(c * z)))) tmp = 0.0 if (t_2 <= -1e+142) tmp = t_3; elseif (t_2 <= -1e-203) tmp = t_1; elseif (t_2 <= 1e-296) tmp = Float64(1.0 / Float64(c / Float64(b / z))); elseif (t_2 <= 5e+87) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = -4.0 * ((a * t) / c); t_2 = (x * 9.0) * y; t_3 = 9.0 * (y * (x / (c * z))); tmp = 0.0; if (t_2 <= -1e+142) tmp = t_3; elseif (t_2 <= -1e-203) tmp = t_1; elseif (t_2 <= 1e-296) tmp = 1.0 / (c / (b / z)); elseif (t_2 <= 5e+87) tmp = t_1; else tmp = t_3; 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]}, Block[{t$95$2 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$3 = N[(9.0 * N[(y * N[(x / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+142], t$95$3, If[LessEqual[t$95$2, -1e-203], t$95$1, If[LessEqual[t$95$2, 1e-296], N[(1.0 / N[(c / N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+87], t$95$1, t$95$3]]]]]]]
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
t_2 := \left(x \cdot 9\right) \cdot y\\
t_3 := 9 \cdot \left(y \cdot \frac{x}{c \cdot z}\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+142}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-203}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-296}:\\
\;\;\;\;\frac{1}{\frac{c}{\frac{b}{z}}}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.00000000000000005e142 or 4.9999999999999998e87 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6437.6%
Applied rewrites37.6%
if -1.00000000000000005e142 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e-203 or 1e-296 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.9999999999999998e87Initial program 79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
if -1e-203 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e-296Initial program 79.7%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6436.1%
Applied rewrites36.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6434.1%
Applied rewrites34.1%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6434.1%
Applied rewrites34.1%
(FPCore (x y z t a b c) :precision binary64 (if (<= b -3.1e+78) (/ b (* c z)) (if (<= b 1.8e+56) (* -4.0 (/ (* a t) c)) (/ (/ b c) z))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -3.1e+78) {
tmp = b / (c * z);
} else if (b <= 1.8e+56) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = (b / 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) :: tmp
if (b <= (-3.1d+78)) then
tmp = b / (c * z)
else if (b <= 1.8d+56) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = (b / 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 tmp;
if (b <= -3.1e+78) {
tmp = b / (c * z);
} else if (b <= 1.8e+56) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = (b / c) / z;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if b <= -3.1e+78: tmp = b / (c * z) elif b <= 1.8e+56: tmp = -4.0 * ((a * t) / c) else: tmp = (b / c) / z return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -3.1e+78) tmp = Float64(b / Float64(c * z)); elseif (b <= 1.8e+56) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(Float64(b / c) / z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (b <= -3.1e+78) tmp = b / (c * z); elseif (b <= 1.8e+56) tmp = -4.0 * ((a * t) / c); else tmp = (b / c) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -3.1e+78], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.8e+56], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \leq -3.1 \cdot 10^{+78}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{+56}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
if b < -3.1e78Initial program 79.7%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6436.1%
Applied rewrites36.1%
if -3.1e78 < b < 1.79999999999999999e56Initial program 79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
if 1.79999999999999999e56 < b Initial program 79.7%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6436.1%
Applied rewrites36.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6435.6%
Applied rewrites35.6%
(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 79.7%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6436.1%
Applied rewrites36.1%
herbie shell --seed 2025183
(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)))