
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
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)
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
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
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)
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
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -2.35e+139) (fma (* t (* z -9.0)) y (* (* a b) 27.0)) (fma (* -9.0 (* z y)) t (fma (* b a) 27.0 (+ x x)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.35e+139) {
tmp = fma((t * (z * -9.0)), y, ((a * b) * 27.0));
} else {
tmp = fma((-9.0 * (z * y)), t, fma((b * a), 27.0, (x + x)));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.35e+139) tmp = fma(Float64(t * Float64(z * -9.0)), y, Float64(Float64(a * b) * 27.0)); else tmp = fma(Float64(-9.0 * Float64(z * y)), t, fma(Float64(b * a), 27.0, Float64(x + x))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.35e+139], N[(N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision] * y + N[(N[(a * b), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision] * t + N[(N[(b * a), $MachinePrecision] * 27.0 + N[(x + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{+139}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot \left(z \cdot -9\right), y, \left(a \cdot b\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-9 \cdot \left(z \cdot y\right), t, \mathsf{fma}\left(b \cdot a, 27, x + x\right)\right)\\
\end{array}
\end{array}
if z < -2.35e139Initial program 68.5%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+l-N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-+l-N/A
Applied rewrites96.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6496.7
Applied rewrites96.7%
Taylor expanded in x around 0
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6493.7
Applied rewrites93.7%
if -2.35e139 < z Initial program 96.8%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+l-N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-+l-N/A
Applied rewrites97.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)) (t_2 (* (* a b) 27.0)))
(if (<= t_1 -5e+32)
(fma (* (* z y) t) -9.0 (+ x x))
(if (<= t_1 1e-37) (fma x 2.0 t_2) (fma (* t (* z -9.0)) y t_2)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * 9.0) * z) * t;
double t_2 = (a * b) * 27.0;
double tmp;
if (t_1 <= -5e+32) {
tmp = fma(((z * y) * t), -9.0, (x + x));
} else if (t_1 <= 1e-37) {
tmp = fma(x, 2.0, t_2);
} else {
tmp = fma((t * (z * -9.0)), y, t_2);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) t_2 = Float64(Float64(a * b) * 27.0) tmp = 0.0 if (t_1 <= -5e+32) tmp = fma(Float64(Float64(z * y) * t), -9.0, Float64(x + x)); elseif (t_1 <= 1e-37) tmp = fma(x, 2.0, t_2); else tmp = fma(Float64(t * Float64(z * -9.0)), y, t_2); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] * 27.0), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+32], N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * -9.0 + N[(x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-37], N[(x * 2.0 + t$95$2), $MachinePrecision], N[(N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision] * y + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
t_2 := \left(a \cdot b\right) \cdot 27\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(\left(z \cdot y\right) \cdot t, -9, x + x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-37}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot \left(z \cdot -9\right), y, t\_2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.9999999999999997e32Initial program 91.6%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+l-N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-+l-N/A
Applied rewrites92.7%
Taylor expanded in x around inf
count-2-revN/A
lift-+.f6479.0
Applied rewrites79.0%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6479.1
associate-*l*79.1
*-commutative79.1
*-commutative79.1
Applied rewrites79.1%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.1
Applied rewrites79.1%
if -4.9999999999999997e32 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 1.00000000000000007e-37Initial program 99.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6493.1
Applied rewrites93.1%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-+.f64N/A
count-2-revN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6493.1
Applied rewrites93.1%
if 1.00000000000000007e-37 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 91.7%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+l-N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-+l-N/A
Applied rewrites92.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6492.5
Applied rewrites92.5%
Taylor expanded in x around 0
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6477.5
Applied rewrites77.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* z y) t)) (t_2 (* (* (* y 9.0) z) t)))
(if (<= t_2 -5e+32)
(fma t_1 -9.0 (+ x x))
(if (<= t_2 1e-37)
(fma x 2.0 (* (* a b) 27.0))
(fma -9.0 t_1 (* (* b a) 27.0))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * y) * t;
double t_2 = ((y * 9.0) * z) * t;
double tmp;
if (t_2 <= -5e+32) {
tmp = fma(t_1, -9.0, (x + x));
} else if (t_2 <= 1e-37) {
tmp = fma(x, 2.0, ((a * b) * 27.0));
} else {
tmp = fma(-9.0, t_1, ((b * a) * 27.0));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * y) * t) t_2 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_2 <= -5e+32) tmp = fma(t_1, -9.0, Float64(x + x)); elseif (t_2 <= 1e-37) tmp = fma(x, 2.0, Float64(Float64(a * b) * 27.0)); else tmp = fma(-9.0, t_1, Float64(Float64(b * a) * 27.0)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+32], N[(t$95$1 * -9.0 + N[(x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e-37], N[(x * 2.0 + N[(N[(a * b), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * t$95$1 + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(z \cdot y\right) \cdot t\\
t_2 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, -9, x + x\right)\\
\mathbf{elif}\;t\_2 \leq 10^{-37}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \left(a \cdot b\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-9, t\_1, \left(b \cdot a\right) \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.9999999999999997e32Initial program 91.6%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+l-N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-+l-N/A
Applied rewrites92.7%
Taylor expanded in x around inf
count-2-revN/A
lift-+.f6479.0
Applied rewrites79.0%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6479.1
associate-*l*79.1
*-commutative79.1
*-commutative79.1
Applied rewrites79.1%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.1
Applied rewrites79.1%
if -4.9999999999999997e32 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 1.00000000000000007e-37Initial program 99.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6493.1
Applied rewrites93.1%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-+.f64N/A
count-2-revN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6493.1
Applied rewrites93.1%
if 1.00000000000000007e-37 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 91.7%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6476.8
Applied rewrites76.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (<= t_1 -5e+32)
(fma (* (* z y) t) -9.0 (+ x x))
(if (<= t_1 5e-29)
(fma x 2.0 (* (* a b) 27.0))
(fma (* -9.0 (* z y)) t (+ x x))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * 9.0) * z) * t;
double tmp;
if (t_1 <= -5e+32) {
tmp = fma(((z * y) * t), -9.0, (x + x));
} else if (t_1 <= 5e-29) {
tmp = fma(x, 2.0, ((a * b) * 27.0));
} else {
tmp = fma((-9.0 * (z * y)), t, (x + x));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_1 <= -5e+32) tmp = fma(Float64(Float64(z * y) * t), -9.0, Float64(x + x)); elseif (t_1 <= 5e-29) tmp = fma(x, 2.0, Float64(Float64(a * b) * 27.0)); else tmp = fma(Float64(-9.0 * Float64(z * y)), t, Float64(x + x)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+32], N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * -9.0 + N[(x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-29], N[(x * 2.0 + N[(N[(a * b), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision] * t + N[(x + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(\left(z \cdot y\right) \cdot t, -9, x + x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-29}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \left(a \cdot b\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-9 \cdot \left(z \cdot y\right), t, x + x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.9999999999999997e32Initial program 91.6%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+l-N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-+l-N/A
Applied rewrites92.7%
Taylor expanded in x around inf
count-2-revN/A
lift-+.f6479.0
Applied rewrites79.0%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6479.1
associate-*l*79.1
*-commutative79.1
*-commutative79.1
Applied rewrites79.1%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.1
Applied rewrites79.1%
if -4.9999999999999997e32 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 4.99999999999999986e-29Initial program 99.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6493.1
Applied rewrites93.1%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-+.f64N/A
count-2-revN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6493.1
Applied rewrites93.1%
if 4.99999999999999986e-29 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 91.5%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+l-N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-+l-N/A
Applied rewrites92.8%
Taylor expanded in x around inf
count-2-revN/A
lift-+.f6475.5
Applied rewrites75.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (<= t_1 -5e+32)
(fma (* -9.0 t) (* z y) (+ x x))
(if (<= t_1 5e-29)
(fma x 2.0 (* (* a b) 27.0))
(fma (* -9.0 (* z y)) t (+ x x))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * 9.0) * z) * t;
double tmp;
if (t_1 <= -5e+32) {
tmp = fma((-9.0 * t), (z * y), (x + x));
} else if (t_1 <= 5e-29) {
tmp = fma(x, 2.0, ((a * b) * 27.0));
} else {
tmp = fma((-9.0 * (z * y)), t, (x + x));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_1 <= -5e+32) tmp = fma(Float64(-9.0 * t), Float64(z * y), Float64(x + x)); elseif (t_1 <= 5e-29) tmp = fma(x, 2.0, Float64(Float64(a * b) * 27.0)); else tmp = fma(Float64(-9.0 * Float64(z * y)), t, Float64(x + x)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+32], N[(N[(-9.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-29], N[(x * 2.0 + N[(N[(a * b), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision] * t + N[(x + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(-9 \cdot t, z \cdot y, x + x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-29}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \left(a \cdot b\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-9 \cdot \left(z \cdot y\right), t, x + x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.9999999999999997e32Initial program 91.6%
Taylor expanded in a around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6479.1
Applied rewrites79.1%
if -4.9999999999999997e32 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 4.99999999999999986e-29Initial program 99.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6493.1
Applied rewrites93.1%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-+.f64N/A
count-2-revN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6493.1
Applied rewrites93.1%
if 4.99999999999999986e-29 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 91.5%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-+l-N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-+l-N/A
Applied rewrites92.8%
Taylor expanded in x around inf
count-2-revN/A
lift-+.f6475.5
Applied rewrites75.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (* -9.0 t) (* z y) (+ x x))) (t_2 (* (* (* y 9.0) z) t)))
(if (<= t_2 -5e+32)
t_1
(if (<= t_2 5e-29) (fma x 2.0 (* (* a b) 27.0)) t_1))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((-9.0 * t), (z * y), (x + x));
double t_2 = ((y * 9.0) * z) * t;
double tmp;
if (t_2 <= -5e+32) {
tmp = t_1;
} else if (t_2 <= 5e-29) {
tmp = fma(x, 2.0, ((a * b) * 27.0));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = fma(Float64(-9.0 * t), Float64(z * y), Float64(x + x)) t_2 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_2 <= -5e+32) tmp = t_1; elseif (t_2 <= 5e-29) tmp = fma(x, 2.0, Float64(Float64(a * b) * 27.0)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(-9.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(x + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+32], t$95$1, If[LessEqual[t$95$2, 5e-29], N[(x * 2.0 + N[(N[(a * b), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-9 \cdot t, z \cdot y, x + x\right)\\
t_2 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-29}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \left(a \cdot b\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.9999999999999997e32 or 4.99999999999999986e-29 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 91.6%
Taylor expanded in a around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6477.1
Applied rewrites77.1%
if -4.9999999999999997e32 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 4.99999999999999986e-29Initial program 99.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6493.1
Applied rewrites93.1%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-+.f64N/A
count-2-revN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6493.1
Applied rewrites93.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (<= t_1 -5e+213)
(* (* (* z y) -9.0) t)
(if (<= t_1 2e+165)
(fma x 2.0 (* (* a b) 27.0))
(* -9.0 (* (* z y) t))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * 9.0) * z) * t;
double tmp;
if (t_1 <= -5e+213) {
tmp = ((z * y) * -9.0) * t;
} else if (t_1 <= 2e+165) {
tmp = fma(x, 2.0, ((a * b) * 27.0));
} else {
tmp = -9.0 * ((z * y) * t);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_1 <= -5e+213) tmp = Float64(Float64(Float64(z * y) * -9.0) * t); elseif (t_1 <= 2e+165) tmp = fma(x, 2.0, Float64(Float64(a * b) * 27.0)); else tmp = Float64(-9.0 * Float64(Float64(z * y) * t)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+213], N[(N[(N[(z * y), $MachinePrecision] * -9.0), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, 2e+165], N[(x * 2.0 + N[(N[(a * b), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+213}:\\
\;\;\;\;\left(\left(z \cdot y\right) \cdot -9\right) \cdot t\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+165}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \left(a \cdot b\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(\left(z \cdot y\right) \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.9999999999999998e213Initial program 85.8%
Taylor expanded in x around inf
count-2-revN/A
lower-+.f645.0
Applied rewrites5.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6481.2
Applied rewrites81.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6481.0
Applied rewrites81.0%
if -4.9999999999999998e213 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 1.9999999999999998e165Initial program 99.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6483.6
Applied rewrites83.6%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-+.f64N/A
count-2-revN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.6
Applied rewrites83.6%
if 1.9999999999999998e165 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 86.3%
Taylor expanded in y around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.4
Applied rewrites78.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (<= t_1 -5e+213)
(* (* (* z y) -9.0) t)
(if (<= t_1 2e+165) (fma (* b a) 27.0 (+ x x)) (* -9.0 (* (* z y) t))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * 9.0) * z) * t;
double tmp;
if (t_1 <= -5e+213) {
tmp = ((z * y) * -9.0) * t;
} else if (t_1 <= 2e+165) {
tmp = fma((b * a), 27.0, (x + x));
} else {
tmp = -9.0 * ((z * y) * t);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_1 <= -5e+213) tmp = Float64(Float64(Float64(z * y) * -9.0) * t); elseif (t_1 <= 2e+165) tmp = fma(Float64(b * a), 27.0, Float64(x + x)); else tmp = Float64(-9.0 * Float64(Float64(z * y) * t)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+213], N[(N[(N[(z * y), $MachinePrecision] * -9.0), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, 2e+165], N[(N[(b * a), $MachinePrecision] * 27.0 + N[(x + x), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+213}:\\
\;\;\;\;\left(\left(z \cdot y\right) \cdot -9\right) \cdot t\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+165}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot a, 27, x + x\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(\left(z \cdot y\right) \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.9999999999999998e213Initial program 85.8%
Taylor expanded in x around inf
count-2-revN/A
lower-+.f645.0
Applied rewrites5.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6481.2
Applied rewrites81.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6481.0
Applied rewrites81.0%
if -4.9999999999999998e213 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 1.9999999999999998e165Initial program 99.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6483.6
Applied rewrites83.6%
if 1.9999999999999998e165 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 86.3%
Taylor expanded in y around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.4
Applied rewrites78.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (<= t_1 -5e+213)
(* (* (* z y) -9.0) t)
(if (<= t_1 2e+165) (fma (* 27.0 a) b (+ x x)) (* -9.0 (* (* z y) t))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * 9.0) * z) * t;
double tmp;
if (t_1 <= -5e+213) {
tmp = ((z * y) * -9.0) * t;
} else if (t_1 <= 2e+165) {
tmp = fma((27.0 * a), b, (x + x));
} else {
tmp = -9.0 * ((z * y) * t);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_1 <= -5e+213) tmp = Float64(Float64(Float64(z * y) * -9.0) * t); elseif (t_1 <= 2e+165) tmp = fma(Float64(27.0 * a), b, Float64(x + x)); else tmp = Float64(-9.0 * Float64(Float64(z * y) * t)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+213], N[(N[(N[(z * y), $MachinePrecision] * -9.0), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, 2e+165], N[(N[(27.0 * a), $MachinePrecision] * b + N[(x + x), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+213}:\\
\;\;\;\;\left(\left(z \cdot y\right) \cdot -9\right) \cdot t\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+165}:\\
\;\;\;\;\mathsf{fma}\left(27 \cdot a, b, x + x\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(\left(z \cdot y\right) \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.9999999999999998e213Initial program 85.8%
Taylor expanded in x around inf
count-2-revN/A
lower-+.f645.0
Applied rewrites5.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6481.2
Applied rewrites81.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6481.0
Applied rewrites81.0%
if -4.9999999999999998e213 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 1.9999999999999998e165Initial program 99.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6483.6
Applied rewrites83.6%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-+.f64N/A
count-2-revN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
count-2-revN/A
lift-+.f6483.5
Applied rewrites83.5%
if 1.9999999999999998e165 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 86.3%
Taylor expanded in y around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.4
Applied rewrites78.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (<= t_1 -5e+213)
(* (* (* z y) -9.0) t)
(if (<= t_1 2e+165) (fma a (* 27.0 b) (+ x x)) (* -9.0 (* (* z y) t))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * 9.0) * z) * t;
double tmp;
if (t_1 <= -5e+213) {
tmp = ((z * y) * -9.0) * t;
} else if (t_1 <= 2e+165) {
tmp = fma(a, (27.0 * b), (x + x));
} else {
tmp = -9.0 * ((z * y) * t);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_1 <= -5e+213) tmp = Float64(Float64(Float64(z * y) * -9.0) * t); elseif (t_1 <= 2e+165) tmp = fma(a, Float64(27.0 * b), Float64(x + x)); else tmp = Float64(-9.0 * Float64(Float64(z * y) * t)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+213], N[(N[(N[(z * y), $MachinePrecision] * -9.0), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, 2e+165], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x + x), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+213}:\\
\;\;\;\;\left(\left(z \cdot y\right) \cdot -9\right) \cdot t\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+165}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x + x\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(\left(z \cdot y\right) \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.9999999999999998e213Initial program 85.8%
Taylor expanded in x around inf
count-2-revN/A
lower-+.f645.0
Applied rewrites5.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6481.2
Applied rewrites81.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6481.0
Applied rewrites81.0%
if -4.9999999999999998e213 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 1.9999999999999998e165Initial program 99.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6483.6
Applied rewrites83.6%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lift-+.f64N/A
count-2-revN/A
lower-fma.f64N/A
lower-*.f64N/A
count-2-revN/A
lift-+.f6483.5
Applied rewrites83.5%
if 1.9999999999999998e165 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 86.3%
Taylor expanded in y around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.4
Applied rewrites78.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (* x 2.0) (* (* (* y 9.0) z) t))))
(if (<= t_1 (- INFINITY))
(* (* (* z t) -9.0) y)
(if (<= t_1 -1e-137)
(+ x x)
(if (<= t_1 500.0)
(* (* b a) 27.0)
(if (<= t_1 5e+302) (+ x x) (* (* y (* z t)) -9.0)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) - (((y * 9.0) * z) * t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = ((z * t) * -9.0) * y;
} else if (t_1 <= -1e-137) {
tmp = x + x;
} else if (t_1 <= 500.0) {
tmp = (b * a) * 27.0;
} else if (t_1 <= 5e+302) {
tmp = x + x;
} else {
tmp = (y * (z * t)) * -9.0;
}
return tmp;
}
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) - (((y * 9.0) * z) * t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = ((z * t) * -9.0) * y;
} else if (t_1 <= -1e-137) {
tmp = x + x;
} else if (t_1 <= 500.0) {
tmp = (b * a) * 27.0;
} else if (t_1 <= 5e+302) {
tmp = x + x;
} else {
tmp = (y * (z * t)) * -9.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (x * 2.0) - (((y * 9.0) * z) * t) tmp = 0 if t_1 <= -math.inf: tmp = ((z * t) * -9.0) * y elif t_1 <= -1e-137: tmp = x + x elif t_1 <= 500.0: tmp = (b * a) * 27.0 elif t_1 <= 5e+302: tmp = x + x else: tmp = (y * (z * t)) * -9.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(z * t) * -9.0) * y); elseif (t_1 <= -1e-137) tmp = Float64(x + x); elseif (t_1 <= 500.0) tmp = Float64(Float64(b * a) * 27.0); elseif (t_1 <= 5e+302) tmp = Float64(x + x); else tmp = Float64(Float64(y * Float64(z * t)) * -9.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (x * 2.0) - (((y * 9.0) * z) * t);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = ((z * t) * -9.0) * y;
elseif (t_1 <= -1e-137)
tmp = x + x;
elseif (t_1 <= 500.0)
tmp = (b * a) * 27.0;
elseif (t_1 <= 5e+302)
tmp = x + x;
else
tmp = (y * (z * t)) * -9.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, -1e-137], N[(x + x), $MachinePrecision], If[LessEqual[t$95$1, 500.0], N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+302], N[(x + x), $MachinePrecision], N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(\left(z \cdot t\right) \cdot -9\right) \cdot y\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-137}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;t\_1 \leq 500:\\
\;\;\;\;\left(b \cdot a\right) \cdot 27\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;x + x\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\end{array}
\end{array}
if (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) < -inf.0Initial program 79.4%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6480.2
Applied rewrites80.2%
Taylor expanded in y around inf
*-commutativeN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6493.1
Applied rewrites93.1%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6490.4
Applied rewrites90.4%
if -inf.0 < (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) < -9.99999999999999978e-138 or 500 < (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) < 5e302Initial program 99.7%
Taylor expanded in x around inf
count-2-revN/A
lower-+.f6443.4
Applied rewrites43.4%
if -9.99999999999999978e-138 < (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) < 500Initial program 97.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6469.2
Applied rewrites69.2%
if 5e302 < (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) Initial program 82.4%
Taylor expanded in x around inf
count-2-revN/A
lower-+.f646.9
Applied rewrites6.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6481.0
Applied rewrites81.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6487.4
Applied rewrites87.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (* x 2.0) (* (* (* y 9.0) z) t))))
(if (<= t_1 (- INFINITY))
(* (* (* z t) -9.0) y)
(if (<= t_1 -1e-137)
(+ x x)
(if (<= t_1 500.0)
(* (* b a) 27.0)
(if (<= t_1 5e+302) (+ x x) (* (* (* t -9.0) z) y)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) - (((y * 9.0) * z) * t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = ((z * t) * -9.0) * y;
} else if (t_1 <= -1e-137) {
tmp = x + x;
} else if (t_1 <= 500.0) {
tmp = (b * a) * 27.0;
} else if (t_1 <= 5e+302) {
tmp = x + x;
} else {
tmp = ((t * -9.0) * z) * y;
}
return tmp;
}
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) - (((y * 9.0) * z) * t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = ((z * t) * -9.0) * y;
} else if (t_1 <= -1e-137) {
tmp = x + x;
} else if (t_1 <= 500.0) {
tmp = (b * a) * 27.0;
} else if (t_1 <= 5e+302) {
tmp = x + x;
} else {
tmp = ((t * -9.0) * z) * y;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (x * 2.0) - (((y * 9.0) * z) * t) tmp = 0 if t_1 <= -math.inf: tmp = ((z * t) * -9.0) * y elif t_1 <= -1e-137: tmp = x + x elif t_1 <= 500.0: tmp = (b * a) * 27.0 elif t_1 <= 5e+302: tmp = x + x else: tmp = ((t * -9.0) * z) * y return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(z * t) * -9.0) * y); elseif (t_1 <= -1e-137) tmp = Float64(x + x); elseif (t_1 <= 500.0) tmp = Float64(Float64(b * a) * 27.0); elseif (t_1 <= 5e+302) tmp = Float64(x + x); else tmp = Float64(Float64(Float64(t * -9.0) * z) * y); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (x * 2.0) - (((y * 9.0) * z) * t);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = ((z * t) * -9.0) * y;
elseif (t_1 <= -1e-137)
tmp = x + x;
elseif (t_1 <= 500.0)
tmp = (b * a) * 27.0;
elseif (t_1 <= 5e+302)
tmp = x + x;
else
tmp = ((t * -9.0) * z) * y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, -1e-137], N[(x + x), $MachinePrecision], If[LessEqual[t$95$1, 500.0], N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+302], N[(x + x), $MachinePrecision], N[(N[(N[(t * -9.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(\left(z \cdot t\right) \cdot -9\right) \cdot y\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-137}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;t\_1 \leq 500:\\
\;\;\;\;\left(b \cdot a\right) \cdot 27\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;x + x\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t \cdot -9\right) \cdot z\right) \cdot y\\
\end{array}
\end{array}
if (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) < -inf.0Initial program 79.4%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6480.2
Applied rewrites80.2%
Taylor expanded in y around inf
*-commutativeN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6493.1
Applied rewrites93.1%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6490.4
Applied rewrites90.4%
if -inf.0 < (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) < -9.99999999999999978e-138 or 500 < (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) < 5e302Initial program 99.7%
Taylor expanded in x around inf
count-2-revN/A
lower-+.f6443.4
Applied rewrites43.4%
if -9.99999999999999978e-138 < (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) < 500Initial program 97.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6469.2
Applied rewrites69.2%
if 5e302 < (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) Initial program 82.4%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.8
Applied rewrites79.8%
Taylor expanded in y around inf
*-commutativeN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6491.4
Applied rewrites91.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6413.6
Applied rewrites13.6%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6487.4
Applied rewrites87.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* t -9.0) z) y)) (t_2 (- (* x 2.0) (* (* (* y 9.0) z) t))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -1e-137)
(+ x x)
(if (<= t_2 500.0)
(* (* b a) 27.0)
(if (<= t_2 5e+302) (+ x x) t_1))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * -9.0) * z) * y;
double t_2 = (x * 2.0) - (((y * 9.0) * z) * t);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -1e-137) {
tmp = x + x;
} else if (t_2 <= 500.0) {
tmp = (b * a) * 27.0;
} else if (t_2 <= 5e+302) {
tmp = x + x;
} else {
tmp = t_1;
}
return tmp;
}
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * -9.0) * z) * y;
double t_2 = (x * 2.0) - (((y * 9.0) * z) * t);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -1e-137) {
tmp = x + x;
} else if (t_2 <= 500.0) {
tmp = (b * a) * 27.0;
} else if (t_2 <= 5e+302) {
tmp = x + x;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = ((t * -9.0) * z) * y t_2 = (x * 2.0) - (((y * 9.0) * z) * t) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -1e-137: tmp = x + x elif t_2 <= 500.0: tmp = (b * a) * 27.0 elif t_2 <= 5e+302: tmp = x + x else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * -9.0) * z) * y) t_2 = Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -1e-137) tmp = Float64(x + x); elseif (t_2 <= 500.0) tmp = Float64(Float64(b * a) * 27.0); elseif (t_2 <= 5e+302) tmp = Float64(x + x); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = ((t * -9.0) * z) * y;
t_2 = (x * 2.0) - (((y * 9.0) * z) * t);
tmp = 0.0;
if (t_2 <= -Inf)
tmp = t_1;
elseif (t_2 <= -1e-137)
tmp = x + x;
elseif (t_2 <= 500.0)
tmp = (b * a) * 27.0;
elseif (t_2 <= 5e+302)
tmp = x + x;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * -9.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -1e-137], N[(x + x), $MachinePrecision], If[LessEqual[t$95$2, 500.0], N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision], If[LessEqual[t$95$2, 5e+302], N[(x + x), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(t \cdot -9\right) \cdot z\right) \cdot y\\
t_2 := x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-137}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;t\_2 \leq 500:\\
\;\;\;\;\left(b \cdot a\right) \cdot 27\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;x + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) < -inf.0 or 5e302 < (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) Initial program 80.8%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6480.0
Applied rewrites80.0%
Taylor expanded in y around inf
*-commutativeN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6492.3
Applied rewrites92.3%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6413.8
Applied rewrites13.8%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6488.9
Applied rewrites88.9%
if -inf.0 < (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) < -9.99999999999999978e-138 or 500 < (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) < 5e302Initial program 99.7%
Taylor expanded in x around inf
count-2-revN/A
lower-+.f6443.4
Applied rewrites43.4%
if -9.99999999999999978e-138 < (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) < 500Initial program 97.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6469.2
Applied rewrites69.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* a 27.0) b)))
(if (<= t_1 -2e+72)
(* a (* 27.0 b))
(if (<= t_1 2e+75) (+ x x) (* (* 27.0 a) b)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * 27.0) * b;
double tmp;
if (t_1 <= -2e+72) {
tmp = a * (27.0 * b);
} else if (t_1 <= 2e+75) {
tmp = x + x;
} else {
tmp = (27.0 * a) * b;
}
return tmp;
}
NOTE: x, y, z, t, a, and b 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)
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) :: t_1
real(8) :: tmp
t_1 = (a * 27.0d0) * b
if (t_1 <= (-2d+72)) then
tmp = a * (27.0d0 * b)
else if (t_1 <= 2d+75) then
tmp = x + x
else
tmp = (27.0d0 * a) * b
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * 27.0) * b;
double tmp;
if (t_1 <= -2e+72) {
tmp = a * (27.0 * b);
} else if (t_1 <= 2e+75) {
tmp = x + x;
} else {
tmp = (27.0 * a) * b;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (a * 27.0) * b tmp = 0 if t_1 <= -2e+72: tmp = a * (27.0 * b) elif t_1 <= 2e+75: tmp = x + x else: tmp = (27.0 * a) * b return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(a * 27.0) * b) tmp = 0.0 if (t_1 <= -2e+72) tmp = Float64(a * Float64(27.0 * b)); elseif (t_1 <= 2e+75) tmp = Float64(x + x); else tmp = Float64(Float64(27.0 * a) * b); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (a * 27.0) * b;
tmp = 0.0;
if (t_1 <= -2e+72)
tmp = a * (27.0 * b);
elseif (t_1 <= 2e+75)
tmp = x + x;
else
tmp = (27.0 * a) * b;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+72], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+75], N[(x + x), $MachinePrecision], N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+72}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+75}:\\
\;\;\;\;x + x\\
\mathbf{else}:\\
\;\;\;\;\left(27 \cdot a\right) \cdot b\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -1.99999999999999989e72Initial program 94.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.3
Applied rewrites67.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6467.3
Applied rewrites67.3%
if -1.99999999999999989e72 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 1.99999999999999985e75Initial program 96.5%
Taylor expanded in x around inf
count-2-revN/A
lower-+.f6443.6
Applied rewrites43.6%
if 1.99999999999999985e75 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 92.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.0
Applied rewrites67.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (* a 27.0) b)) (t_2 (* a (* 27.0 b)))) (if (<= t_1 -2e+72) t_2 (if (<= t_1 2e+75) (+ x x) t_2))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * 27.0) * b;
double t_2 = a * (27.0 * b);
double tmp;
if (t_1 <= -2e+72) {
tmp = t_2;
} else if (t_1 <= 2e+75) {
tmp = x + x;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b 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)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * 27.0d0) * b
t_2 = a * (27.0d0 * b)
if (t_1 <= (-2d+72)) then
tmp = t_2
else if (t_1 <= 2d+75) then
tmp = x + x
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * 27.0) * b;
double t_2 = a * (27.0 * b);
double tmp;
if (t_1 <= -2e+72) {
tmp = t_2;
} else if (t_1 <= 2e+75) {
tmp = x + x;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (a * 27.0) * b t_2 = a * (27.0 * b) tmp = 0 if t_1 <= -2e+72: tmp = t_2 elif t_1 <= 2e+75: tmp = x + x else: tmp = t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(a * 27.0) * b) t_2 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (t_1 <= -2e+72) tmp = t_2; elseif (t_1 <= 2e+75) tmp = Float64(x + x); else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (a * 27.0) * b;
t_2 = a * (27.0 * b);
tmp = 0.0;
if (t_1 <= -2e+72)
tmp = t_2;
elseif (t_1 <= 2e+75)
tmp = x + x;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+72], t$95$2, If[LessEqual[t$95$1, 2e+75], N[(x + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
t_2 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+72}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+75}:\\
\;\;\;\;x + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -1.99999999999999989e72 or 1.99999999999999985e75 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 93.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.2
Applied rewrites67.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6467.1
Applied rewrites67.1%
if -1.99999999999999989e72 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 1.99999999999999985e75Initial program 96.5%
Taylor expanded in x around inf
count-2-revN/A
lower-+.f6443.6
Applied rewrites43.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ x x))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x + x;
}
NOTE: x, y, z, t, a, and b 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)
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
code = x + x
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x + x;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x + x
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x + x) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x + x;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x + x), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x + x
\end{array}
Initial program 95.3%
Taylor expanded in x around inf
count-2-revN/A
lower-+.f6431.6
Applied rewrites31.6%
herbie shell --seed 2025114
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))