
(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
(let* ((t_1 (* (* (fmin x y) 9.0) (fmax x y)))
(t_2 (* z (fabs c)))
(t_3 (/ (+ (- t_1 (* (* (* z 4.0) t) a)) b) t_2)))
(*
(copysign 1.0 c)
(if (<= t_3 -5e+43)
(/ (+ (- t_1 (* (* (* a z) 4.0) t)) b) t_2)
(if (<= t_3 2e-111)
(/ (/ (- (+ t_1 b) (* (* (* t a) 4.0) z)) z) (fabs c))
(if (<= t_3 INFINITY) t_3 (* (* -4.0 a) (/ t (fabs 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 = z * fabs(c);
double t_3 = ((t_1 - (((z * 4.0) * t) * a)) + b) / t_2;
double tmp;
if (t_3 <= -5e+43) {
tmp = ((t_1 - (((a * z) * 4.0) * t)) + b) / t_2;
} else if (t_3 <= 2e-111) {
tmp = (((t_1 + b) - (((t * a) * 4.0) * z)) / z) / fabs(c);
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (-4.0 * a) * (t / fabs(c));
}
return copysign(1.0, c) * tmp;
}
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 = z * Math.abs(c);
double t_3 = ((t_1 - (((z * 4.0) * t) * a)) + b) / t_2;
double tmp;
if (t_3 <= -5e+43) {
tmp = ((t_1 - (((a * z) * 4.0) * t)) + b) / t_2;
} else if (t_3 <= 2e-111) {
tmp = (((t_1 + b) - (((t * a) * 4.0) * z)) / z) / Math.abs(c);
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = (-4.0 * a) * (t / Math.abs(c));
}
return Math.copySign(1.0, c) * tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (fmin(x, y) * 9.0) * fmax(x, y) t_2 = z * math.fabs(c) t_3 = ((t_1 - (((z * 4.0) * t) * a)) + b) / t_2 tmp = 0 if t_3 <= -5e+43: tmp = ((t_1 - (((a * z) * 4.0) * t)) + b) / t_2 elif t_3 <= 2e-111: tmp = (((t_1 + b) - (((t * a) * 4.0) * z)) / z) / math.fabs(c) elif t_3 <= math.inf: tmp = t_3 else: tmp = (-4.0 * a) * (t / math.fabs(c)) return math.copysign(1.0, c) * 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(z * abs(c)) t_3 = Float64(Float64(Float64(t_1 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / t_2) tmp = 0.0 if (t_3 <= -5e+43) tmp = Float64(Float64(Float64(t_1 - Float64(Float64(Float64(a * z) * 4.0) * t)) + b) / t_2); elseif (t_3 <= 2e-111) tmp = Float64(Float64(Float64(Float64(t_1 + b) - Float64(Float64(Float64(t * a) * 4.0) * z)) / z) / abs(c)); elseif (t_3 <= Inf) tmp = t_3; else tmp = Float64(Float64(-4.0 * a) * Float64(t / abs(c))); end return Float64(copysign(1.0, c) * 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 = z * abs(c); t_3 = ((t_1 - (((z * 4.0) * t) * a)) + b) / t_2; tmp = 0.0; if (t_3 <= -5e+43) tmp = ((t_1 - (((a * z) * 4.0) * t)) + b) / t_2; elseif (t_3 <= 2e-111) tmp = (((t_1 + b) - (((t * a) * 4.0) * z)) / z) / abs(c); elseif (t_3 <= Inf) tmp = t_3; else tmp = (-4.0 * a) * (t / abs(c)); end tmp_2 = (sign(c) * abs(1.0)) * 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[(z * N[Abs[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / t$95$2), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$3, -5e+43], N[(N[(N[(t$95$1 - N[(N[(N[(a * z), $MachinePrecision] * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 2e-111], N[(N[(N[(N[(t$95$1 + b), $MachinePrecision] - N[(N[(N[(t * a), $MachinePrecision] * 4.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / N[Abs[c], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$3, N[(N[(-4.0 * a), $MachinePrecision] * N[(t / N[Abs[c], $MachinePrecision]), $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)\\
t_2 := z \cdot \left|c\right|\\
t_3 := \frac{\left(t\_1 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{t\_2}\\
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{+43}:\\
\;\;\;\;\frac{\left(t\_1 - \left(\left(a \cdot z\right) \cdot 4\right) \cdot t\right) + b}{t\_2}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-111}:\\
\;\;\;\;\frac{\frac{\left(t\_1 + b\right) - \left(\left(t \cdot a\right) \cdot 4\right) \cdot z}{z}}{\left|c\right|}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(-4 \cdot a\right) \cdot \frac{t}{\left|c\right|}\\
\end{array}
\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.0000000000000004e43Initial program 79.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6479.5%
Applied rewrites79.5%
if -5.0000000000000004e43 < (/.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)) < 2.0000000000000002e-111Initial program 79.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
Applied rewrites82.0%
if 2.0000000000000002e-111 < (/.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.4%
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.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* (fmin x y) 9.0) (fmax x y)))
(t_2 (* z (fabs c)))
(t_3
(/
(+ (- t_1 (* (* (* z 4.0) (fmin t a)) (fmax t a))) b)
t_2)))
(*
(copysign 1.0 c)
(if (<= t_3 -1e-236)
(/ (+ (- t_1 (* (* (* (fmax t a) z) 4.0) (fmin t a))) b) t_2)
(if (<= t_3 1e+62)
(/
(/
(-
(+ b (* (fmax x y) (* 9.0 (fmin x y))))
(* (fmax t a) (* (fmin t a) (* 4.0 z))))
(fabs c))
z)
(if (<= t_3 INFINITY)
t_3
(* (* -4.0 (fmax t a)) (/ (fmin t a) (fabs 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 = z * fabs(c);
double t_3 = ((t_1 - (((z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / t_2;
double tmp;
if (t_3 <= -1e-236) {
tmp = ((t_1 - (((fmax(t, a) * z) * 4.0) * fmin(t, a))) + b) / t_2;
} else if (t_3 <= 1e+62) {
tmp = (((b + (fmax(x, y) * (9.0 * fmin(x, y)))) - (fmax(t, a) * (fmin(t, a) * (4.0 * z)))) / fabs(c)) / z;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / fabs(c));
}
return copysign(1.0, c) * tmp;
}
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 = z * Math.abs(c);
double t_3 = ((t_1 - (((z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / t_2;
double tmp;
if (t_3 <= -1e-236) {
tmp = ((t_1 - (((fmax(t, a) * z) * 4.0) * fmin(t, a))) + b) / t_2;
} else if (t_3 <= 1e+62) {
tmp = (((b + (fmax(x, y) * (9.0 * fmin(x, y)))) - (fmax(t, a) * (fmin(t, a) * (4.0 * z)))) / Math.abs(c)) / z;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / Math.abs(c));
}
return Math.copySign(1.0, c) * tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (fmin(x, y) * 9.0) * fmax(x, y) t_2 = z * math.fabs(c) t_3 = ((t_1 - (((z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / t_2 tmp = 0 if t_3 <= -1e-236: tmp = ((t_1 - (((fmax(t, a) * z) * 4.0) * fmin(t, a))) + b) / t_2 elif t_3 <= 1e+62: tmp = (((b + (fmax(x, y) * (9.0 * fmin(x, y)))) - (fmax(t, a) * (fmin(t, a) * (4.0 * z)))) / math.fabs(c)) / z elif t_3 <= math.inf: tmp = t_3 else: tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / math.fabs(c)) return math.copysign(1.0, c) * 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(z * abs(c)) t_3 = Float64(Float64(Float64(t_1 - Float64(Float64(Float64(z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / t_2) tmp = 0.0 if (t_3 <= -1e-236) tmp = Float64(Float64(Float64(t_1 - Float64(Float64(Float64(fmax(t, a) * z) * 4.0) * fmin(t, a))) + b) / t_2); elseif (t_3 <= 1e+62) tmp = Float64(Float64(Float64(Float64(b + Float64(fmax(x, y) * Float64(9.0 * fmin(x, y)))) - Float64(fmax(t, a) * Float64(fmin(t, a) * Float64(4.0 * z)))) / abs(c)) / z); elseif (t_3 <= Inf) tmp = t_3; else tmp = Float64(Float64(-4.0 * fmax(t, a)) * Float64(fmin(t, a) / abs(c))); end return Float64(copysign(1.0, c) * 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 = z * abs(c); t_3 = ((t_1 - (((z * 4.0) * min(t, a)) * max(t, a))) + b) / t_2; tmp = 0.0; if (t_3 <= -1e-236) tmp = ((t_1 - (((max(t, a) * z) * 4.0) * min(t, a))) + b) / t_2; elseif (t_3 <= 1e+62) tmp = (((b + (max(x, y) * (9.0 * min(x, y)))) - (max(t, a) * (min(t, a) * (4.0 * z)))) / abs(c)) / z; elseif (t_3 <= Inf) tmp = t_3; else tmp = (-4.0 * max(t, a)) * (min(t, a) / abs(c)); end tmp_2 = (sign(c) * abs(1.0)) * 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[(z * N[Abs[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 - N[(N[(N[(z * 4.0), $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / t$95$2), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$3, -1e-236], N[(N[(N[(t$95$1 - N[(N[(N[(N[Max[t, a], $MachinePrecision] * z), $MachinePrecision] * 4.0), $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 1e+62], N[(N[(N[(N[(b + N[(N[Max[x, y], $MachinePrecision] * N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Max[t, a], $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] * N[(4.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[c], $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$3, N[(N[(-4.0 * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] / N[Abs[c], $MachinePrecision]), $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)\\
t_2 := z \cdot \left|c\right|\\
t_3 := \frac{\left(t\_1 - \left(\left(z \cdot 4\right) \cdot \mathsf{min}\left(t, a\right)\right) \cdot \mathsf{max}\left(t, a\right)\right) + b}{t\_2}\\
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-236}:\\
\;\;\;\;\frac{\left(t\_1 - \left(\left(\mathsf{max}\left(t, a\right) \cdot z\right) \cdot 4\right) \cdot \mathsf{min}\left(t, a\right)\right) + b}{t\_2}\\
\mathbf{elif}\;t\_3 \leq 10^{+62}:\\
\;\;\;\;\frac{\frac{\left(b + \mathsf{max}\left(x, y\right) \cdot \left(9 \cdot \mathsf{min}\left(x, y\right)\right)\right) - \mathsf{max}\left(t, a\right) \cdot \left(\mathsf{min}\left(t, a\right) \cdot \left(4 \cdot z\right)\right)}{\left|c\right|}}{z}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(-4 \cdot \mathsf{max}\left(t, a\right)\right) \cdot \frac{\mathsf{min}\left(t, a\right)}{\left|c\right|}\\
\end{array}
\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)) < -1e-236Initial program 79.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6479.5%
Applied rewrites79.5%
if -1e-236 < (/.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)) < 1e62Initial program 79.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
if 1e62 < (/.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.4%
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.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y))
(t_2 (* z (fabs c)))
(t_3
(/
(+ (- t_1 (* (* (* z 4.0) (fmin t a)) (fmax t a))) b)
t_2)))
(*
(copysign 1.0 c)
(if (<= t_3 -1e-236)
(/ (+ (- t_1 (* (* (* (fmax t a) z) 4.0) (fmin t a))) b) t_2)
(if (<= t_3 0.0)
(/
(*
(+ (* (* (* z (fmin t a)) (fmax t a)) -4.0) b)
(/ 1.0 (fabs c)))
z)
(if (<= t_3 INFINITY)
t_3
(* (* -4.0 (fmax t a)) (/ (fmin t a) (fabs c)))))))))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 = z * fabs(c);
double t_3 = ((t_1 - (((z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / t_2;
double tmp;
if (t_3 <= -1e-236) {
tmp = ((t_1 - (((fmax(t, a) * z) * 4.0) * fmin(t, a))) + b) / t_2;
} else if (t_3 <= 0.0) {
tmp = (((((z * fmin(t, a)) * fmax(t, a)) * -4.0) + b) * (1.0 / fabs(c))) / z;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / fabs(c));
}
return copysign(1.0, c) * tmp;
}
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 = z * Math.abs(c);
double t_3 = ((t_1 - (((z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / t_2;
double tmp;
if (t_3 <= -1e-236) {
tmp = ((t_1 - (((fmax(t, a) * z) * 4.0) * fmin(t, a))) + b) / t_2;
} else if (t_3 <= 0.0) {
tmp = (((((z * fmin(t, a)) * fmax(t, a)) * -4.0) + b) * (1.0 / Math.abs(c))) / z;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / Math.abs(c));
}
return Math.copySign(1.0, c) * tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = z * math.fabs(c) t_3 = ((t_1 - (((z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / t_2 tmp = 0 if t_3 <= -1e-236: tmp = ((t_1 - (((fmax(t, a) * z) * 4.0) * fmin(t, a))) + b) / t_2 elif t_3 <= 0.0: tmp = (((((z * fmin(t, a)) * fmax(t, a)) * -4.0) + b) * (1.0 / math.fabs(c))) / z elif t_3 <= math.inf: tmp = t_3 else: tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / math.fabs(c)) return math.copysign(1.0, c) * tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(z * abs(c)) t_3 = Float64(Float64(Float64(t_1 - Float64(Float64(Float64(z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / t_2) tmp = 0.0 if (t_3 <= -1e-236) tmp = Float64(Float64(Float64(t_1 - Float64(Float64(Float64(fmax(t, a) * z) * 4.0) * fmin(t, a))) + b) / t_2); elseif (t_3 <= 0.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(z * fmin(t, a)) * fmax(t, a)) * -4.0) + b) * Float64(1.0 / abs(c))) / z); elseif (t_3 <= Inf) tmp = t_3; else tmp = Float64(Float64(-4.0 * fmax(t, a)) * Float64(fmin(t, a) / abs(c))); end return Float64(copysign(1.0, c) * tmp) end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; t_2 = z * abs(c); t_3 = ((t_1 - (((z * 4.0) * min(t, a)) * max(t, a))) + b) / t_2; tmp = 0.0; if (t_3 <= -1e-236) tmp = ((t_1 - (((max(t, a) * z) * 4.0) * min(t, a))) + b) / t_2; elseif (t_3 <= 0.0) tmp = (((((z * min(t, a)) * max(t, a)) * -4.0) + b) * (1.0 / abs(c))) / z; elseif (t_3 <= Inf) tmp = t_3; else tmp = (-4.0 * max(t, a)) * (min(t, a) / abs(c)); end tmp_2 = (sign(c) * abs(1.0)) * 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[(z * N[Abs[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 - N[(N[(N[(z * 4.0), $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / t$95$2), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$3, -1e-236], N[(N[(N[(t$95$1 - N[(N[(N[(N[Max[t, a], $MachinePrecision] * z), $MachinePrecision] * 4.0), $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(N[(N[(N[(N[(N[(z * N[Min[t, a], $MachinePrecision]), $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision] + b), $MachinePrecision] * N[(1.0 / N[Abs[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$3, N[(N[(-4.0 * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] / N[Abs[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := z \cdot \left|c\right|\\
t_3 := \frac{\left(t\_1 - \left(\left(z \cdot 4\right) \cdot \mathsf{min}\left(t, a\right)\right) \cdot \mathsf{max}\left(t, a\right)\right) + b}{t\_2}\\
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-236}:\\
\;\;\;\;\frac{\left(t\_1 - \left(\left(\mathsf{max}\left(t, a\right) \cdot z\right) \cdot 4\right) \cdot \mathsf{min}\left(t, a\right)\right) + b}{t\_2}\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{\left(\left(\left(z \cdot \mathsf{min}\left(t, a\right)\right) \cdot \mathsf{max}\left(t, a\right)\right) \cdot -4 + b\right) \cdot \frac{1}{\left|c\right|}}{z}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(-4 \cdot \mathsf{max}\left(t, a\right)\right) \cdot \frac{\mathsf{min}\left(t, a\right)}{\left|c\right|}\\
\end{array}
\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)) < -1e-236Initial program 79.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6479.5%
Applied rewrites79.5%
if -1e-236 < (/.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.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6456.3%
Applied rewrites56.3%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites55.9%
if -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.4%
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.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y))
(t_2 (* z (fabs c)))
(t_3 (/ (+ (- t_1 (* (* (* a z) 4.0) t)) b) t_2))
(t_4 (/ (+ (- t_1 (* (* (* z 4.0) t) a)) b) t_2)))
(*
(copysign 1.0 c)
(if (<= t_4 -5e-227)
t_3
(if (<= t_4 4e-224)
(/ (/ (+ (* (* (* z t) a) -4.0) b) z) (fabs c))
(if (<= t_4 INFINITY) t_3 (* (* -4.0 a) (/ t (fabs c)))))))))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 = z * fabs(c);
double t_3 = ((t_1 - (((a * z) * 4.0) * t)) + b) / t_2;
double t_4 = ((t_1 - (((z * 4.0) * t) * a)) + b) / t_2;
double tmp;
if (t_4 <= -5e-227) {
tmp = t_3;
} else if (t_4 <= 4e-224) {
tmp = (((((z * t) * a) * -4.0) + b) / z) / fabs(c);
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (-4.0 * a) * (t / fabs(c));
}
return copysign(1.0, c) * tmp;
}
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 = z * Math.abs(c);
double t_3 = ((t_1 - (((a * z) * 4.0) * t)) + b) / t_2;
double t_4 = ((t_1 - (((z * 4.0) * t) * a)) + b) / t_2;
double tmp;
if (t_4 <= -5e-227) {
tmp = t_3;
} else if (t_4 <= 4e-224) {
tmp = (((((z * t) * a) * -4.0) + b) / z) / Math.abs(c);
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = (-4.0 * a) * (t / Math.abs(c));
}
return Math.copySign(1.0, c) * tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = z * math.fabs(c) t_3 = ((t_1 - (((a * z) * 4.0) * t)) + b) / t_2 t_4 = ((t_1 - (((z * 4.0) * t) * a)) + b) / t_2 tmp = 0 if t_4 <= -5e-227: tmp = t_3 elif t_4 <= 4e-224: tmp = (((((z * t) * a) * -4.0) + b) / z) / math.fabs(c) elif t_4 <= math.inf: tmp = t_3 else: tmp = (-4.0 * a) * (t / math.fabs(c)) return math.copysign(1.0, c) * tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(z * abs(c)) t_3 = Float64(Float64(Float64(t_1 - Float64(Float64(Float64(a * z) * 4.0) * t)) + b) / t_2) t_4 = Float64(Float64(Float64(t_1 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / t_2) tmp = 0.0 if (t_4 <= -5e-227) tmp = t_3; elseif (t_4 <= 4e-224) tmp = Float64(Float64(Float64(Float64(Float64(Float64(z * t) * a) * -4.0) + b) / z) / abs(c)); elseif (t_4 <= Inf) tmp = t_3; else tmp = Float64(Float64(-4.0 * a) * Float64(t / abs(c))); end return Float64(copysign(1.0, c) * tmp) end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; t_2 = z * abs(c); t_3 = ((t_1 - (((a * z) * 4.0) * t)) + b) / t_2; t_4 = ((t_1 - (((z * 4.0) * t) * a)) + b) / t_2; tmp = 0.0; if (t_4 <= -5e-227) tmp = t_3; elseif (t_4 <= 4e-224) tmp = (((((z * t) * a) * -4.0) + b) / z) / abs(c); elseif (t_4 <= Inf) tmp = t_3; else tmp = (-4.0 * a) * (t / abs(c)); end tmp_2 = (sign(c) * abs(1.0)) * 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[(z * N[Abs[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 - N[(N[(N[(a * z), $MachinePrecision] * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / t$95$2), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$4, -5e-227], t$95$3, If[LessEqual[t$95$4, 4e-224], N[(N[(N[(N[(N[(N[(z * t), $MachinePrecision] * a), $MachinePrecision] * -4.0), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision] / N[Abs[c], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$3, N[(N[(-4.0 * a), $MachinePrecision] * N[(t / N[Abs[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := z \cdot \left|c\right|\\
t_3 := \frac{\left(t\_1 - \left(\left(a \cdot z\right) \cdot 4\right) \cdot t\right) + b}{t\_2}\\
t_4 := \frac{\left(t\_1 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{t\_2}\\
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_4 \leq -5 \cdot 10^{-227}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 4 \cdot 10^{-224}:\\
\;\;\;\;\frac{\frac{\left(\left(z \cdot t\right) \cdot a\right) \cdot -4 + b}{z}}{\left|c\right|}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(-4 \cdot a\right) \cdot \frac{t}{\left|c\right|}\\
\end{array}
\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)) < -4.9999999999999996e-227 or 4.0000000000000001e-224 < (/.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.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6479.5%
Applied rewrites79.5%
if -4.9999999999999996e-227 < (/.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)) < 4.0000000000000001e-224Initial program 79.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6456.3%
Applied rewrites56.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites55.8%
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.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (/ (+ (* (* (* z t) a) -4.0) b) z) c)))
(if (<= z -5.5e+97)
(* -4.0 (/ (* a t) c))
(if (<= z -2.3e-141)
t_1
(if (<= z 4e-20)
(/ (/ (+ b (* (fmax x y) (* 9.0 (fmin x y)))) c) z)
t_1)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((((z * t) * a) * -4.0) + b) / z) / c;
double tmp;
if (z <= -5.5e+97) {
tmp = -4.0 * ((a * t) / c);
} else if (z <= -2.3e-141) {
tmp = t_1;
} else if (z <= 4e-20) {
tmp = ((b + (fmax(x, y) * (9.0 * fmin(x, y)))) / 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 = (((((z * t) * a) * (-4.0d0)) + b) / z) / c
if (z <= (-5.5d+97)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (z <= (-2.3d-141)) then
tmp = t_1
else if (z <= 4d-20) then
tmp = ((b + (fmax(x, y) * (9.0d0 * fmin(x, y)))) / 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 = (((((z * t) * a) * -4.0) + b) / z) / c;
double tmp;
if (z <= -5.5e+97) {
tmp = -4.0 * ((a * t) / c);
} else if (z <= -2.3e-141) {
tmp = t_1;
} else if (z <= 4e-20) {
tmp = ((b + (fmax(x, y) * (9.0 * fmin(x, y)))) / c) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (((((z * t) * a) * -4.0) + b) / z) / c tmp = 0 if z <= -5.5e+97: tmp = -4.0 * ((a * t) / c) elif z <= -2.3e-141: tmp = t_1 elif z <= 4e-20: tmp = ((b + (fmax(x, y) * (9.0 * fmin(x, y)))) / c) / z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(z * t) * a) * -4.0) + b) / z) / c) tmp = 0.0 if (z <= -5.5e+97) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (z <= -2.3e-141) tmp = t_1; elseif (z <= 4e-20) tmp = Float64(Float64(Float64(b + Float64(fmax(x, y) * Float64(9.0 * fmin(x, y)))) / c) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (((((z * t) * a) * -4.0) + b) / z) / c; tmp = 0.0; if (z <= -5.5e+97) tmp = -4.0 * ((a * t) / c); elseif (z <= -2.3e-141) tmp = t_1; elseif (z <= 4e-20) tmp = ((b + (max(x, y) * (9.0 * min(x, y)))) / c) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(z * t), $MachinePrecision] * a), $MachinePrecision] * -4.0), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -5.5e+97], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e-141], t$95$1, If[LessEqual[z, 4e-20], N[(N[(N[(b + N[(N[Max[x, y], $MachinePrecision] * N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{\frac{\left(\left(z \cdot t\right) \cdot a\right) \cdot -4 + b}{z}}{c}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+97}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-20}:\\
\;\;\;\;\frac{\frac{b + \mathsf{max}\left(x, y\right) \cdot \left(9 \cdot \mathsf{min}\left(x, y\right)\right)}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -5.5000000000000002e97Initial program 79.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
if -5.5000000000000002e97 < z < -2.2999999999999999e-141 or 3.9999999999999998e-20 < z Initial program 79.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6456.3%
Applied rewrites56.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites55.8%
if -2.2999999999999999e-141 < z < 3.9999999999999998e-20Initial program 79.4%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6459.9%
Applied rewrites59.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites60.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-48)
(/ (/ (+ b (* (fmax x y) (* 9.0 (fmin x y)))) c) z)
(if (<= t_1 4e-75)
(/
(* (/ 1.0 c) (- b (* (* (* (fmin t a) (fmax t a)) 4.0) z)))
z)
(/
(-
(* 9.0 (* (fmin x y) (fmax x y)))
(* 4.0 (* (fmax t a) (* (fmin t a) z))))
(* 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-48) {
tmp = ((b + (fmax(x, y) * (9.0 * fmin(x, y)))) / c) / z;
} else if (t_1 <= 4e-75) {
tmp = ((1.0 / c) * (b - (((fmin(t, a) * fmax(t, a)) * 4.0) * z))) / z;
} else {
tmp = ((9.0 * (fmin(x, y) * fmax(x, y))) - (4.0 * (fmax(t, a) * (fmin(t, a) * z)))) / (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-48)) then
tmp = ((b + (fmax(x, y) * (9.0d0 * fmin(x, y)))) / c) / z
else if (t_1 <= 4d-75) then
tmp = ((1.0d0 / c) * (b - (((fmin(t, a) * fmax(t, a)) * 4.0d0) * z))) / z
else
tmp = ((9.0d0 * (fmin(x, y) * fmax(x, y))) - (4.0d0 * (fmax(t, a) * (fmin(t, a) * z)))) / (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-48) {
tmp = ((b + (fmax(x, y) * (9.0 * fmin(x, y)))) / c) / z;
} else if (t_1 <= 4e-75) {
tmp = ((1.0 / c) * (b - (((fmin(t, a) * fmax(t, a)) * 4.0) * z))) / z;
} else {
tmp = ((9.0 * (fmin(x, y) * fmax(x, y))) - (4.0 * (fmax(t, a) * (fmin(t, a) * z)))) / (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-48: tmp = ((b + (fmax(x, y) * (9.0 * fmin(x, y)))) / c) / z elif t_1 <= 4e-75: tmp = ((1.0 / c) * (b - (((fmin(t, a) * fmax(t, a)) * 4.0) * z))) / z else: tmp = ((9.0 * (fmin(x, y) * fmax(x, y))) - (4.0 * (fmax(t, a) * (fmin(t, a) * z)))) / (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-48) tmp = Float64(Float64(Float64(b + Float64(fmax(x, y) * Float64(9.0 * fmin(x, y)))) / c) / z); elseif (t_1 <= 4e-75) tmp = Float64(Float64(Float64(1.0 / c) * Float64(b - Float64(Float64(Float64(fmin(t, a) * fmax(t, a)) * 4.0) * z))) / z); else tmp = Float64(Float64(Float64(9.0 * Float64(fmin(x, y) * fmax(x, y))) - Float64(4.0 * Float64(fmax(t, a) * Float64(fmin(t, a) * z)))) / 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-48) tmp = ((b + (max(x, y) * (9.0 * min(x, y)))) / c) / z; elseif (t_1 <= 4e-75) tmp = ((1.0 / c) * (b - (((min(t, a) * max(t, a)) * 4.0) * z))) / z; else tmp = ((9.0 * (min(x, y) * max(x, y))) - (4.0 * (max(t, a) * (min(t, a) * z)))) / (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-48], N[(N[(N[(b + N[(N[Max[x, y], $MachinePrecision] * N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 4e-75], N[(N[(N[(1.0 / c), $MachinePrecision] * N[(b - N[(N[(N[(N[Min[t, a], $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(9.0 * N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[Max[t, a], $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * 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^{-48}:\\
\;\;\;\;\frac{\frac{b + \mathsf{max}\left(x, y\right) \cdot \left(9 \cdot \mathsf{min}\left(x, y\right)\right)}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-75}:\\
\;\;\;\;\frac{\frac{1}{c} \cdot \left(b - \left(\left(\mathsf{min}\left(t, a\right) \cdot \mathsf{max}\left(t, a\right)\right) \cdot 4\right) \cdot z\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{9 \cdot \left(\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\right) - 4 \cdot \left(\mathsf{max}\left(t, a\right) \cdot \left(\mathsf{min}\left(t, a\right) \cdot z\right)\right)}{c \cdot z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.9999999999999997e-49Initial program 79.4%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6459.9%
Applied rewrites59.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites60.5%
if -9.9999999999999997e-49 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 3.9999999999999998e-75Initial program 79.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.7%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6479.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6479.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6479.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6480.3%
Applied rewrites80.3%
Taylor expanded in x around 0
Applied rewrites56.8%
if 3.9999999999999998e-75 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.4%
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-*.f6456.8%
Applied rewrites56.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (fmax t a) (* (fmin t a) z))))
(if (<= (fmin x y) -5e+19)
(/ (/ (+ b (* (fmax x y) (* 9.0 (fmin x y)))) c) z)
(if (<= (fmin x y) 1.05e-181)
(/ (+ (* -4.0 t_1) b) (* z c))
(/ (- (* 9.0 (* (fmin x y) (fmax x y))) (* 4.0 t_1)) (* c z))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fmax(t, a) * (fmin(t, a) * z);
double tmp;
if (fmin(x, y) <= -5e+19) {
tmp = ((b + (fmax(x, y) * (9.0 * fmin(x, y)))) / c) / z;
} else if (fmin(x, y) <= 1.05e-181) {
tmp = ((-4.0 * t_1) + b) / (z * c);
} else {
tmp = ((9.0 * (fmin(x, y) * fmax(x, y))) - (4.0 * t_1)) / (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 = fmax(t, a) * (fmin(t, a) * z)
if (fmin(x, y) <= (-5d+19)) then
tmp = ((b + (fmax(x, y) * (9.0d0 * fmin(x, y)))) / c) / z
else if (fmin(x, y) <= 1.05d-181) then
tmp = (((-4.0d0) * t_1) + b) / (z * c)
else
tmp = ((9.0d0 * (fmin(x, y) * fmax(x, y))) - (4.0d0 * t_1)) / (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 = fmax(t, a) * (fmin(t, a) * z);
double tmp;
if (fmin(x, y) <= -5e+19) {
tmp = ((b + (fmax(x, y) * (9.0 * fmin(x, y)))) / c) / z;
} else if (fmin(x, y) <= 1.05e-181) {
tmp = ((-4.0 * t_1) + b) / (z * c);
} else {
tmp = ((9.0 * (fmin(x, y) * fmax(x, y))) - (4.0 * t_1)) / (c * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = fmax(t, a) * (fmin(t, a) * z) tmp = 0 if fmin(x, y) <= -5e+19: tmp = ((b + (fmax(x, y) * (9.0 * fmin(x, y)))) / c) / z elif fmin(x, y) <= 1.05e-181: tmp = ((-4.0 * t_1) + b) / (z * c) else: tmp = ((9.0 * (fmin(x, y) * fmax(x, y))) - (4.0 * t_1)) / (c * z) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(fmax(t, a) * Float64(fmin(t, a) * z)) tmp = 0.0 if (fmin(x, y) <= -5e+19) tmp = Float64(Float64(Float64(b + Float64(fmax(x, y) * Float64(9.0 * fmin(x, y)))) / c) / z); elseif (fmin(x, y) <= 1.05e-181) tmp = Float64(Float64(Float64(-4.0 * t_1) + b) / Float64(z * c)); else tmp = Float64(Float64(Float64(9.0 * Float64(fmin(x, y) * fmax(x, y))) - Float64(4.0 * t_1)) / Float64(c * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = max(t, a) * (min(t, a) * z); tmp = 0.0; if (min(x, y) <= -5e+19) tmp = ((b + (max(x, y) * (9.0 * min(x, y)))) / c) / z; elseif (min(x, y) <= 1.05e-181) tmp = ((-4.0 * t_1) + b) / (z * c); else tmp = ((9.0 * (min(x, y) * max(x, y))) - (4.0 * t_1)) / (c * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[Max[t, a], $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Min[x, y], $MachinePrecision], -5e+19], N[(N[(N[(b + N[(N[Max[x, y], $MachinePrecision] * N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[N[Min[x, y], $MachinePrecision], 1.05e-181], N[(N[(N[(-4.0 * t$95$1), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(9.0 * N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{max}\left(t, a\right) \cdot \left(\mathsf{min}\left(t, a\right) \cdot z\right)\\
\mathbf{if}\;\mathsf{min}\left(x, y\right) \leq -5 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{b + \mathsf{max}\left(x, y\right) \cdot \left(9 \cdot \mathsf{min}\left(x, y\right)\right)}{c}}{z}\\
\mathbf{elif}\;\mathsf{min}\left(x, y\right) \leq 1.05 \cdot 10^{-181}:\\
\;\;\;\;\frac{-4 \cdot t\_1 + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{9 \cdot \left(\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\right) - 4 \cdot t\_1}{c \cdot z}\\
\end{array}
if x < -5e19Initial program 79.4%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6459.9%
Applied rewrites59.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites60.5%
if -5e19 < x < 1.05e-181Initial program 79.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6456.3%
Applied rewrites56.3%
if 1.05e-181 < x Initial program 79.4%
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-*.f6456.8%
Applied rewrites56.8%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (fmin x y) -5e+19)
(/ (/ (+ b (* (fmax x y) (* 9.0 (fmin x y)))) c) z)
(if (<= (fmin x y) 8600000000.0)
(/ (+ (* -4.0 (* (fmax t a) (* (fmin t a) z))) b) (* z c))
(/ (/ (+ b (* 9.0 (* (fmin x y) (fmax x y)))) c) z))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (fmin(x, y) <= -5e+19) {
tmp = ((b + (fmax(x, y) * (9.0 * fmin(x, y)))) / c) / z;
} else if (fmin(x, y) <= 8600000000.0) {
tmp = ((-4.0 * (fmax(t, a) * (fmin(t, a) * z))) + b) / (z * c);
} else {
tmp = ((b + (9.0 * (fmin(x, y) * fmax(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) :: tmp
if (fmin(x, y) <= (-5d+19)) then
tmp = ((b + (fmax(x, y) * (9.0d0 * fmin(x, y)))) / c) / z
else if (fmin(x, y) <= 8600000000.0d0) then
tmp = (((-4.0d0) * (fmax(t, a) * (fmin(t, a) * z))) + b) / (z * c)
else
tmp = ((b + (9.0d0 * (fmin(x, y) * fmax(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 tmp;
if (fmin(x, y) <= -5e+19) {
tmp = ((b + (fmax(x, y) * (9.0 * fmin(x, y)))) / c) / z;
} else if (fmin(x, y) <= 8600000000.0) {
tmp = ((-4.0 * (fmax(t, a) * (fmin(t, a) * z))) + b) / (z * c);
} else {
tmp = ((b + (9.0 * (fmin(x, y) * fmax(x, y)))) / c) / z;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if fmin(x, y) <= -5e+19: tmp = ((b + (fmax(x, y) * (9.0 * fmin(x, y)))) / c) / z elif fmin(x, y) <= 8600000000.0: tmp = ((-4.0 * (fmax(t, a) * (fmin(t, a) * z))) + b) / (z * c) else: tmp = ((b + (9.0 * (fmin(x, y) * fmax(x, y)))) / c) / z return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (fmin(x, y) <= -5e+19) tmp = Float64(Float64(Float64(b + Float64(fmax(x, y) * Float64(9.0 * fmin(x, y)))) / c) / z); elseif (fmin(x, y) <= 8600000000.0) tmp = Float64(Float64(Float64(-4.0 * Float64(fmax(t, a) * Float64(fmin(t, a) * z))) + b) / Float64(z * c)); else tmp = Float64(Float64(Float64(b + Float64(9.0 * Float64(fmin(x, y) * fmax(x, y)))) / c) / z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (min(x, y) <= -5e+19) tmp = ((b + (max(x, y) * (9.0 * min(x, y)))) / c) / z; elseif (min(x, y) <= 8600000000.0) tmp = ((-4.0 * (max(t, a) * (min(t, a) * z))) + b) / (z * c); else tmp = ((b + (9.0 * (min(x, y) * max(x, y)))) / c) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[Min[x, y], $MachinePrecision], -5e+19], N[(N[(N[(b + N[(N[Max[x, y], $MachinePrecision] * N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[N[Min[x, y], $MachinePrecision], 8600000000.0], N[(N[(N[(-4.0 * N[(N[Max[t, a], $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + N[(9.0 * N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(x, y\right) \leq -5 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{b + \mathsf{max}\left(x, y\right) \cdot \left(9 \cdot \mathsf{min}\left(x, y\right)\right)}{c}}{z}\\
\mathbf{elif}\;\mathsf{min}\left(x, y\right) \leq 8600000000:\\
\;\;\;\;\frac{-4 \cdot \left(\mathsf{max}\left(t, a\right) \cdot \left(\mathsf{min}\left(t, a\right) \cdot z\right)\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b + 9 \cdot \left(\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\right)}{c}}{z}\\
\end{array}
if x < -5e19Initial program 79.4%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6459.9%
Applied rewrites59.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites60.5%
if -5e19 < x < 8.6e9Initial program 79.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6456.3%
Applied rewrites56.3%
if 8.6e9 < x Initial program 79.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.5%
Applied rewrites60.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (/ (+ b (* 9.0 (* (fmin x y) (fmax x y)))) c) z)))
(if (<= (fmin x y) -5e+19)
t_1
(if (<= (fmin x y) 8600000000.0)
(/ (+ (* -4.0 (* (fmax t a) (* (fmin t a) z))) b) (* z c))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((b + (9.0 * (fmin(x, y) * fmax(x, y)))) / c) / z;
double tmp;
if (fmin(x, y) <= -5e+19) {
tmp = t_1;
} else if (fmin(x, y) <= 8600000000.0) {
tmp = ((-4.0 * (fmax(t, a) * (fmin(t, a) * z))) + b) / (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 = ((b + (9.0d0 * (fmin(x, y) * fmax(x, y)))) / c) / z
if (fmin(x, y) <= (-5d+19)) then
tmp = t_1
else if (fmin(x, y) <= 8600000000.0d0) then
tmp = (((-4.0d0) * (fmax(t, a) * (fmin(t, a) * z))) + b) / (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 = ((b + (9.0 * (fmin(x, y) * fmax(x, y)))) / c) / z;
double tmp;
if (fmin(x, y) <= -5e+19) {
tmp = t_1;
} else if (fmin(x, y) <= 8600000000.0) {
tmp = ((-4.0 * (fmax(t, a) * (fmin(t, a) * z))) + b) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((b + (9.0 * (fmin(x, y) * fmax(x, y)))) / c) / z tmp = 0 if fmin(x, y) <= -5e+19: tmp = t_1 elif fmin(x, y) <= 8600000000.0: tmp = ((-4.0 * (fmax(t, a) * (fmin(t, a) * z))) + b) / (z * c) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(b + Float64(9.0 * Float64(fmin(x, y) * fmax(x, y)))) / c) / z) tmp = 0.0 if (fmin(x, y) <= -5e+19) tmp = t_1; elseif (fmin(x, y) <= 8600000000.0) tmp = Float64(Float64(Float64(-4.0 * Float64(fmax(t, a) * Float64(fmin(t, a) * z))) + b) / Float64(z * c)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = ((b + (9.0 * (min(x, y) * max(x, y)))) / c) / z; tmp = 0.0; if (min(x, y) <= -5e+19) tmp = t_1; elseif (min(x, y) <= 8600000000.0) tmp = ((-4.0 * (max(t, a) * (min(t, a) * z))) + b) / (z * c); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(b + N[(9.0 * N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[N[Min[x, y], $MachinePrecision], -5e+19], t$95$1, If[LessEqual[N[Min[x, y], $MachinePrecision], 8600000000.0], N[(N[(N[(-4.0 * N[(N[Max[t, a], $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{\frac{b + 9 \cdot \left(\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\right)}{c}}{z}\\
\mathbf{if}\;\mathsf{min}\left(x, y\right) \leq -5 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\mathsf{min}\left(x, y\right) \leq 8600000000:\\
\;\;\;\;\frac{-4 \cdot \left(\mathsf{max}\left(t, a\right) \cdot \left(\mathsf{min}\left(t, a\right) \cdot z\right)\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -5e19 or 8.6e9 < x Initial program 79.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.5%
Applied rewrites60.5%
if -5e19 < x < 8.6e9Initial program 79.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6456.3%
Applied rewrites56.3%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -3.3e+97)
(* -4.0 (/ (* (fmax t a) (fmin t a)) c))
(if (<= z -2.3e-141)
(/ (+ (* -4.0 (* (fmax t a) (* (fmin t a) z))) b) (* z c))
(if (<= z 7.8e+105)
(/ (+ b (* y (* 9.0 x))) (* z c))
(* (* -4.0 (fmax t a)) (/ (fmin t a) c))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -3.3e+97) {
tmp = -4.0 * ((fmax(t, a) * fmin(t, a)) / c);
} else if (z <= -2.3e-141) {
tmp = ((-4.0 * (fmax(t, a) * (fmin(t, a) * z))) + b) / (z * c);
} else if (z <= 7.8e+105) {
tmp = (b + (y * (9.0 * x))) / (z * c);
} else {
tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / c);
}
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 (z <= (-3.3d+97)) then
tmp = (-4.0d0) * ((fmax(t, a) * fmin(t, a)) / c)
else if (z <= (-2.3d-141)) then
tmp = (((-4.0d0) * (fmax(t, a) * (fmin(t, a) * z))) + b) / (z * c)
else if (z <= 7.8d+105) then
tmp = (b + (y * (9.0d0 * x))) / (z * c)
else
tmp = ((-4.0d0) * fmax(t, a)) * (fmin(t, a) / c)
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 (z <= -3.3e+97) {
tmp = -4.0 * ((fmax(t, a) * fmin(t, a)) / c);
} else if (z <= -2.3e-141) {
tmp = ((-4.0 * (fmax(t, a) * (fmin(t, a) * z))) + b) / (z * c);
} else if (z <= 7.8e+105) {
tmp = (b + (y * (9.0 * x))) / (z * c);
} else {
tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if z <= -3.3e+97: tmp = -4.0 * ((fmax(t, a) * fmin(t, a)) / c) elif z <= -2.3e-141: tmp = ((-4.0 * (fmax(t, a) * (fmin(t, a) * z))) + b) / (z * c) elif z <= 7.8e+105: tmp = (b + (y * (9.0 * x))) / (z * c) else: tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / c) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -3.3e+97) tmp = Float64(-4.0 * Float64(Float64(fmax(t, a) * fmin(t, a)) / c)); elseif (z <= -2.3e-141) tmp = Float64(Float64(Float64(-4.0 * Float64(fmax(t, a) * Float64(fmin(t, a) * z))) + b) / Float64(z * c)); elseif (z <= 7.8e+105) tmp = Float64(Float64(b + Float64(y * Float64(9.0 * x))) / Float64(z * c)); else tmp = Float64(Float64(-4.0 * fmax(t, a)) * Float64(fmin(t, a) / c)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (z <= -3.3e+97) tmp = -4.0 * ((max(t, a) * min(t, a)) / c); elseif (z <= -2.3e-141) tmp = ((-4.0 * (max(t, a) * (min(t, a) * z))) + b) / (z * c); elseif (z <= 7.8e+105) tmp = (b + (y * (9.0 * x))) / (z * c); else tmp = (-4.0 * max(t, a)) * (min(t, a) / c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -3.3e+97], N[(-4.0 * N[(N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e-141], N[(N[(N[(-4.0 * N[(N[Max[t, a], $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+105], N[(N[(b + N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+97}:\\
\;\;\;\;-4 \cdot \frac{\mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)}{c}\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-141}:\\
\;\;\;\;\frac{-4 \cdot \left(\mathsf{max}\left(t, a\right) \cdot \left(\mathsf{min}\left(t, a\right) \cdot z\right)\right) + b}{z \cdot c}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+105}:\\
\;\;\;\;\frac{b + y \cdot \left(9 \cdot x\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\left(-4 \cdot \mathsf{max}\left(t, a\right)\right) \cdot \frac{\mathsf{min}\left(t, a\right)}{c}\\
\end{array}
if z < -3.3000000000000001e97Initial program 79.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
if -3.3000000000000001e97 < z < -2.2999999999999999e-141Initial program 79.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6456.3%
Applied rewrites56.3%
if -2.2999999999999999e-141 < z < 7.7999999999999996e105Initial program 79.4%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6459.9%
Applied rewrites59.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6459.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6459.8%
Applied rewrites59.8%
if 7.7999999999999996e105 < z Initial program 79.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -3.9e+65)
(* -4.0 (/ (* (fmax t a) (fmin t a)) c))
(if (<= z 7.8e+105)
(/ (+ b (* y (* 9.0 x))) (* z c))
(* (* -4.0 (fmax t a)) (/ (fmin t a) c)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -3.9e+65) {
tmp = -4.0 * ((fmax(t, a) * fmin(t, a)) / c);
} else if (z <= 7.8e+105) {
tmp = (b + (y * (9.0 * x))) / (z * c);
} else {
tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / c);
}
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 (z <= (-3.9d+65)) then
tmp = (-4.0d0) * ((fmax(t, a) * fmin(t, a)) / c)
else if (z <= 7.8d+105) then
tmp = (b + (y * (9.0d0 * x))) / (z * c)
else
tmp = ((-4.0d0) * fmax(t, a)) * (fmin(t, a) / c)
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 (z <= -3.9e+65) {
tmp = -4.0 * ((fmax(t, a) * fmin(t, a)) / c);
} else if (z <= 7.8e+105) {
tmp = (b + (y * (9.0 * x))) / (z * c);
} else {
tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if z <= -3.9e+65: tmp = -4.0 * ((fmax(t, a) * fmin(t, a)) / c) elif z <= 7.8e+105: tmp = (b + (y * (9.0 * x))) / (z * c) else: tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / c) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -3.9e+65) tmp = Float64(-4.0 * Float64(Float64(fmax(t, a) * fmin(t, a)) / c)); elseif (z <= 7.8e+105) tmp = Float64(Float64(b + Float64(y * Float64(9.0 * x))) / Float64(z * c)); else tmp = Float64(Float64(-4.0 * fmax(t, a)) * Float64(fmin(t, a) / c)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (z <= -3.9e+65) tmp = -4.0 * ((max(t, a) * min(t, a)) / c); elseif (z <= 7.8e+105) tmp = (b + (y * (9.0 * x))) / (z * c); else tmp = (-4.0 * max(t, a)) * (min(t, a) / c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -3.9e+65], N[(-4.0 * N[(N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+105], N[(N[(b + N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+65}:\\
\;\;\;\;-4 \cdot \frac{\mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)}{c}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+105}:\\
\;\;\;\;\frac{b + y \cdot \left(9 \cdot x\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\left(-4 \cdot \mathsf{max}\left(t, a\right)\right) \cdot \frac{\mathsf{min}\left(t, a\right)}{c}\\
\end{array}
if z < -3.8999999999999998e65Initial program 79.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
if -3.8999999999999998e65 < z < 7.7999999999999996e105Initial program 79.4%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6459.9%
Applied rewrites59.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6459.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6459.8%
Applied rewrites59.8%
if 7.7999999999999996e105 < z Initial program 79.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -3.9e+65)
(* -4.0 (/ (* (fmax t a) (fmin t a)) c))
(if (<= z 7.8e+105)
(/ (+ b (* 9.0 (* x y))) (* z c))
(* (* -4.0 (fmax t a)) (/ (fmin t a) c)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -3.9e+65) {
tmp = -4.0 * ((fmax(t, a) * fmin(t, a)) / c);
} else if (z <= 7.8e+105) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / c);
}
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 (z <= (-3.9d+65)) then
tmp = (-4.0d0) * ((fmax(t, a) * fmin(t, a)) / c)
else if (z <= 7.8d+105) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else
tmp = ((-4.0d0) * fmax(t, a)) * (fmin(t, a) / c)
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 (z <= -3.9e+65) {
tmp = -4.0 * ((fmax(t, a) * fmin(t, a)) / c);
} else if (z <= 7.8e+105) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if z <= -3.9e+65: tmp = -4.0 * ((fmax(t, a) * fmin(t, a)) / c) elif z <= 7.8e+105: tmp = (b + (9.0 * (x * y))) / (z * c) else: tmp = (-4.0 * fmax(t, a)) * (fmin(t, a) / c) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -3.9e+65) tmp = Float64(-4.0 * Float64(Float64(fmax(t, a) * fmin(t, a)) / c)); elseif (z <= 7.8e+105) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); else tmp = Float64(Float64(-4.0 * fmax(t, a)) * Float64(fmin(t, a) / c)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (z <= -3.9e+65) tmp = -4.0 * ((max(t, a) * min(t, a)) / c); elseif (z <= 7.8e+105) tmp = (b + (9.0 * (x * y))) / (z * c); else tmp = (-4.0 * max(t, a)) * (min(t, a) / c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -3.9e+65], N[(-4.0 * N[(N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+105], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+65}:\\
\;\;\;\;-4 \cdot \frac{\mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)}{c}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+105}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\left(-4 \cdot \mathsf{max}\left(t, a\right)\right) \cdot \frac{\mathsf{min}\left(t, a\right)}{c}\\
\end{array}
if z < -3.8999999999999998e65Initial program 79.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
if -3.8999999999999998e65 < z < 7.7999999999999996e105Initial program 79.4%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6459.9%
Applied rewrites59.9%
if 7.7999999999999996e105 < z Initial program 79.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* -4.0 (fmax t a)) (/ (fmin t a) c))))
(if (<= z -2.75e-64)
t_1
(if (<= z 1.1e-175)
(/ b (* c z))
(if (<= z 9.5e+19) (* 9.0 (/ (* x y) (* 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 * fmax(t, a)) * (fmin(t, a) / c);
double tmp;
if (z <= -2.75e-64) {
tmp = t_1;
} else if (z <= 1.1e-175) {
tmp = b / (c * z);
} else if (z <= 9.5e+19) {
tmp = 9.0 * ((x * y) / (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) * fmax(t, a)) * (fmin(t, a) / c)
if (z <= (-2.75d-64)) then
tmp = t_1
else if (z <= 1.1d-175) then
tmp = b / (c * z)
else if (z <= 9.5d+19) then
tmp = 9.0d0 * ((x * y) / (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 * fmax(t, a)) * (fmin(t, a) / c);
double tmp;
if (z <= -2.75e-64) {
tmp = t_1;
} else if (z <= 1.1e-175) {
tmp = b / (c * z);
} else if (z <= 9.5e+19) {
tmp = 9.0 * ((x * y) / (c * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (-4.0 * fmax(t, a)) * (fmin(t, a) / c) tmp = 0 if z <= -2.75e-64: tmp = t_1 elif z <= 1.1e-175: tmp = b / (c * z) elif z <= 9.5e+19: tmp = 9.0 * ((x * y) / (c * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(-4.0 * fmax(t, a)) * Float64(fmin(t, a) / c)) tmp = 0.0 if (z <= -2.75e-64) tmp = t_1; elseif (z <= 1.1e-175) tmp = Float64(b / Float64(c * z)); elseif (z <= 9.5e+19) tmp = Float64(9.0 * Float64(Float64(x * y) / 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 * max(t, a)) * (min(t, a) / c); tmp = 0.0; if (z <= -2.75e-64) tmp = t_1; elseif (z <= 1.1e-175) tmp = b / (c * z); elseif (z <= 9.5e+19) tmp = 9.0 * ((x * y) / (c * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(-4.0 * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.75e-64], t$95$1, If[LessEqual[z, 1.1e-175], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+19], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(-4 \cdot \mathsf{max}\left(t, a\right)\right) \cdot \frac{\mathsf{min}\left(t, a\right)}{c}\\
\mathbf{if}\;z \leq -2.75 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-175}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+19}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.7499999999999999e-64 or 9.5e19 < z Initial program 79.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
if -2.7499999999999999e-64 < z < 1.1e-175Initial program 79.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.0%
Applied rewrites35.0%
if 1.1e-175 < z < 9.5e19Initial program 79.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.2%
Applied rewrites36.2%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* (* -4.0 (fmax t a)) (/ (fmin t a) c)))) (if (<= z -2.75e-64) t_1 (if (<= z 1.36e+23) (/ 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 * fmax(t, a)) * (fmin(t, a) / c);
double tmp;
if (z <= -2.75e-64) {
tmp = t_1;
} else if (z <= 1.36e+23) {
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) * fmax(t, a)) * (fmin(t, a) / c)
if (z <= (-2.75d-64)) then
tmp = t_1
else if (z <= 1.36d+23) 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 * fmax(t, a)) * (fmin(t, a) / c);
double tmp;
if (z <= -2.75e-64) {
tmp = t_1;
} else if (z <= 1.36e+23) {
tmp = b / (c * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (-4.0 * fmax(t, a)) * (fmin(t, a) / c) tmp = 0 if z <= -2.75e-64: tmp = t_1 elif z <= 1.36e+23: tmp = b / (c * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(-4.0 * fmax(t, a)) * Float64(fmin(t, a) / c)) tmp = 0.0 if (z <= -2.75e-64) tmp = t_1; elseif (z <= 1.36e+23) 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 * max(t, a)) * (min(t, a) / c); tmp = 0.0; if (z <= -2.75e-64) tmp = t_1; elseif (z <= 1.36e+23) 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[(N[(-4.0 * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.75e-64], t$95$1, If[LessEqual[z, 1.36e+23], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(-4 \cdot \mathsf{max}\left(t, a\right)\right) \cdot \frac{\mathsf{min}\left(t, a\right)}{c}\\
\mathbf{if}\;z \leq -2.75 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.36 \cdot 10^{+23}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.7499999999999999e-64 or 1.36e23 < z Initial program 79.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
if -2.7499999999999999e-64 < z < 1.36e23Initial program 79.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.0%
Applied rewrites35.0%
(FPCore (x y z t a b c) :precision binary64 (if (<= z -2.75e-64) (* -4.0 (/ (* a t) c)) (if (<= z 1.36e+23) (/ b (* c z)) (* -4.0 (* t (/ a c))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.75e-64) {
tmp = -4.0 * ((a * t) / c);
} else if (z <= 1.36e+23) {
tmp = b / (c * z);
} else {
tmp = -4.0 * (t * (a / c));
}
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 (z <= (-2.75d-64)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (z <= 1.36d+23) then
tmp = b / (c * z)
else
tmp = (-4.0d0) * (t * (a / c))
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 (z <= -2.75e-64) {
tmp = -4.0 * ((a * t) / c);
} else if (z <= 1.36e+23) {
tmp = b / (c * z);
} else {
tmp = -4.0 * (t * (a / c));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if z <= -2.75e-64: tmp = -4.0 * ((a * t) / c) elif z <= 1.36e+23: tmp = b / (c * z) else: tmp = -4.0 * (t * (a / c)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2.75e-64) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (z <= 1.36e+23) tmp = Float64(b / Float64(c * z)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (z <= -2.75e-64) tmp = -4.0 * ((a * t) / c); elseif (z <= 1.36e+23) tmp = b / (c * z); else tmp = -4.0 * (t * (a / c)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -2.75e-64], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.36e+23], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{-64}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;z \leq 1.36 \cdot 10^{+23}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\end{array}
if z < -2.7499999999999999e-64Initial program 79.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
if -2.7499999999999999e-64 < z < 1.36e23Initial program 79.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.0%
Applied rewrites35.0%
if 1.36e23 < z Initial program 79.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* -4.0 (/ (* a t) c)))) (if (<= z -2.75e-64) t_1 (if (<= z 1.36e+23) (/ 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 <= -2.75e-64) {
tmp = t_1;
} else if (z <= 1.36e+23) {
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 <= (-2.75d-64)) then
tmp = t_1
else if (z <= 1.36d+23) 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 <= -2.75e-64) {
tmp = t_1;
} else if (z <= 1.36e+23) {
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 <= -2.75e-64: tmp = t_1 elif z <= 1.36e+23: 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 <= -2.75e-64) tmp = t_1; elseif (z <= 1.36e+23) 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 <= -2.75e-64) tmp = t_1; elseif (z <= 1.36e+23) 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, -2.75e-64], t$95$1, If[LessEqual[z, 1.36e+23], 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 -2.75 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.36 \cdot 10^{+23}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.7499999999999999e-64 or 1.36e23 < z Initial program 79.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
if -2.7499999999999999e-64 < z < 1.36e23Initial program 79.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.0%
Applied rewrites35.0%
(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.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.0%
Applied rewrites35.0%
herbie shell --seed 2025258
(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)))