
(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
(fma
(* 9.0 (fmin x y))
(/ (fmax x y) (* c z))
(*
(fmin t a)
(fma -4.0 (/ (fmax t a) c) (/ b (* c (* (fmin t a) z))))))))
(if (<= z -2.1e+85)
t_1
(if (<= z 300000000000.0)
(/
(+
(-
(* (* (fmin x y) 9.0) (fmax x y))
(* (* (* z 4.0) (fmin t a)) (fmax t a)))
b)
(* z c))
(if (<= z 2.55e+181)
(/
(/ 1.0 c)
(/
z
(fma
(* 9.0 (fmax x y))
(fmin x y)
(fma (* (* -4.0 z) (fmax t a)) (fmin t a) b))))
t_1)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((9.0 * fmin(x, y)), (fmax(x, y) / (c * z)), (fmin(t, a) * fma(-4.0, (fmax(t, a) / c), (b / (c * (fmin(t, a) * z))))));
double tmp;
if (z <= -2.1e+85) {
tmp = t_1;
} else if (z <= 300000000000.0) {
tmp = ((((fmin(x, y) * 9.0) * fmax(x, y)) - (((z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / (z * c);
} else if (z <= 2.55e+181) {
tmp = (1.0 / c) / (z / fma((9.0 * fmax(x, y)), fmin(x, y), fma(((-4.0 * z) * fmax(t, a)), fmin(t, a), b)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(Float64(9.0 * fmin(x, y)), Float64(fmax(x, y) / Float64(c * z)), Float64(fmin(t, a) * fma(-4.0, Float64(fmax(t, a) / c), Float64(b / Float64(c * Float64(fmin(t, a) * z)))))) tmp = 0.0 if (z <= -2.1e+85) tmp = t_1; elseif (z <= 300000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(fmin(x, y) * 9.0) * fmax(x, y)) - Float64(Float64(Float64(z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / Float64(z * c)); elseif (z <= 2.55e+181) tmp = Float64(Float64(1.0 / c) / Float64(z / fma(Float64(9.0 * fmax(x, y)), fmin(x, y), fma(Float64(Float64(-4.0 * z) * fmax(t, a)), fmin(t, a), b)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(N[Min[t, a], $MachinePrecision] * N[(-4.0 * N[(N[Max[t, a], $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * N[(N[Min[t, a], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+85], t$95$1, If[LessEqual[z, 300000000000.0], N[(N[(N[(N[(N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.55e+181], N[(N[(1.0 / c), $MachinePrecision] / N[(z / N[(N[(9.0 * N[Max[x, y], $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision] + N[(N[(N[(-4.0 * z), $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[Min[t, a], $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(9 \cdot \mathsf{min}\left(x, y\right), \frac{\mathsf{max}\left(x, y\right)}{c \cdot z}, \mathsf{min}\left(t, a\right) \cdot \mathsf{fma}\left(-4, \frac{\mathsf{max}\left(t, a\right)}{c}, \frac{b}{c \cdot \left(\mathsf{min}\left(t, a\right) \cdot z\right)}\right)\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 300000000000:\\
\;\;\;\;\frac{\left(\left(\mathsf{min}\left(x, y\right) \cdot 9\right) \cdot \mathsf{max}\left(x, y\right) - \left(\left(z \cdot 4\right) \cdot \mathsf{min}\left(t, a\right)\right) \cdot \mathsf{max}\left(t, a\right)\right) + b}{z \cdot c}\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{+181}:\\
\;\;\;\;\frac{\frac{1}{c}}{\frac{z}{\mathsf{fma}\left(9 \cdot \mathsf{max}\left(x, y\right), \mathsf{min}\left(x, y\right), \mathsf{fma}\left(\left(-4 \cdot z\right) \cdot \mathsf{max}\left(t, a\right), \mathsf{min}\left(t, a\right), b\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.1000000000000001e85 or 2.55e181 < z Initial program 79.3%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites73.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6471.7%
Applied rewrites71.7%
if -2.1000000000000001e85 < z < 3e11Initial program 79.3%
if 3e11 < z < 2.55e181Initial program 79.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites78.8%
Applied rewrites81.5%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lower-/.f64N/A
lower-/.f6481.8%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
Applied rewrites79.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (fmin x y) 9.0))
(t_2 (* z (fabs c)))
(t_3
(/
(fma (* 9.0 (fmin x y)) (fmax x y) (fma -4.0 (* (* a t) z) b))
t_2))
(t_4 (/ (+ (- (* t_1 (fmax x y)) (* (* (* z 4.0) t) a)) b) t_2)))
(*
(copysign 1.0 c)
(if (<= t_4 -1e-189)
t_3
(if (<= t_4 1e-48)
(/
(fma
(/ (fmax x y) (fabs c))
t_1
(/ (fma (* z (* t a)) -4.0 b) (fabs c)))
z)
(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 = fmin(x, y) * 9.0;
double t_2 = z * fabs(c);
double t_3 = fma((9.0 * fmin(x, y)), fmax(x, y), fma(-4.0, ((a * t) * z), b)) / t_2;
double t_4 = (((t_1 * fmax(x, y)) - (((z * 4.0) * t) * a)) + b) / t_2;
double tmp;
if (t_4 <= -1e-189) {
tmp = t_3;
} else if (t_4 <= 1e-48) {
tmp = fma((fmax(x, y) / fabs(c)), t_1, (fma((z * (t * a)), -4.0, b) / fabs(c))) / z;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = -4.0 * ((a * t) / fabs(c));
}
return copysign(1.0, c) * tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(fmin(x, y) * 9.0) t_2 = Float64(z * abs(c)) t_3 = Float64(fma(Float64(9.0 * fmin(x, y)), fmax(x, y), fma(-4.0, Float64(Float64(a * t) * z), b)) / t_2) t_4 = Float64(Float64(Float64(Float64(t_1 * fmax(x, y)) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / t_2) tmp = 0.0 if (t_4 <= -1e-189) tmp = t_3; elseif (t_4 <= 1e-48) tmp = Float64(fma(Float64(fmax(x, y) / abs(c)), t_1, Float64(fma(Float64(z * Float64(t * a)), -4.0, b) / abs(c))) / z); elseif (t_4 <= Inf) tmp = t_3; else tmp = Float64(-4.0 * Float64(Float64(a * t) / abs(c))); end return Float64(copysign(1.0, c) * tmp) end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[Abs[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision] + N[(-4.0 * N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(t$95$1 * N[Max[x, y], $MachinePrecision]), $MachinePrecision] - 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, -1e-189], t$95$3, If[LessEqual[t$95$4, 1e-48], N[(N[(N[(N[Max[x, y], $MachinePrecision] / N[Abs[c], $MachinePrecision]), $MachinePrecision] * t$95$1 + N[(N[(N[(z * N[(t * a), $MachinePrecision]), $MachinePrecision] * -4.0 + b), $MachinePrecision] / N[Abs[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$3, N[(-4.0 * N[(N[(a * t), $MachinePrecision] / N[Abs[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(x, y\right) \cdot 9\\
t_2 := z \cdot \left|c\right|\\
t_3 := \frac{\mathsf{fma}\left(9 \cdot \mathsf{min}\left(x, y\right), \mathsf{max}\left(x, y\right), \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{t\_2}\\
t_4 := \frac{\left(t\_1 \cdot \mathsf{max}\left(x, y\right) - \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 -1 \cdot 10^{-189}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 10^{-48}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{max}\left(x, y\right)}{\left|c\right|}, t\_1, \frac{\mathsf{fma}\left(z \cdot \left(t \cdot a\right), -4, b\right)}{\left|c\right|}\right)}{z}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot 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)) < -1.0000000000000001e-189 or 9.9999999999999997e-49 < (/.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.3%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
add-flip-revN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites80.5%
if -1.0000000000000001e-189 < (/.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)) < 9.9999999999999997e-49Initial program 79.3%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
add-flip-revN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites80.5%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lift-*.f64N/A
associate-/r*N/A
div-add-revN/A
Applied rewrites78.2%
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.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* z (fabs c)))
(t_2 (* (fmax t a) (fmin t a)))
(t_3
(/ (fma (* 9.0 (fmin x y)) (fmax x y) (fma -4.0 (* t_2 z) b)) t_1))
(t_4
(/
(+
(-
(* (* (fmin x y) 9.0) (fmax x y))
(* (* (* z 4.0) (fmin t a)) (fmax t a)))
b)
t_1)))
(*
(copysign 1.0 c)
(if (<= t_4 -5e-65)
t_3
(if (<= t_4 1e-48)
(/
(/ 1.0 (fabs c))
(/
z
(fma
(* (* (fmin t a) (fmax t a)) z)
-4.0
(fma (fmin x y) (* (fmax x y) 9.0) b))))
(if (<= t_4 INFINITY) t_3 (* -4.0 (/ t_2 (fabs c)))))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = z * fabs(c);
double t_2 = fmax(t, a) * fmin(t, a);
double t_3 = fma((9.0 * fmin(x, y)), fmax(x, y), fma(-4.0, (t_2 * z), b)) / t_1;
double t_4 = ((((fmin(x, y) * 9.0) * fmax(x, y)) - (((z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / t_1;
double tmp;
if (t_4 <= -5e-65) {
tmp = t_3;
} else if (t_4 <= 1e-48) {
tmp = (1.0 / fabs(c)) / (z / fma(((fmin(t, a) * fmax(t, a)) * z), -4.0, fma(fmin(x, y), (fmax(x, y) * 9.0), b)));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = -4.0 * (t_2 / fabs(c));
}
return copysign(1.0, c) * tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(z * abs(c)) t_2 = Float64(fmax(t, a) * fmin(t, a)) t_3 = Float64(fma(Float64(9.0 * fmin(x, y)), fmax(x, y), fma(-4.0, Float64(t_2 * z), b)) / t_1) t_4 = Float64(Float64(Float64(Float64(Float64(fmin(x, y) * 9.0) * fmax(x, y)) - Float64(Float64(Float64(z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / t_1) tmp = 0.0 if (t_4 <= -5e-65) tmp = t_3; elseif (t_4 <= 1e-48) tmp = Float64(Float64(1.0 / abs(c)) / Float64(z / fma(Float64(Float64(fmin(t, a) * fmax(t, a)) * z), -4.0, fma(fmin(x, y), Float64(fmax(x, y) * 9.0), b)))); elseif (t_4 <= Inf) tmp = t_3; else tmp = Float64(-4.0 * Float64(t_2 / abs(c))); end return Float64(copysign(1.0, c) * tmp) end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(z * N[Abs[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision] + N[(-4.0 * N[(t$95$2 * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$4, -5e-65], t$95$3, If[LessEqual[t$95$4, 1e-48], N[(N[(1.0 / N[Abs[c], $MachinePrecision]), $MachinePrecision] / N[(z / N[(N[(N[(N[Min[t, a], $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * -4.0 + N[(N[Min[x, y], $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] * 9.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$3, N[(-4.0 * N[(t$95$2 / N[Abs[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := z \cdot \left|c\right|\\
t_2 := \mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)\\
t_3 := \frac{\mathsf{fma}\left(9 \cdot \mathsf{min}\left(x, y\right), \mathsf{max}\left(x, y\right), \mathsf{fma}\left(-4, t\_2 \cdot z, b\right)\right)}{t\_1}\\
t_4 := \frac{\left(\left(\mathsf{min}\left(x, y\right) \cdot 9\right) \cdot \mathsf{max}\left(x, y\right) - \left(\left(z \cdot 4\right) \cdot \mathsf{min}\left(t, a\right)\right) \cdot \mathsf{max}\left(t, a\right)\right) + b}{t\_1}\\
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_4 \leq -5 \cdot 10^{-65}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 10^{-48}:\\
\;\;\;\;\frac{\frac{1}{\left|c\right|}}{\frac{z}{\mathsf{fma}\left(\left(\mathsf{min}\left(t, a\right) \cdot \mathsf{max}\left(t, a\right)\right) \cdot z, -4, \mathsf{fma}\left(\mathsf{min}\left(x, y\right), \mathsf{max}\left(x, y\right) \cdot 9, b\right)\right)}}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t\_2}{\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.9999999999999998e-65 or 9.9999999999999997e-49 < (/.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.3%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
add-flip-revN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites80.5%
if -4.9999999999999998e-65 < (/.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)) < 9.9999999999999997e-49Initial program 79.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites78.8%
Applied rewrites81.5%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lower-/.f64N/A
lower-/.f6481.8%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
Applied rewrites79.4%
Applied rewrites81.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.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(/
(+ (- (* (* (fmin x y) 9.0) (fmax x y)) (* (* (* z 4.0) t) a)) b)
(* z c)))
(t_2
(/
(fma (* 9.0 (fmin x y)) (fmax x y) (fma -4.0 (* (* a t) z) b))
(* z c))))
(if (<= t_1 -1e-189)
t_2
(if (<= t_1 5e-242)
(/
(/ (fma -9.0 (* (fmax x y) (fmin x y)) (- (* a (* t (* 4.0 z))) b)) z)
(- c))
(if (<= t_1 INFINITY) t_2 (* -4.0 (/ (* a t) 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)) - (((z * 4.0) * t) * a)) + b) / (z * c);
double t_2 = fma((9.0 * fmin(x, y)), fmax(x, y), fma(-4.0, ((a * t) * z), b)) / (z * c);
double tmp;
if (t_1 <= -1e-189) {
tmp = t_2;
} else if (t_1 <= 5e-242) {
tmp = (fma(-9.0, (fmax(x, y) * fmin(x, y)), ((a * (t * (4.0 * z))) - b)) / z) / -c;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = -4.0 * ((a * t) / c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(Float64(fmin(x, y) * 9.0) * fmax(x, y)) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) t_2 = Float64(fma(Float64(9.0 * fmin(x, y)), fmax(x, y), fma(-4.0, Float64(Float64(a * t) * z), b)) / Float64(z * c)) tmp = 0.0 if (t_1 <= -1e-189) tmp = t_2; elseif (t_1 <= 5e-242) tmp = Float64(Float64(fma(-9.0, Float64(fmax(x, y) * fmin(x, y)), Float64(Float64(a * Float64(t * Float64(4.0 * z))) - b)) / z) / Float64(-c)); elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision] + N[(-4.0 * N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-189], t$95$2, If[LessEqual[t$95$1, 5e-242], N[(N[(N[(-9.0 * N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(t * N[(4.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / (-c)), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \frac{\left(\left(\mathsf{min}\left(x, y\right) \cdot 9\right) \cdot \mathsf{max}\left(x, y\right) - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
t_2 := \frac{\mathsf{fma}\left(9 \cdot \mathsf{min}\left(x, y\right), \mathsf{max}\left(x, y\right), \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot c}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-189}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-242}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(-9, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right), a \cdot \left(t \cdot \left(4 \cdot z\right)\right) - b\right)}{z}}{-c}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\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)) < -1.0000000000000001e-189 or 4.9999999999999998e-242 < (/.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.3%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
add-flip-revN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites80.5%
if -1.0000000000000001e-189 < (/.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.9999999999999998e-242Initial program 79.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lower-/.f64N/A
Applied rewrites78.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.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
(FPCore (x y z t a b c)
:precision binary64
(if (<=
(/
(+ (- (* (* (fmin x y) 9.0) (fmax x y)) (* (* (* z 4.0) t) a)) b)
(* z c))
INFINITY)
(/ (fma (* 9.0 (fmin x y)) (fmax x y) (fma -4.0 (* (* a t) z) b)) (* z c))
(* -4.0 (/ (* a t) c))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((((((fmin(x, y) * 9.0) * fmax(x, y)) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= ((double) INFINITY)) {
tmp = fma((9.0 * fmin(x, y)), fmax(x, y), fma(-4.0, ((a * t) * z), b)) / (z * c);
} else {
tmp = -4.0 * ((a * t) / c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(fmin(x, y) * 9.0) * fmax(x, y)) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) <= Inf) tmp = Float64(fma(Float64(9.0 * fmin(x, y)), fmax(x, y), fma(-4.0, Float64(Float64(a * t) * z), b)) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(N[(N[(N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision] + N[(-4.0 * N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\frac{\left(\left(\mathsf{min}\left(x, y\right) \cdot 9\right) \cdot \mathsf{max}\left(x, y\right) - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot \mathsf{min}\left(x, y\right), \mathsf{max}\left(x, y\right), \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\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)) < +inf.0Initial program 79.3%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
add-flip-revN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites80.5%
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.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -20000000.0)
(/ (fma -4.0 (* a (* t z)) (* 9.0 (* x y))) (* c z))
(if (<= t_1 5e+107)
(/ (+ (* (* (* a -4.0) t) z) b) (* z c))
(/ (/ (fma x (* y 9.0) b) c) z)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -20000000.0) {
tmp = fma(-4.0, (a * (t * z)), (9.0 * (x * y))) / (c * z);
} else if (t_1 <= 5e+107) {
tmp = ((((a * -4.0) * t) * z) + b) / (z * c);
} else {
tmp = (fma(x, (y * 9.0), b) / c) / z;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -20000000.0) tmp = Float64(fma(-4.0, Float64(a * Float64(t * z)), Float64(9.0 * Float64(x * y))) / Float64(c * z)); elseif (t_1 <= 5e+107) tmp = Float64(Float64(Float64(Float64(Float64(a * -4.0) * t) * z) + b) / Float64(z * c)); else tmp = Float64(Float64(fma(x, Float64(y * 9.0), b) / c) / z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -20000000.0], N[(N[(-4.0 * N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+107], N[(N[(N[(N[(N[(a * -4.0), $MachinePrecision] * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(y * 9.0), $MachinePrecision] + b), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -20000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot \left(t \cdot z\right), 9 \cdot \left(x \cdot y\right)\right)}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+107}:\\
\;\;\;\;\frac{\left(\left(a \cdot -4\right) \cdot t\right) \cdot z + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x, y \cdot 9, b\right)}{c}}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e7Initial program 79.3%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
add-flip-revN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites80.5%
Taylor expanded in b around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6456.3%
Applied rewrites56.3%
if -2e7 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000002e107Initial program 79.3%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6456.6%
Applied rewrites56.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.7%
Applied rewrites57.7%
if 5.0000000000000002e107 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites73.3%
Taylor expanded in z around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6458.8%
Applied rewrites58.8%
Applied rewrites60.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -100.0)
(/ (+ b (* 9.0 (* x y))) (* z c))
(if (<= t_1 5e+107)
(/ (+ (* (* (* a -4.0) t) z) b) (* z c))
(/ (/ (fma x (* y 9.0) b) c) z)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -100.0) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if (t_1 <= 5e+107) {
tmp = ((((a * -4.0) * t) * z) + b) / (z * c);
} else {
tmp = (fma(x, (y * 9.0), b) / c) / z;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -100.0) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); elseif (t_1 <= 5e+107) tmp = Float64(Float64(Float64(Float64(Float64(a * -4.0) * t) * z) + b) / Float64(z * c)); else tmp = Float64(Float64(fma(x, Float64(y * 9.0), b) / c) / z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -100.0], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+107], N[(N[(N[(N[(N[(a * -4.0), $MachinePrecision] * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(y * 9.0), $MachinePrecision] + b), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -100:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+107}:\\
\;\;\;\;\frac{\left(\left(a \cdot -4\right) \cdot t\right) \cdot z + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x, y \cdot 9, b\right)}{c}}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -100Initial program 79.3%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6459.7%
Applied rewrites59.7%
if -100 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000002e107Initial program 79.3%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6456.6%
Applied rewrites56.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.7%
Applied rewrites57.7%
if 5.0000000000000002e107 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites73.3%
Taylor expanded in z around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6458.8%
Applied rewrites58.8%
Applied rewrites60.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -100.0)
(/ (+ b (* 9.0 (* x y))) (* z c))
(if (<= t_1 5e+107)
(/ (+ (* -4.0 (* a (* t z))) b) (* z c))
(/ (/ (fma x (* y 9.0) b) c) z)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -100.0) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if (t_1 <= 5e+107) {
tmp = ((-4.0 * (a * (t * z))) + b) / (z * c);
} else {
tmp = (fma(x, (y * 9.0), b) / c) / z;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -100.0) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); elseif (t_1 <= 5e+107) tmp = Float64(Float64(Float64(-4.0 * Float64(a * Float64(t * z))) + b) / Float64(z * c)); else tmp = Float64(Float64(fma(x, Float64(y * 9.0), b) / c) / z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -100.0], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+107], N[(N[(N[(-4.0 * N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(y * 9.0), $MachinePrecision] + b), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -100:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+107}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot \left(t \cdot z\right)\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x, y \cdot 9, b\right)}{c}}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -100Initial program 79.3%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6459.7%
Applied rewrites59.7%
if -100 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000002e107Initial program 79.3%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6456.6%
Applied rewrites56.6%
if 5.0000000000000002e107 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites73.3%
Taylor expanded in z around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6458.8%
Applied rewrites58.8%
Applied rewrites60.6%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -1.55e+76)
(* -4.0 (/ (* a t) c))
(if (<= z 2.06e+40)
(/ (+ b (* 9.0 (* x y))) (* z c))
(/ (/ 1.0 c) (/ -0.25 (* a t))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.55e+76) {
tmp = -4.0 * ((a * t) / c);
} else if (z <= 2.06e+40) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = (1.0 / c) / (-0.25 / (a * t));
}
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 <= (-1.55d+76)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (z <= 2.06d+40) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else
tmp = (1.0d0 / c) / ((-0.25d0) / (a * t))
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 <= -1.55e+76) {
tmp = -4.0 * ((a * t) / c);
} else if (z <= 2.06e+40) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = (1.0 / c) / (-0.25 / (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if z <= -1.55e+76: tmp = -4.0 * ((a * t) / c) elif z <= 2.06e+40: tmp = (b + (9.0 * (x * y))) / (z * c) else: tmp = (1.0 / c) / (-0.25 / (a * t)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -1.55e+76) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (z <= 2.06e+40) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); else tmp = Float64(Float64(1.0 / c) / Float64(-0.25 / Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (z <= -1.55e+76) tmp = -4.0 * ((a * t) / c); elseif (z <= 2.06e+40) tmp = (b + (9.0 * (x * y))) / (z * c); else tmp = (1.0 / c) / (-0.25 / (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.55e+76], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.06e+40], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / c), $MachinePrecision] / N[(-0.25 / N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+76}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;z \leq 2.06 \cdot 10^{+40}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{c}}{\frac{-0.25}{a \cdot t}}\\
\end{array}
if z < -1.5500000000000001e76Initial program 79.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if -1.5500000000000001e76 < z < 2.06e40Initial program 79.3%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6459.7%
Applied rewrites59.7%
if 2.06e40 < z Initial program 79.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites78.8%
Applied rewrites81.5%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lower-/.f64N/A
lower-/.f6481.8%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
Applied rewrites79.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f6438.7%
Applied rewrites38.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -20000000.0)
(/ (* (* 9.0 x) y) (* c z))
(if (<= t_1 -5e-315)
(/ b (* c z))
(if (<= t_1 5e+107)
(* -4.0 (/ (* a t) c))
(* (/ y z) (/ (* 9.0 x) 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 tmp;
if (t_1 <= -20000000.0) {
tmp = ((9.0 * x) * y) / (c * z);
} else if (t_1 <= -5e-315) {
tmp = b / (c * z);
} else if (t_1 <= 5e+107) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = (y / z) * ((9.0 * x) / 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) :: t_1
real(8) :: tmp
t_1 = (x * 9.0d0) * y
if (t_1 <= (-20000000.0d0)) then
tmp = ((9.0d0 * x) * y) / (c * z)
else if (t_1 <= (-5d-315)) then
tmp = b / (c * z)
else if (t_1 <= 5d+107) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = (y / z) * ((9.0d0 * x) / 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 t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -20000000.0) {
tmp = ((9.0 * x) * y) / (c * z);
} else if (t_1 <= -5e-315) {
tmp = b / (c * z);
} else if (t_1 <= 5e+107) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = (y / z) * ((9.0 * x) / c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -20000000.0: tmp = ((9.0 * x) * y) / (c * z) elif t_1 <= -5e-315: tmp = b / (c * z) elif t_1 <= 5e+107: tmp = -4.0 * ((a * t) / c) else: tmp = (y / z) * ((9.0 * x) / c) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -20000000.0) tmp = Float64(Float64(Float64(9.0 * x) * y) / Float64(c * z)); elseif (t_1 <= -5e-315) tmp = Float64(b / Float64(c * z)); elseif (t_1 <= 5e+107) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(Float64(y / z) * Float64(Float64(9.0 * x) / c)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; tmp = 0.0; if (t_1 <= -20000000.0) tmp = ((9.0 * x) * y) / (c * z); elseif (t_1 <= -5e-315) tmp = b / (c * z); elseif (t_1 <= 5e+107) tmp = -4.0 * ((a * t) / c); else tmp = (y / z) * ((9.0 * x) / c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -20000000.0], N[(N[(N[(9.0 * x), $MachinePrecision] * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-315], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+107], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * N[(N[(9.0 * x), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -20000000:\\
\;\;\;\;\frac{\left(9 \cdot x\right) \cdot y}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-315}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+107}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{9 \cdot x}{c}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e7Initial program 79.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f6435.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6435.5%
Applied rewrites35.5%
if -2e7 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.000000002289732e-315Initial program 79.3%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
if -5.000000002289732e-315 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000002e107Initial program 79.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if 5.0000000000000002e107 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6436.4%
Applied rewrites36.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -20000000.0)
(/ (* (* 9.0 x) y) (* c z))
(if (<= t_1 -5e-315)
(/ b (* c z))
(if (<= t_1 5e+107)
(* -4.0 (/ (* a t) c))
(* x (/ (* 9.0 y) (* c z))))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -20000000.0) {
tmp = ((9.0 * x) * y) / (c * z);
} else if (t_1 <= -5e-315) {
tmp = b / (c * z);
} else if (t_1 <= 5e+107) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = x * ((9.0 * y) / (c * z));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 9.0d0) * y
if (t_1 <= (-20000000.0d0)) then
tmp = ((9.0d0 * x) * y) / (c * z)
else if (t_1 <= (-5d-315)) then
tmp = b / (c * z)
else if (t_1 <= 5d+107) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = x * ((9.0d0 * y) / (c * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -20000000.0) {
tmp = ((9.0 * x) * y) / (c * z);
} else if (t_1 <= -5e-315) {
tmp = b / (c * z);
} else if (t_1 <= 5e+107) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = x * ((9.0 * y) / (c * z));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -20000000.0: tmp = ((9.0 * x) * y) / (c * z) elif t_1 <= -5e-315: tmp = b / (c * z) elif t_1 <= 5e+107: tmp = -4.0 * ((a * t) / c) else: tmp = x * ((9.0 * y) / (c * z)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -20000000.0) tmp = Float64(Float64(Float64(9.0 * x) * y) / Float64(c * z)); elseif (t_1 <= -5e-315) tmp = Float64(b / Float64(c * z)); elseif (t_1 <= 5e+107) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(x * Float64(Float64(9.0 * y) / Float64(c * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; tmp = 0.0; if (t_1 <= -20000000.0) tmp = ((9.0 * x) * y) / (c * z); elseif (t_1 <= -5e-315) tmp = b / (c * z); elseif (t_1 <= 5e+107) tmp = -4.0 * ((a * t) / c); else tmp = x * ((9.0 * y) / (c * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -20000000.0], N[(N[(N[(9.0 * x), $MachinePrecision] * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-315], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+107], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(9.0 * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -20000000:\\
\;\;\;\;\frac{\left(9 \cdot x\right) \cdot y}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-315}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+107}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{9 \cdot y}{c \cdot z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e7Initial program 79.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f6435.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6435.5%
Applied rewrites35.5%
if -2e7 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.000000002289732e-315Initial program 79.3%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
if -5.000000002289732e-315 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000002e107Initial program 79.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if 5.0000000000000002e107 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6437.8%
Applied rewrites37.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -20000000.0)
(* (* x y) (/ 9.0 (* c z)))
(if (<= t_1 -5e-315)
(/ b (* c z))
(if (<= t_1 5e+107)
(* -4.0 (/ (* a t) c))
(* x (/ (* 9.0 y) (* c z))))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -20000000.0) {
tmp = (x * y) * (9.0 / (c * z));
} else if (t_1 <= -5e-315) {
tmp = b / (c * z);
} else if (t_1 <= 5e+107) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = x * ((9.0 * y) / (c * z));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 9.0d0) * y
if (t_1 <= (-20000000.0d0)) then
tmp = (x * y) * (9.0d0 / (c * z))
else if (t_1 <= (-5d-315)) then
tmp = b / (c * z)
else if (t_1 <= 5d+107) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = x * ((9.0d0 * y) / (c * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -20000000.0) {
tmp = (x * y) * (9.0 / (c * z));
} else if (t_1 <= -5e-315) {
tmp = b / (c * z);
} else if (t_1 <= 5e+107) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = x * ((9.0 * y) / (c * z));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -20000000.0: tmp = (x * y) * (9.0 / (c * z)) elif t_1 <= -5e-315: tmp = b / (c * z) elif t_1 <= 5e+107: tmp = -4.0 * ((a * t) / c) else: tmp = x * ((9.0 * y) / (c * z)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -20000000.0) tmp = Float64(Float64(x * y) * Float64(9.0 / Float64(c * z))); elseif (t_1 <= -5e-315) tmp = Float64(b / Float64(c * z)); elseif (t_1 <= 5e+107) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(x * Float64(Float64(9.0 * y) / Float64(c * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; tmp = 0.0; if (t_1 <= -20000000.0) tmp = (x * y) * (9.0 / (c * z)); elseif (t_1 <= -5e-315) tmp = b / (c * z); elseif (t_1 <= 5e+107) tmp = -4.0 * ((a * t) / c); else tmp = x * ((9.0 * y) / (c * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -20000000.0], N[(N[(x * y), $MachinePrecision] * N[(9.0 / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-315], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+107], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(9.0 * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -20000000:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{9}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-315}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+107}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{9 \cdot y}{c \cdot z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e7Initial program 79.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6435.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6435.7%
Applied rewrites35.7%
if -2e7 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.000000002289732e-315Initial program 79.3%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
if -5.000000002289732e-315 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000002e107Initial program 79.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if 5.0000000000000002e107 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6437.8%
Applied rewrites37.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -20000000.0)
(* 9.0 (/ (* x y) (* c z)))
(if (<= t_1 -5e-315)
(/ b (* c z))
(if (<= t_1 5e+107)
(* -4.0 (/ (* a t) c))
(* x (/ (* 9.0 y) (* c z))))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -20000000.0) {
tmp = 9.0 * ((x * y) / (c * z));
} else if (t_1 <= -5e-315) {
tmp = b / (c * z);
} else if (t_1 <= 5e+107) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = x * ((9.0 * y) / (c * z));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 9.0d0) * y
if (t_1 <= (-20000000.0d0)) then
tmp = 9.0d0 * ((x * y) / (c * z))
else if (t_1 <= (-5d-315)) then
tmp = b / (c * z)
else if (t_1 <= 5d+107) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = x * ((9.0d0 * y) / (c * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -20000000.0) {
tmp = 9.0 * ((x * y) / (c * z));
} else if (t_1 <= -5e-315) {
tmp = b / (c * z);
} else if (t_1 <= 5e+107) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = x * ((9.0 * y) / (c * z));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -20000000.0: tmp = 9.0 * ((x * y) / (c * z)) elif t_1 <= -5e-315: tmp = b / (c * z) elif t_1 <= 5e+107: tmp = -4.0 * ((a * t) / c) else: tmp = x * ((9.0 * y) / (c * z)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -20000000.0) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z))); elseif (t_1 <= -5e-315) tmp = Float64(b / Float64(c * z)); elseif (t_1 <= 5e+107) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(x * Float64(Float64(9.0 * y) / Float64(c * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; tmp = 0.0; if (t_1 <= -20000000.0) tmp = 9.0 * ((x * y) / (c * z)); elseif (t_1 <= -5e-315) tmp = b / (c * z); elseif (t_1 <= 5e+107) tmp = -4.0 * ((a * t) / c); else tmp = x * ((9.0 * y) / (c * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -20000000.0], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-315], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+107], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(9.0 * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -20000000:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-315}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+107}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{9 \cdot y}{c \cdot z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e7Initial program 79.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
if -2e7 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.000000002289732e-315Initial program 79.3%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
if -5.000000002289732e-315 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000002e107Initial program 79.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if 5.0000000000000002e107 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6437.8%
Applied rewrites37.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* 9.0 (/ (* x y) (* c z)))))
(if (<= t_1 -20000000.0)
t_2
(if (<= t_1 -5e-315)
(/ b (* c z))
(if (<= t_1 5e+107) (* -4.0 (/ (* a t) c)) t_2)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * ((x * y) / (c * z));
double tmp;
if (t_1 <= -20000000.0) {
tmp = t_2;
} else if (t_1 <= -5e-315) {
tmp = b / (c * z);
} else if (t_1 <= 5e+107) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 9.0d0) * y
t_2 = 9.0d0 * ((x * y) / (c * z))
if (t_1 <= (-20000000.0d0)) then
tmp = t_2
else if (t_1 <= (-5d-315)) then
tmp = b / (c * z)
else if (t_1 <= 5d+107) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * ((x * y) / (c * z));
double tmp;
if (t_1 <= -20000000.0) {
tmp = t_2;
} else if (t_1 <= -5e-315) {
tmp = b / (c * z);
} else if (t_1 <= 5e+107) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = 9.0 * ((x * y) / (c * z)) tmp = 0 if t_1 <= -20000000.0: tmp = t_2 elif t_1 <= -5e-315: tmp = b / (c * z) elif t_1 <= 5e+107: tmp = -4.0 * ((a * t) / c) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z))) tmp = 0.0 if (t_1 <= -20000000.0) tmp = t_2; elseif (t_1 <= -5e-315) tmp = Float64(b / Float64(c * z)); elseif (t_1 <= 5e+107) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; t_2 = 9.0 * ((x * y) / (c * z)); tmp = 0.0; if (t_1 <= -20000000.0) tmp = t_2; elseif (t_1 <= -5e-315) tmp = b / (c * z); elseif (t_1 <= 5e+107) tmp = -4.0 * ((a * t) / c); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -20000000.0], t$95$2, If[LessEqual[t$95$1, -5e-315], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+107], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := 9 \cdot \frac{x \cdot y}{c \cdot z}\\
\mathbf{if}\;t\_1 \leq -20000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-315}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+107}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e7 or 5.0000000000000002e107 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
if -2e7 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.000000002289732e-315Initial program 79.3%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
if -5.000000002289732e-315 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000002e107Initial program 79.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* -4.0 (/ (* a t) c)))) (if (<= z -5.8e+51) t_1 (if (<= z 3.7e-57) (* (/ 1.0 (* c z)) b) 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 <= -5.8e+51) {
tmp = t_1;
} else if (z <= 3.7e-57) {
tmp = (1.0 / (c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 <= (-5.8d+51)) then
tmp = t_1
else if (z <= 3.7d-57) then
tmp = (1.0d0 / (c * z)) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * ((a * t) / c);
double tmp;
if (z <= -5.8e+51) {
tmp = t_1;
} else if (z <= 3.7e-57) {
tmp = (1.0 / (c * z)) * b;
} 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 <= -5.8e+51: tmp = t_1 elif z <= 3.7e-57: tmp = (1.0 / (c * z)) * b 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 <= -5.8e+51) tmp = t_1; elseif (z <= 3.7e-57) tmp = Float64(Float64(1.0 / Float64(c * z)) * b); 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 <= -5.8e+51) tmp = t_1; elseif (z <= 3.7e-57) tmp = (1.0 / (c * z)) * b; 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, -5.8e+51], t$95$1, If[LessEqual[z, 3.7e-57], N[(N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-57}:\\
\;\;\;\;\frac{1}{c \cdot z} \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -5.7999999999999997e51 or 3.7e-57 < z Initial program 79.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if -5.7999999999999997e51 < z < 3.7e-57Initial program 79.3%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6435.4%
Applied rewrites35.4%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* -4.0 (/ (* a t) c)))) (if (<= z -5.8e+51) t_1 (if (<= z 3.7e-57) (/ 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 <= -5.8e+51) {
tmp = t_1;
} else if (z <= 3.7e-57) {
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 <= (-5.8d+51)) then
tmp = t_1
else if (z <= 3.7d-57) 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 <= -5.8e+51) {
tmp = t_1;
} else if (z <= 3.7e-57) {
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 <= -5.8e+51: tmp = t_1 elif z <= 3.7e-57: 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 <= -5.8e+51) tmp = t_1; elseif (z <= 3.7e-57) 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 <= -5.8e+51) tmp = t_1; elseif (z <= 3.7e-57) 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, -5.8e+51], t$95$1, If[LessEqual[z, 3.7e-57], 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 -5.8 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-57}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -5.7999999999999997e51 or 3.7e-57 < z Initial program 79.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if -5.7999999999999997e51 < z < 3.7e-57Initial program 79.3%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
(FPCore (x y z t a b c) :precision binary64 (/ b (* c z)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = b / (c * z)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
def code(x, y, z, t, a, b, c): return b / (c * z)
function code(x, y, z, t, a, b, c) return Float64(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.3%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.3%
Applied rewrites35.3%
herbie shell --seed 2025201
(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)))