
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
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, i)
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), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
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, i)
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), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (fma y x (* (- z) (fma c (/ (* (fma c b a) i) z) (- t))))))
(t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 1e+307) (* 2.0 (- (+ (* x y) (* z t)) t_2)) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * fma(y, x, (-z * fma(c, ((fma(c, b, a) * i) / z), -t)));
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 1e+307) {
tmp = 2.0 * (((x * y) + (z * t)) - t_2);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * fma(y, x, Float64(Float64(-z) * fma(c, Float64(Float64(fma(c, b, a) * i) / z), Float64(-t))))) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 1e+307) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(y * x + N[((-z) * N[(c * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] / z), $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 1e+307], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := 2 \cdot \mathsf{fma}\left(y, x, \left(-z\right) \cdot \mathsf{fma}\left(c, \frac{\mathsf{fma}\left(c, b, a\right) \cdot i}{z}, -t\right)\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+307}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6485.7
Applied rewrites85.7%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999986e306Initial program 90.0%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (fma c b a) i)) (t_2 (* (+ a (* b c)) c)))
(if (<= t_2 -1e+258)
(* (* (- z) (fma c (/ t_1 z) (- t))) 2.0)
(if (<= t_2 5e+256)
(* 2.0 (- (+ (* x y) (* z t)) (* t_2 i)))
(* (- (* y x) (* t_1 c)) 2.0)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(c, b, a) * i;
double t_2 = (a + (b * c)) * c;
double tmp;
if (t_2 <= -1e+258) {
tmp = (-z * fma(c, (t_1 / z), -t)) * 2.0;
} else if (t_2 <= 5e+256) {
tmp = 2.0 * (((x * y) + (z * t)) - (t_2 * i));
} else {
tmp = ((y * x) - (t_1 * c)) * 2.0;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(c, b, a) * i) t_2 = Float64(Float64(a + Float64(b * c)) * c) tmp = 0.0 if (t_2 <= -1e+258) tmp = Float64(Float64(Float64(-z) * fma(c, Float64(t_1 / z), Float64(-t))) * 2.0); elseif (t_2 <= 5e+256) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(t_2 * i))); else tmp = Float64(Float64(Float64(y * x) - Float64(t_1 * c)) * 2.0); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+258], N[(N[((-z) * N[(c * N[(t$95$1 / z), $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 5e+256], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$2 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] - N[(t$95$1 * c), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, a\right) \cdot i\\
t_2 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+258}:\\
\;\;\;\;\left(\left(-z\right) \cdot \mathsf{fma}\left(c, \frac{t\_1}{z}, -t\right)\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+256}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t\_2 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x - t\_1 \cdot c\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.00000000000000006e258Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in x around 0
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.3%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f6454.4
Applied rewrites54.4%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6465.5
Applied rewrites65.5%
if -1.00000000000000006e258 < (*.f64 (+.f64 a (*.f64 b c)) c) < 5.00000000000000015e256Initial program 90.0%
if 5.00000000000000015e256 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6485.7
Applied rewrites85.7%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f6469.7
Applied rewrites69.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= i 1.1e+159) (* 2.0 (fma y x (- (* t z) (* (* (fma c b a) i) c)))) (* (- (* t z) (* (* (fma c b a) c) i)) 2.0)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (i <= 1.1e+159) {
tmp = 2.0 * fma(y, x, ((t * z) - ((fma(c, b, a) * i) * c)));
} else {
tmp = ((t * z) - ((fma(c, b, a) * c) * i)) * 2.0;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (i <= 1.1e+159) tmp = Float64(2.0 * fma(y, x, Float64(Float64(t * z) - Float64(Float64(fma(c, b, a) * i) * c)))); else tmp = Float64(Float64(Float64(t * z) - Float64(Float64(fma(c, b, a) * c) * i)) * 2.0); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[i, 1.1e+159], N[(2.0 * N[(y * x + N[(N[(t * z), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * z), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq 1.1 \cdot 10^{+159}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right) \cdot 2\\
\end{array}
\end{array}
if i < 1.1e159Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
if 1.1e159 < i Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in x around 0
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (fma c b a) i)) (t_2 (* (+ a (* b c)) c)))
(if (<= t_2 -5e+252)
(* (* (- z) (fma c (/ t_1 z) (- t))) 2.0)
(if (<= t_2 2e+24)
(* 2.0 (- (fma t z (* y x)) (* (* i c) a)))
(* (- (* y x) (* t_1 c)) 2.0)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(c, b, a) * i;
double t_2 = (a + (b * c)) * c;
double tmp;
if (t_2 <= -5e+252) {
tmp = (-z * fma(c, (t_1 / z), -t)) * 2.0;
} else if (t_2 <= 2e+24) {
tmp = 2.0 * (fma(t, z, (y * x)) - ((i * c) * a));
} else {
tmp = ((y * x) - (t_1 * c)) * 2.0;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(c, b, a) * i) t_2 = Float64(Float64(a + Float64(b * c)) * c) tmp = 0.0 if (t_2 <= -5e+252) tmp = Float64(Float64(Float64(-z) * fma(c, Float64(t_1 / z), Float64(-t))) * 2.0); elseif (t_2 <= 2e+24) tmp = Float64(2.0 * Float64(fma(t, z, Float64(y * x)) - Float64(Float64(i * c) * a))); else tmp = Float64(Float64(Float64(y * x) - Float64(t_1 * c)) * 2.0); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+252], N[(N[((-z) * N[(c * N[(t$95$1 / z), $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 2e+24], N[(2.0 * N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] - N[(t$95$1 * c), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, a\right) \cdot i\\
t_2 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+252}:\\
\;\;\;\;\left(\left(-z\right) \cdot \mathsf{fma}\left(c, \frac{t\_1}{z}, -t\right)\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+24}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x - t\_1 \cdot c\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -4.9999999999999997e252Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in x around 0
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.3%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f6454.4
Applied rewrites54.4%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6465.5
Applied rewrites65.5%
if -4.9999999999999997e252 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2e24Initial program 90.0%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6474.4
Applied rewrites74.4%
if 2e24 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6485.7
Applied rewrites85.7%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f6469.7
Applied rewrites69.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (fma c b a) i) c)) (t_2 (* (+ a (* b c)) c)))
(if (<= t_2 -5e+252)
(* -2.0 t_1)
(if (<= t_2 2e+24)
(* 2.0 (- (fma t z (* y x)) (* (* i c) a)))
(* (- (* y x) t_1) 2.0)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (fma(c, b, a) * i) * c;
double t_2 = (a + (b * c)) * c;
double tmp;
if (t_2 <= -5e+252) {
tmp = -2.0 * t_1;
} else if (t_2 <= 2e+24) {
tmp = 2.0 * (fma(t, z, (y * x)) - ((i * c) * a));
} else {
tmp = ((y * x) - t_1) * 2.0;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(fma(c, b, a) * i) * c) t_2 = Float64(Float64(a + Float64(b * c)) * c) tmp = 0.0 if (t_2 <= -5e+252) tmp = Float64(-2.0 * t_1); elseif (t_2 <= 2e+24) tmp = Float64(2.0 * Float64(fma(t, z, Float64(y * x)) - Float64(Float64(i * c) * a))); else tmp = Float64(Float64(Float64(y * x) - t_1) * 2.0); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+252], N[(-2.0 * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e+24], N[(2.0 * N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] - t$95$1), $MachinePrecision] * 2.0), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\\
t_2 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+252}:\\
\;\;\;\;-2 \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+24}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x - t\_1\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -4.9999999999999997e252Initial program 90.0%
Taylor expanded in i around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6447.3
Applied rewrites47.3%
if -4.9999999999999997e252 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2e24Initial program 90.0%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6474.4
Applied rewrites74.4%
if 2e24 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6485.7
Applied rewrites85.7%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f6469.7
Applied rewrites69.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (fma c b a) i) c)) (t_2 (* (+ a (* b c)) c)))
(if (<= t_2 -1e+134)
(* 2.0 (- (* t z) t_1))
(if (<= t_2 2e+24)
(* 2.0 (fma y x (- (* t z) (* (* i a) c))))
(* (- (* y x) t_1) 2.0)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (fma(c, b, a) * i) * c;
double t_2 = (a + (b * c)) * c;
double tmp;
if (t_2 <= -1e+134) {
tmp = 2.0 * ((t * z) - t_1);
} else if (t_2 <= 2e+24) {
tmp = 2.0 * fma(y, x, ((t * z) - ((i * a) * c)));
} else {
tmp = ((y * x) - t_1) * 2.0;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(fma(c, b, a) * i) * c) t_2 = Float64(Float64(a + Float64(b * c)) * c) tmp = 0.0 if (t_2 <= -1e+134) tmp = Float64(2.0 * Float64(Float64(t * z) - t_1)); elseif (t_2 <= 2e+24) tmp = Float64(2.0 * fma(y, x, Float64(Float64(t * z) - Float64(Float64(i * a) * c)))); else tmp = Float64(Float64(Float64(y * x) - t_1) * 2.0); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+134], N[(2.0 * N[(N[(t * z), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+24], N[(2.0 * N[(y * x + N[(N[(t * z), $MachinePrecision] - N[(N[(i * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] - t$95$1), $MachinePrecision] * 2.0), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\\
t_2 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+134}:\\
\;\;\;\;2 \cdot \left(t \cdot z - t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+24}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(i \cdot a\right) \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x - t\_1\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -9.99999999999999921e133Initial program 90.0%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.0
Applied rewrites69.0%
if -9.99999999999999921e133 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2e24Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f6470.8
Applied rewrites70.8%
if 2e24 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6485.7
Applied rewrites85.7%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f6469.7
Applied rewrites69.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (fma c b a) c)) (t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -5e+267)
(* (* t_1 -2.0) i)
(if (<= t_2 2e+90)
(* 2.0 (fma y x (- (* t z) (* (* i a) c))))
(if (<= t_2 5e+279)
(* (- (* t z) (* t_1 i)) 2.0)
(* -2.0 (* (* (fma c b a) i) c)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(c, b, a) * c;
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -5e+267) {
tmp = (t_1 * -2.0) * i;
} else if (t_2 <= 2e+90) {
tmp = 2.0 * fma(y, x, ((t * z) - ((i * a) * c)));
} else if (t_2 <= 5e+279) {
tmp = ((t * z) - (t_1 * i)) * 2.0;
} else {
tmp = -2.0 * ((fma(c, b, a) * i) * c);
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(c, b, a) * c) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -5e+267) tmp = Float64(Float64(t_1 * -2.0) * i); elseif (t_2 <= 2e+90) tmp = Float64(2.0 * fma(y, x, Float64(Float64(t * z) - Float64(Float64(i * a) * c)))); elseif (t_2 <= 5e+279) tmp = Float64(Float64(Float64(t * z) - Float64(t_1 * i)) * 2.0); else tmp = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+267], N[(N[(t$95$1 * -2.0), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$2, 2e+90], N[(2.0 * N[(y * x + N[(N[(t * z), $MachinePrecision] - N[(N[(i * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+279], N[(N[(N[(t * z), $MachinePrecision] - N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, a\right) \cdot c\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+267}:\\
\;\;\;\;\left(t\_1 \cdot -2\right) \cdot i\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+90}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(i \cdot a\right) \cdot c\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+279}:\\
\;\;\;\;\left(t \cdot z - t\_1 \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999999e267Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in i around inf
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f6447.3
Applied rewrites47.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f6446.9
Applied rewrites46.9%
if -4.9999999999999999e267 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999993e90Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f6470.8
Applied rewrites70.8%
if 1.99999999999999993e90 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e279Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in x around 0
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.3%
if 5.0000000000000002e279 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in i around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6447.3
Applied rewrites47.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (fma c b a) i) c)) (t_2 (* (+ a (* b c)) c)))
(if (<= t_2 -5e+252)
(* -2.0 t_1)
(if (<= t_2 2e+24)
(* 2.0 (fma y x (- (* t z) (* (* i a) c))))
(* (- (* y x) t_1) 2.0)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (fma(c, b, a) * i) * c;
double t_2 = (a + (b * c)) * c;
double tmp;
if (t_2 <= -5e+252) {
tmp = -2.0 * t_1;
} else if (t_2 <= 2e+24) {
tmp = 2.0 * fma(y, x, ((t * z) - ((i * a) * c)));
} else {
tmp = ((y * x) - t_1) * 2.0;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(fma(c, b, a) * i) * c) t_2 = Float64(Float64(a + Float64(b * c)) * c) tmp = 0.0 if (t_2 <= -5e+252) tmp = Float64(-2.0 * t_1); elseif (t_2 <= 2e+24) tmp = Float64(2.0 * fma(y, x, Float64(Float64(t * z) - Float64(Float64(i * a) * c)))); else tmp = Float64(Float64(Float64(y * x) - t_1) * 2.0); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+252], N[(-2.0 * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e+24], N[(2.0 * N[(y * x + N[(N[(t * z), $MachinePrecision] - N[(N[(i * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] - t$95$1), $MachinePrecision] * 2.0), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\\
t_2 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+252}:\\
\;\;\;\;-2 \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+24}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(i \cdot a\right) \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x - t\_1\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -4.9999999999999997e252Initial program 90.0%
Taylor expanded in i around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6447.3
Applied rewrites47.3%
if -4.9999999999999997e252 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2e24Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f6470.8
Applied rewrites70.8%
if 2e24 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6485.7
Applied rewrites85.7%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f6469.7
Applied rewrites69.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 -5e+267)
(* (* (* (fma c b a) c) -2.0) i)
(if (<= t_1 5e+279)
(* 2.0 (fma y x (- (* t z) (* (* i a) c))))
(* -2.0 (* (* (fma c b a) i) c))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * c) * i;
double tmp;
if (t_1 <= -5e+267) {
tmp = ((fma(c, b, a) * c) * -2.0) * i;
} else if (t_1 <= 5e+279) {
tmp = 2.0 * fma(y, x, ((t * z) - ((i * a) * c)));
} else {
tmp = -2.0 * ((fma(c, b, a) * i) * c);
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_1 <= -5e+267) tmp = Float64(Float64(Float64(fma(c, b, a) * c) * -2.0) * i); elseif (t_1 <= 5e+279) tmp = Float64(2.0 * fma(y, x, Float64(Float64(t * z) - Float64(Float64(i * a) * c)))); else tmp = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+267], N[(N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, 5e+279], N[(2.0 * N[(y * x + N[(N[(t * z), $MachinePrecision] - N[(N[(i * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+267}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot -2\right) \cdot i\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+279}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(i \cdot a\right) \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999999e267Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in i around inf
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f6447.3
Applied rewrites47.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f6446.9
Applied rewrites46.9%
if -4.9999999999999999e267 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e279Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f6470.8
Applied rewrites70.8%
if 5.0000000000000002e279 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in i around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6447.3
Applied rewrites47.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 -1e+138)
(* (* (* (fma c b a) c) -2.0) i)
(if (<= t_1 5e+279)
(* (fma t z (* y x)) 2.0)
(* -2.0 (* (* (fma c b a) i) c))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * c) * i;
double tmp;
if (t_1 <= -1e+138) {
tmp = ((fma(c, b, a) * c) * -2.0) * i;
} else if (t_1 <= 5e+279) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = -2.0 * ((fma(c, b, a) * i) * c);
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_1 <= -1e+138) tmp = Float64(Float64(Float64(fma(c, b, a) * c) * -2.0) * i); elseif (t_1 <= 5e+279) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+138], N[(N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, 5e+279], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+138}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot -2\right) \cdot i\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+279}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1e138Initial program 90.0%
Taylor expanded in x around 0
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in i around inf
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f6447.3
Applied rewrites47.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f6446.9
Applied rewrites46.9%
if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e279Initial program 90.0%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.1
Applied rewrites55.1%
if 5.0000000000000002e279 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in i around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6447.3
Applied rewrites47.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* (* (fma c b a) i) c))) (t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -1e+138)
t_1
(if (<= t_2 5e+279) (* (fma t z (* y x)) 2.0) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * ((fma(c, b, a) * i) * c);
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -1e+138) {
tmp = t_1;
} else if (t_2 <= 5e+279) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -1e+138) tmp = t_1; elseif (t_2 <= 5e+279) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+138], t$95$1, If[LessEqual[t$95$2, 5e+279], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+279}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1e138 or 5.0000000000000002e279 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in i around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6447.3
Applied rewrites47.3%
if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e279Initial program 90.0%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.1
Applied rewrites55.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* c (* i c)) b) -2.0)) (t_2 (* (+ a (* b c)) c)))
(if (<= t_2 -5e+252)
t_1
(if (<= t_2 5e+305) (* (fma t z (* y x)) 2.0) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((c * (i * c)) * b) * -2.0;
double t_2 = (a + (b * c)) * c;
double tmp;
if (t_2 <= -5e+252) {
tmp = t_1;
} else if (t_2 <= 5e+305) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(c * Float64(i * c)) * b) * -2.0) t_2 = Float64(Float64(a + Float64(b * c)) * c) tmp = 0.0 if (t_2 <= -5e+252) tmp = t_1; elseif (t_2 <= 5e+305) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(c * N[(i * c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+252], t$95$1, If[LessEqual[t$95$2, 5e+305], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2\\
t_2 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+252}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -4.9999999999999997e252 or 5.00000000000000009e305 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 90.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.8
Applied rewrites32.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6433.8
Applied rewrites33.8%
if -4.9999999999999997e252 < (*.f64 (+.f64 a (*.f64 b c)) c) < 5.00000000000000009e305Initial program 90.0%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.1
Applied rewrites55.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 -5e+302)
(* (* (* c c) (* i b)) -2.0)
(if (<= t_1 5e+279)
(* (fma t z (* y x)) 2.0)
(* (* c (* c (* i b))) -2.0)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * c) * i;
double tmp;
if (t_1 <= -5e+302) {
tmp = ((c * c) * (i * b)) * -2.0;
} else if (t_1 <= 5e+279) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = (c * (c * (i * b))) * -2.0;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_1 <= -5e+302) tmp = Float64(Float64(Float64(c * c) * Float64(i * b)) * -2.0); elseif (t_1 <= 5e+279) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = Float64(Float64(c * Float64(c * Float64(i * b))) * -2.0); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+302], N[(N[(N[(c * c), $MachinePrecision] * N[(i * b), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+279], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(c * N[(c * N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+302}:\\
\;\;\;\;\left(\left(c \cdot c\right) \cdot \left(i \cdot b\right)\right) \cdot -2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+279}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot \left(c \cdot \left(i \cdot b\right)\right)\right) \cdot -2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5e302Initial program 90.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.8
Applied rewrites32.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6431.7
Applied rewrites31.7%
if -5e302 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e279Initial program 90.0%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.1
Applied rewrites55.1%
if 5.0000000000000002e279 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.8
Applied rewrites32.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6431.7
Applied rewrites31.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6433.2
Applied rewrites33.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 -5e+302)
(* (* c (* (* c b) i)) -2.0)
(if (<= t_1 5e+279)
(* (fma t z (* y x)) 2.0)
(* (* c (* c (* i b))) -2.0)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * c) * i;
double tmp;
if (t_1 <= -5e+302) {
tmp = (c * ((c * b) * i)) * -2.0;
} else if (t_1 <= 5e+279) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = (c * (c * (i * b))) * -2.0;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_1 <= -5e+302) tmp = Float64(Float64(c * Float64(Float64(c * b) * i)) * -2.0); elseif (t_1 <= 5e+279) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = Float64(Float64(c * Float64(c * Float64(i * b))) * -2.0); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+302], N[(N[(c * N[(N[(c * b), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+279], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(c * N[(c * N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+302}:\\
\;\;\;\;\left(c \cdot \left(\left(c \cdot b\right) \cdot i\right)\right) \cdot -2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+279}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot \left(c \cdot \left(i \cdot b\right)\right)\right) \cdot -2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5e302Initial program 90.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.8
Applied rewrites32.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6431.7
Applied rewrites31.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6433.2
Applied rewrites33.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6433.2
Applied rewrites33.2%
if -5e302 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e279Initial program 90.0%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.1
Applied rewrites55.1%
if 5.0000000000000002e279 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.8
Applied rewrites32.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6431.7
Applied rewrites31.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6433.2
Applied rewrites33.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c (* c (* i b))) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -5e+302)
t_1
(if (<= t_2 5e+279) (* (fma t z (* y x)) 2.0) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * (c * (i * b))) * -2.0;
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -5e+302) {
tmp = t_1;
} else if (t_2 <= 5e+279) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * Float64(c * Float64(i * b))) * -2.0) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -5e+302) tmp = t_1; elseif (t_2 <= 5e+279) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * N[(c * N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+302], t$95$1, If[LessEqual[t$95$2, 5e+279], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(c \cdot \left(c \cdot \left(i \cdot b\right)\right)\right) \cdot -2\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+302}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+279}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5e302 or 5.0000000000000002e279 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.8
Applied rewrites32.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6431.7
Applied rewrites31.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6433.2
Applied rewrites33.2%
if -5e302 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e279Initial program 90.0%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.1
Applied rewrites55.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* i c) a) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -5e+153)
t_1
(if (<= t_2 4e+182) (* (fma t z (* y x)) 2.0) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((i * c) * a) * -2.0;
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -5e+153) {
tmp = t_1;
} else if (t_2 <= 4e+182) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(i * c) * a) * -2.0) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -5e+153) tmp = t_1; elseif (t_2 <= 4e+182) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+153], t$95$1, If[LessEqual[t$95$2, 4e+182], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+182}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000018e153 or 4.0000000000000003e182 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.9
Applied rewrites25.9%
if -5.00000000000000018e153 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.0000000000000003e182Initial program 90.0%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.1
Applied rewrites55.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* i c) a) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -5e+153)
t_1
(if (<= t_2 5e-303)
(* (* t z) 2.0)
(if (<= t_2 0.0005)
(* (+ x x) y)
(if (<= t_2 4e+182) (* (+ t t) z) t_1))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((i * c) * a) * -2.0;
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -5e+153) {
tmp = t_1;
} else if (t_2 <= 5e-303) {
tmp = (t * z) * 2.0;
} else if (t_2 <= 0.0005) {
tmp = (x + x) * y;
} else if (t_2 <= 4e+182) {
tmp = (t + t) * z;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((i * c) * a) * (-2.0d0)
t_2 = ((a + (b * c)) * c) * i
if (t_2 <= (-5d+153)) then
tmp = t_1
else if (t_2 <= 5d-303) then
tmp = (t * z) * 2.0d0
else if (t_2 <= 0.0005d0) then
tmp = (x + x) * y
else if (t_2 <= 4d+182) then
tmp = (t + t) * z
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((i * c) * a) * -2.0;
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -5e+153) {
tmp = t_1;
} else if (t_2 <= 5e-303) {
tmp = (t * z) * 2.0;
} else if (t_2 <= 0.0005) {
tmp = (x + x) * y;
} else if (t_2 <= 4e+182) {
tmp = (t + t) * z;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = ((i * c) * a) * -2.0 t_2 = ((a + (b * c)) * c) * i tmp = 0 if t_2 <= -5e+153: tmp = t_1 elif t_2 <= 5e-303: tmp = (t * z) * 2.0 elif t_2 <= 0.0005: tmp = (x + x) * y elif t_2 <= 4e+182: tmp = (t + t) * z else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(i * c) * a) * -2.0) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -5e+153) tmp = t_1; elseif (t_2 <= 5e-303) tmp = Float64(Float64(t * z) * 2.0); elseif (t_2 <= 0.0005) tmp = Float64(Float64(x + x) * y); elseif (t_2 <= 4e+182) tmp = Float64(Float64(t + t) * z); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = ((i * c) * a) * -2.0;
t_2 = ((a + (b * c)) * c) * i;
tmp = 0.0;
if (t_2 <= -5e+153)
tmp = t_1;
elseif (t_2 <= 5e-303)
tmp = (t * z) * 2.0;
elseif (t_2 <= 0.0005)
tmp = (x + x) * y;
elseif (t_2 <= 4e+182)
tmp = (t + t) * z;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+153], t$95$1, If[LessEqual[t$95$2, 5e-303], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 0.0005], N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$2, 4e+182], N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-303}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 0.0005:\\
\;\;\;\;\left(x + x\right) \cdot y\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+182}:\\
\;\;\;\;\left(t + t\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000018e153 or 4.0000000000000003e182 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.9
Applied rewrites25.9%
if -5.00000000000000018e153 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999998e-303Initial program 90.0%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.1
Applied rewrites29.1%
lift-*.f64N/A
lift-+.f64N/A
count-2-revN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6429.1
Applied rewrites29.1%
if 4.9999999999999998e-303 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000001e-4Initial program 90.0%
Taylor expanded in x around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.3
Applied rewrites29.3%
if 5.0000000000000001e-4 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.0000000000000003e182Initial program 90.0%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.1
Applied rewrites29.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* (+ t t) z))) (if (<= (* z t) -1e-25) t_1 (if (<= (* z t) 2e+280) (* (+ x x) y) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (t + t) * z;
double tmp;
if ((z * t) <= -1e-25) {
tmp = t_1;
} else if ((z * t) <= 2e+280) {
tmp = (x + x) * y;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (t + t) * z
if ((z * t) <= (-1d-25)) then
tmp = t_1
else if ((z * t) <= 2d+280) then
tmp = (x + x) * y
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (t + t) * z;
double tmp;
if ((z * t) <= -1e-25) {
tmp = t_1;
} else if ((z * t) <= 2e+280) {
tmp = (x + x) * y;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (t + t) * z tmp = 0 if (z * t) <= -1e-25: tmp = t_1 elif (z * t) <= 2e+280: tmp = (x + x) * y else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(t + t) * z) tmp = 0.0 if (Float64(z * t) <= -1e-25) tmp = t_1; elseif (Float64(z * t) <= 2e+280) tmp = Float64(Float64(x + x) * y); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (t + t) * z;
tmp = 0.0;
if ((z * t) <= -1e-25)
tmp = t_1;
elseif ((z * t) <= 2e+280)
tmp = (x + x) * y;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1e-25], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 2e+280], N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(t + t\right) \cdot z\\
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+280}:\\
\;\;\;\;\left(x + x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -1.00000000000000004e-25 or 2.0000000000000001e280 < (*.f64 z t) Initial program 90.0%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.1
Applied rewrites29.1%
if -1.00000000000000004e-25 < (*.f64 z t) < 2.0000000000000001e280Initial program 90.0%
Taylor expanded in x around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.3
Applied rewrites29.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (* (+ t t) z))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (t + t) * z;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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, i)
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), intent (in) :: i
code = (t + t) * z
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (t + t) * z;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): return (t + t) * z
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(t + t) * z) end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = (t + t) * z;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\left(t + t\right) \cdot z
\end{array}
Initial program 90.0%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.1
Applied rewrites29.1%
herbie shell --seed 2025135
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))