
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
real(8) function code(x, y, z, t, a, b)
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 - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
real(8) function code(x, y, z, t, a, b)
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 - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (fma (- b a) t (fma (- y 2.0) b (- x (fma (- y 1.0) z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((b - a), t, fma((y - 2.0), b, (x - fma((y - 1.0), z, -a))));
}
function code(x, y, z, t, a, b) return fma(Float64(b - a), t, fma(Float64(y - 2.0), b, Float64(x - fma(Float64(y - 1.0), z, Float64(-a))))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b + N[(x - N[(N[(y - 1.0), $MachinePrecision] * z + (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, x - \mathsf{fma}\left(y - 1, z, -a\right)\right)\right)
\end{array}
Initial program 95.7%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites98.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+306)))
(* b t)
(+ (+ a x) z))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+306)) {
tmp = b * t;
} else {
tmp = (a + x) + z;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+306)) {
tmp = b * t;
} else {
tmp = (a + x) + z;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+306): tmp = b * t else: tmp = (a + x) + z return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+306)) tmp = Float64(b * t); else tmp = Float64(Float64(a + x) + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+306))) tmp = b * t; else tmp = (a + x) + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+306]], $MachinePrecision]], N[(b * t), $MachinePrecision], N[(N[(a + x), $MachinePrecision] + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+306}\right):\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(a + x\right) + z\\
\end{array}
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < -inf.0 or 4.99999999999999993e306 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 88.3%
Taylor expanded in a around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6475.1
Applied rewrites75.1%
Taylor expanded in y around 0
Applied rewrites75.1%
Taylor expanded in t around inf
Applied rewrites22.1%
if -inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < 4.99999999999999993e306Initial program 99.9%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites78.9%
Taylor expanded in a around 0
Applied rewrites53.5%
Taylor expanded in t around 0
Applied rewrites58.6%
Taylor expanded in b around 0
Applied rewrites48.7%
Final simplification38.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+306))) (* b t) (+ z x))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+306)) {
tmp = b * t;
} else {
tmp = z + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+306)) {
tmp = b * t;
} else {
tmp = z + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+306): tmp = b * t else: tmp = z + x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+306)) tmp = Float64(b * t); else tmp = Float64(z + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+306))) tmp = b * t; else tmp = z + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+306]], $MachinePrecision]], N[(b * t), $MachinePrecision], N[(z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+306}\right):\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < -inf.0 or 4.99999999999999993e306 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 88.3%
Taylor expanded in a around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6475.1
Applied rewrites75.1%
Taylor expanded in y around 0
Applied rewrites75.1%
Taylor expanded in t around inf
Applied rewrites22.1%
if -inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < 4.99999999999999993e306Initial program 99.9%
Taylor expanded in a around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6473.9
Applied rewrites73.9%
Taylor expanded in b around 0
Applied rewrites48.1%
Taylor expanded in y around 0
Applied rewrites37.3%
Final simplification31.7%
(FPCore (x y z t a b)
:precision binary64
(if (<=
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))
INFINITY)
(fma (- 1.0 t) a (fma (- 1.0 y) z (fma (- (+ t y) 2.0) b x)))
(- (fma a (- t 1.0) (* z (- y 1.0))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)) <= ((double) INFINITY)) {
tmp = fma((1.0 - t), a, fma((1.0 - y), z, fma(((t + y) - 2.0), b, x)));
} else {
tmp = -fma(a, (t - 1.0), (z * (y - 1.0)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) <= Inf) tmp = fma(Float64(1.0 - t), a, fma(Float64(1.0 - y), z, fma(Float64(Float64(t + y) - 2.0), b, x))); else tmp = Float64(-fma(a, Float64(t - 1.0), Float64(z * Float64(y - 1.0)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(1.0 - y), $MachinePrecision] * z + N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(a * N[(t - 1.0), $MachinePrecision] + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-\mathsf{fma}\left(a, t - 1, z \cdot \left(y - 1\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < +inf.0Initial program 100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
distribute-lft-out--N/A
*-rgt-identityN/A
distribute-lft-out--N/A
associate-*l*N/A
distribute-lft-neg-outN/A
mul-1-negN/A
remove-double-negN/A
*-commutativeN/A
Applied rewrites100.0%
if +inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 0.0%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites72.7%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6472.7
Applied rewrites72.7%
Taylor expanded in x around 0
Applied rewrites72.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ t y) 2.0)))
(if (<= x -2.6e+181)
(fma t_1 b (- x (* (- y 1.0) z)))
(if (<= x 3.4e+53)
(fma (- 1.0 t) a (fma t_1 b (fma (- z) y z)))
(fma (- b a) t (+ (fma (- y 2.0) b x) a))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) - 2.0;
double tmp;
if (x <= -2.6e+181) {
tmp = fma(t_1, b, (x - ((y - 1.0) * z)));
} else if (x <= 3.4e+53) {
tmp = fma((1.0 - t), a, fma(t_1, b, fma(-z, y, z)));
} else {
tmp = fma((b - a), t, (fma((y - 2.0), b, x) + a));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) tmp = 0.0 if (x <= -2.6e+181) tmp = fma(t_1, b, Float64(x - Float64(Float64(y - 1.0) * z))); elseif (x <= 3.4e+53) tmp = fma(Float64(1.0 - t), a, fma(t_1, b, fma(Float64(-z), y, z))); else tmp = fma(Float64(b - a), t, Float64(fma(Float64(y - 2.0), b, x) + a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[x, -2.6e+181], N[(t$95$1 * b + N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.4e+53], N[(N[(1.0 - t), $MachinePrecision] * a + N[(t$95$1 * b + N[((-z) * y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * t + N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+181}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, x - \left(y - 1\right) \cdot z\right)\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+53}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(t\_1, b, \mathsf{fma}\left(-z, y, z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, x\right) + a\right)\\
\end{array}
\end{array}
if x < -2.6e181Initial program 99.9%
Taylor expanded in a around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6495.4
Applied rewrites95.4%
if -2.6e181 < x < 3.39999999999999998e53Initial program 95.0%
Taylor expanded in x around 0
associate--r+N/A
distribute-rgt-out--N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
distribute-lft-out--N/A
*-rgt-identityN/A
distribute-lft-out--N/A
associate-*l*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites95.3%
if 3.39999999999999998e53 < x Initial program 96.2%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites98.1%
Taylor expanded in z around 0
Applied rewrites91.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (fma (- t 2.0) b z) (+ a x))) (t_2 (* (- b z) y)))
(if (<= y -2.45e+42)
t_2
(if (<= y -1.45e-205)
t_1
(if (<= y 3.8e-259)
(+ (fma (- 1.0 t) a z) x)
(if (<= y 2.5e+110) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((t - 2.0), b, z) + (a + x);
double t_2 = (b - z) * y;
double tmp;
if (y <= -2.45e+42) {
tmp = t_2;
} else if (y <= -1.45e-205) {
tmp = t_1;
} else if (y <= 3.8e-259) {
tmp = fma((1.0 - t), a, z) + x;
} else if (y <= 2.5e+110) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(t - 2.0), b, z) + Float64(a + x)) t_2 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -2.45e+42) tmp = t_2; elseif (y <= -1.45e-205) tmp = t_1; elseif (y <= 3.8e-259) tmp = Float64(fma(Float64(1.0 - t), a, z) + x); elseif (y <= 2.5e+110) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - 2.0), $MachinePrecision] * b + z), $MachinePrecision] + N[(a + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.45e+42], t$95$2, If[LessEqual[y, -1.45e-205], t$95$1, If[LessEqual[y, 3.8e-259], N[(N[(N[(1.0 - t), $MachinePrecision] * a + z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 2.5e+110], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - 2, b, z\right) + \left(a + x\right)\\
t_2 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -2.45 \cdot 10^{+42}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-205}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-259}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, z\right) + x\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+110}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.4500000000000001e42 or 2.49999999999999989e110 < y Initial program 93.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6478.3
Applied rewrites78.3%
if -2.4500000000000001e42 < y < -1.45000000000000009e-205 or 3.8e-259 < y < 2.49999999999999989e110Initial program 97.4%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites86.0%
Taylor expanded in t around 0
Applied rewrites71.9%
if -1.45000000000000009e-205 < y < 3.8e-259Initial program 97.1%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites97.1%
Taylor expanded in b around 0
Applied rewrites91.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -3400000000000.0)
t_1
(if (<= y -5.5e-250)
(+ (fma -2.0 b x) z)
(if (<= y 9.8e-303)
(fma (- a) t a)
(if (<= y 8.5e-144)
(+ (+ a x) z)
(if (<= y 2.9e+18) (- x (* a t)) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -3400000000000.0) {
tmp = t_1;
} else if (y <= -5.5e-250) {
tmp = fma(-2.0, b, x) + z;
} else if (y <= 9.8e-303) {
tmp = fma(-a, t, a);
} else if (y <= 8.5e-144) {
tmp = (a + x) + z;
} else if (y <= 2.9e+18) {
tmp = x - (a * t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -3400000000000.0) tmp = t_1; elseif (y <= -5.5e-250) tmp = Float64(fma(-2.0, b, x) + z); elseif (y <= 9.8e-303) tmp = fma(Float64(-a), t, a); elseif (y <= 8.5e-144) tmp = Float64(Float64(a + x) + z); elseif (y <= 2.9e+18) tmp = Float64(x - Float64(a * t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -3400000000000.0], t$95$1, If[LessEqual[y, -5.5e-250], N[(N[(-2.0 * b + x), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[y, 9.8e-303], N[((-a) * t + a), $MachinePrecision], If[LessEqual[y, 8.5e-144], N[(N[(a + x), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[y, 2.9e+18], N[(x - N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -3400000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{-250}:\\
\;\;\;\;\mathsf{fma}\left(-2, b, x\right) + z\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-303}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, a\right)\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-144}:\\
\;\;\;\;\left(a + x\right) + z\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+18}:\\
\;\;\;\;x - a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.4e12 or 2.9e18 < y Initial program 94.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.2
Applied rewrites71.2%
if -3.4e12 < y < -5.5e-250Initial program 99.9%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites97.8%
Taylor expanded in a around 0
Applied rewrites66.8%
Taylor expanded in t around 0
Applied rewrites52.9%
if -5.5e-250 < y < 9.8e-303Initial program 90.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6473.0
Applied rewrites73.0%
Taylor expanded in t around 0
Applied rewrites20.2%
Taylor expanded in t around 0
Applied rewrites73.0%
if 9.8e-303 < y < 8.49999999999999958e-144Initial program 97.1%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites97.1%
Taylor expanded in a around 0
Applied rewrites72.3%
Taylor expanded in t around 0
Applied rewrites77.7%
Taylor expanded in b around 0
Applied rewrites71.3%
if 8.49999999999999958e-144 < y < 2.9e18Initial program 93.3%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6465.6
Applied rewrites65.6%
Taylor expanded in t around inf
Applied rewrites55.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (fma (- b z) y (fma -2.0 b x)) z)))
(if (<= y -1.2e-37)
t_1
(if (<= y 6e-194)
(fma (- t 2.0) b (fma (- 1.0 t) a z))
(if (<= y 0.034) (+ (fma (- t 2.0) b z) (+ a x)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((b - z), y, fma(-2.0, b, x)) + z;
double tmp;
if (y <= -1.2e-37) {
tmp = t_1;
} else if (y <= 6e-194) {
tmp = fma((t - 2.0), b, fma((1.0 - t), a, z));
} else if (y <= 0.034) {
tmp = fma((t - 2.0), b, z) + (a + x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(b - z), y, fma(-2.0, b, x)) + z) tmp = 0.0 if (y <= -1.2e-37) tmp = t_1; elseif (y <= 6e-194) tmp = fma(Float64(t - 2.0), b, fma(Float64(1.0 - t), a, z)); elseif (y <= 0.034) tmp = Float64(fma(Float64(t - 2.0), b, z) + Float64(a + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(b - z), $MachinePrecision] * y + N[(-2.0 * b + x), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]}, If[LessEqual[y, -1.2e-37], t$95$1, If[LessEqual[y, 6e-194], N[(N[(t - 2.0), $MachinePrecision] * b + N[(N[(1.0 - t), $MachinePrecision] * a + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.034], N[(N[(N[(t - 2.0), $MachinePrecision] * b + z), $MachinePrecision] + N[(a + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - z, y, \mathsf{fma}\left(-2, b, x\right)\right) + z\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-194}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, \mathsf{fma}\left(1 - t, a, z\right)\right)\\
\mathbf{elif}\;y \leq 0.034:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, z\right) + \left(a + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.19999999999999995e-37 or 0.034000000000000002 < y Initial program 95.1%
Taylor expanded in a around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6482.1
Applied rewrites82.1%
Taylor expanded in y around 0
Applied rewrites82.1%
Taylor expanded in t around 0
Applied rewrites80.6%
if -1.19999999999999995e-37 < y < 6e-194Initial program 97.3%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites97.3%
Taylor expanded in x around 0
Applied rewrites90.3%
if 6e-194 < y < 0.034000000000000002Initial program 94.7%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites94.7%
Taylor expanded in t around 0
Applied rewrites87.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -8.8e+136) (not (<= b 0.0042))) (fma (- b a) t (+ (fma (- y 2.0) b x) a)) (- x (fma a (- t 1.0) (* z (- y 1.0))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -8.8e+136) || !(b <= 0.0042)) {
tmp = fma((b - a), t, (fma((y - 2.0), b, x) + a));
} else {
tmp = x - fma(a, (t - 1.0), (z * (y - 1.0)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -8.8e+136) || !(b <= 0.0042)) tmp = fma(Float64(b - a), t, Float64(fma(Float64(y - 2.0), b, x) + a)); else tmp = Float64(x - fma(a, Float64(t - 1.0), Float64(z * Float64(y - 1.0)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -8.8e+136], N[Not[LessEqual[b, 0.0042]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t + N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(t - 1.0), $MachinePrecision] + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.8 \cdot 10^{+136} \lor \neg \left(b \leq 0.0042\right):\\
\;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, x\right) + a\right)\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(a, t - 1, z \cdot \left(y - 1\right)\right)\\
\end{array}
\end{array}
if b < -8.7999999999999998e136 or 0.00419999999999999974 < b Initial program 92.0%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites97.0%
Taylor expanded in z around 0
Applied rewrites91.2%
if -8.7999999999999998e136 < b < 0.00419999999999999974Initial program 98.0%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6493.1
Applied rewrites93.1%
Final simplification92.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -8.8e+136)
(+ (fma (- b z) y (fma (- t 2.0) b x)) z)
(if (<= b 0.0042)
(- x (fma a (- t 1.0) (* z (- y 1.0))))
(fma (- 1.0 t) a (fma (- (+ t y) 2.0) b x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.8e+136) {
tmp = fma((b - z), y, fma((t - 2.0), b, x)) + z;
} else if (b <= 0.0042) {
tmp = x - fma(a, (t - 1.0), (z * (y - 1.0)));
} else {
tmp = fma((1.0 - t), a, fma(((t + y) - 2.0), b, x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -8.8e+136) tmp = Float64(fma(Float64(b - z), y, fma(Float64(t - 2.0), b, x)) + z); elseif (b <= 0.0042) tmp = Float64(x - fma(a, Float64(t - 1.0), Float64(z * Float64(y - 1.0)))); else tmp = fma(Float64(1.0 - t), a, fma(Float64(Float64(t + y) - 2.0), b, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -8.8e+136], N[(N[(N[(b - z), $MachinePrecision] * y + N[(N[(t - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[b, 0.0042], N[(x - N[(a * N[(t - 1.0), $MachinePrecision] + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.8 \cdot 10^{+136}:\\
\;\;\;\;\mathsf{fma}\left(b - z, y, \mathsf{fma}\left(t - 2, b, x\right)\right) + z\\
\mathbf{elif}\;b \leq 0.0042:\\
\;\;\;\;x - \mathsf{fma}\left(a, t - 1, z \cdot \left(y - 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\
\end{array}
\end{array}
if b < -8.7999999999999998e136Initial program 92.8%
Taylor expanded in a around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6492.8
Applied rewrites92.8%
Taylor expanded in y around 0
Applied rewrites96.4%
if -8.7999999999999998e136 < b < 0.00419999999999999974Initial program 98.0%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6493.1
Applied rewrites93.1%
if 0.00419999999999999974 < b Initial program 91.6%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
associate-+l-N/A
distribute-rgt-out--N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
distribute-lft-out--N/A
*-rgt-identityN/A
distribute-lft-out--N/A
associate-*l*N/A
mul-1-negN/A
Applied rewrites86.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -42000000000.0)
t_1
(if (<= y -2.3e-233)
(fma (- t 2.0) b z)
(if (<= y 8.5e-144)
(+ (+ a x) z)
(if (<= y 2.9e+18) (- x (* a t)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -42000000000.0) {
tmp = t_1;
} else if (y <= -2.3e-233) {
tmp = fma((t - 2.0), b, z);
} else if (y <= 8.5e-144) {
tmp = (a + x) + z;
} else if (y <= 2.9e+18) {
tmp = x - (a * t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -42000000000.0) tmp = t_1; elseif (y <= -2.3e-233) tmp = fma(Float64(t - 2.0), b, z); elseif (y <= 8.5e-144) tmp = Float64(Float64(a + x) + z); elseif (y <= 2.9e+18) tmp = Float64(x - Float64(a * t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -42000000000.0], t$95$1, If[LessEqual[y, -2.3e-233], N[(N[(t - 2.0), $MachinePrecision] * b + z), $MachinePrecision], If[LessEqual[y, 8.5e-144], N[(N[(a + x), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[y, 2.9e+18], N[(x - N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -42000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{-233}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, z\right)\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-144}:\\
\;\;\;\;\left(a + x\right) + z\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+18}:\\
\;\;\;\;x - a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.2e10 or 2.9e18 < y Initial program 94.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.2
Applied rewrites71.2%
if -4.2e10 < y < -2.3000000000000002e-233Initial program 99.9%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites97.7%
Taylor expanded in a around 0
Applied rewrites65.5%
Taylor expanded in x around 0
Applied rewrites52.3%
if -2.3000000000000002e-233 < y < 8.49999999999999958e-144Initial program 95.8%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites95.8%
Taylor expanded in a around 0
Applied rewrites63.8%
Taylor expanded in t around 0
Applied rewrites69.5%
Taylor expanded in b around 0
Applied rewrites62.9%
if 8.49999999999999958e-144 < y < 2.9e18Initial program 93.3%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6465.6
Applied rewrites65.6%
Taylor expanded in t around inf
Applied rewrites55.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -8.8e+136)
(+ (fma (- b z) y (fma (- t 2.0) b x)) z)
(if (<= b 0.0175)
(- x (fma a (- t 1.0) (* z (- y 1.0))))
(fma (- b a) t (fma (- y 2.0) b a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.8e+136) {
tmp = fma((b - z), y, fma((t - 2.0), b, x)) + z;
} else if (b <= 0.0175) {
tmp = x - fma(a, (t - 1.0), (z * (y - 1.0)));
} else {
tmp = fma((b - a), t, fma((y - 2.0), b, a));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -8.8e+136) tmp = Float64(fma(Float64(b - z), y, fma(Float64(t - 2.0), b, x)) + z); elseif (b <= 0.0175) tmp = Float64(x - fma(a, Float64(t - 1.0), Float64(z * Float64(y - 1.0)))); else tmp = fma(Float64(b - a), t, fma(Float64(y - 2.0), b, a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -8.8e+136], N[(N[(N[(b - z), $MachinePrecision] * y + N[(N[(t - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[b, 0.0175], N[(x - N[(a * N[(t - 1.0), $MachinePrecision] + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b + a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.8 \cdot 10^{+136}:\\
\;\;\;\;\mathsf{fma}\left(b - z, y, \mathsf{fma}\left(t - 2, b, x\right)\right) + z\\
\mathbf{elif}\;b \leq 0.0175:\\
\;\;\;\;x - \mathsf{fma}\left(a, t - 1, z \cdot \left(y - 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, a\right)\right)\\
\end{array}
\end{array}
if b < -8.7999999999999998e136Initial program 92.8%
Taylor expanded in a around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6492.8
Applied rewrites92.8%
Taylor expanded in y around 0
Applied rewrites96.4%
if -8.7999999999999998e136 < b < 0.017500000000000002Initial program 98.0%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6493.1
Applied rewrites93.1%
if 0.017500000000000002 < b Initial program 91.6%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites97.2%
Taylor expanded in z around 0
Applied rewrites89.1%
Taylor expanded in x around 0
Applied rewrites84.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -2.05e+180)
(fma (- b a) t (* (- y 2.0) b))
(if (<= b 0.0175)
(- x (fma a (- t 1.0) (* z (- y 1.0))))
(fma (- b a) t (fma (- y 2.0) b a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.05e+180) {
tmp = fma((b - a), t, ((y - 2.0) * b));
} else if (b <= 0.0175) {
tmp = x - fma(a, (t - 1.0), (z * (y - 1.0)));
} else {
tmp = fma((b - a), t, fma((y - 2.0), b, a));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.05e+180) tmp = fma(Float64(b - a), t, Float64(Float64(y - 2.0) * b)); elseif (b <= 0.0175) tmp = Float64(x - fma(a, Float64(t - 1.0), Float64(z * Float64(y - 1.0)))); else tmp = fma(Float64(b - a), t, fma(Float64(y - 2.0), b, a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.05e+180], N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.0175], N[(x - N[(a * N[(t - 1.0), $MachinePrecision] + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b + a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.05 \cdot 10^{+180}:\\
\;\;\;\;\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right)\\
\mathbf{elif}\;b \leq 0.0175:\\
\;\;\;\;x - \mathsf{fma}\left(a, t - 1, z \cdot \left(y - 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, a\right)\right)\\
\end{array}
\end{array}
if b < -2.05e180Initial program 90.8%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites95.5%
Taylor expanded in b around inf
Applied rewrites91.7%
if -2.05e180 < b < 0.017500000000000002Initial program 98.1%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6492.2
Applied rewrites92.2%
if 0.017500000000000002 < b Initial program 91.6%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites97.2%
Taylor expanded in z around 0
Applied rewrites89.1%
Taylor expanded in x around 0
Applied rewrites84.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -9.6e+58)
(* (- b a) t)
(if (<= t 2.45e+16)
(+ (fma (- b z) y (fma -2.0 b x)) z)
(fma (- b a) t (* (- y 2.0) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -9.6e+58) {
tmp = (b - a) * t;
} else if (t <= 2.45e+16) {
tmp = fma((b - z), y, fma(-2.0, b, x)) + z;
} else {
tmp = fma((b - a), t, ((y - 2.0) * b));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -9.6e+58) tmp = Float64(Float64(b - a) * t); elseif (t <= 2.45e+16) tmp = Float64(fma(Float64(b - z), y, fma(-2.0, b, x)) + z); else tmp = fma(Float64(b - a), t, Float64(Float64(y - 2.0) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -9.6e+58], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, 2.45e+16], N[(N[(N[(b - z), $MachinePrecision] * y + N[(-2.0 * b + x), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.6 \cdot 10^{+58}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;t \leq 2.45 \cdot 10^{+16}:\\
\;\;\;\;\mathsf{fma}\left(b - z, y, \mathsf{fma}\left(-2, b, x\right)\right) + z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right)\\
\end{array}
\end{array}
if t < -9.5999999999999999e58Initial program 89.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6477.8
Applied rewrites77.8%
if -9.5999999999999999e58 < t < 2.45e16Initial program 97.9%
Taylor expanded in a around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6484.5
Applied rewrites84.5%
Taylor expanded in y around 0
Applied rewrites85.9%
Taylor expanded in t around 0
Applied rewrites85.2%
if 2.45e16 < t Initial program 95.1%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in b around inf
Applied rewrites69.2%
(FPCore (x y z t a b) :precision binary64 (fma (- b z) y (+ (fma (- t 2.0) b z) (fma (- 1.0 t) a x))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((b - z), y, (fma((t - 2.0), b, z) + fma((1.0 - t), a, x)));
}
function code(x, y, z, t, a, b) return fma(Float64(b - z), y, Float64(fma(Float64(t - 2.0), b, z) + fma(Float64(1.0 - t), a, x))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(b - z), $MachinePrecision] * y + N[(N[(N[(t - 2.0), $MachinePrecision] * b + z), $MachinePrecision] + N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(b - z, y, \mathsf{fma}\left(t - 2, b, z\right) + \mathsf{fma}\left(1 - t, a, x\right)\right)
\end{array}
Initial program 95.7%
Taylor expanded in y around 0
Applied rewrites97.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -4.2e+41)
t_1
(if (<= y 8.5e-144)
(+ (+ a x) z)
(if (<= y 2.9e+18) (- x (* a t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -4.2e+41) {
tmp = t_1;
} else if (y <= 8.5e-144) {
tmp = (a + x) + z;
} else if (y <= 2.9e+18) {
tmp = x - (a * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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 = (b - z) * y
if (y <= (-4.2d+41)) then
tmp = t_1
else if (y <= 8.5d-144) then
tmp = (a + x) + z
else if (y <= 2.9d+18) then
tmp = x - (a * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -4.2e+41) {
tmp = t_1;
} else if (y <= 8.5e-144) {
tmp = (a + x) + z;
} else if (y <= 2.9e+18) {
tmp = x - (a * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y tmp = 0 if y <= -4.2e+41: tmp = t_1 elif y <= 8.5e-144: tmp = (a + x) + z elif y <= 2.9e+18: tmp = x - (a * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -4.2e+41) tmp = t_1; elseif (y <= 8.5e-144) tmp = Float64(Float64(a + x) + z); elseif (y <= 2.9e+18) tmp = Float64(x - Float64(a * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; tmp = 0.0; if (y <= -4.2e+41) tmp = t_1; elseif (y <= 8.5e-144) tmp = (a + x) + z; elseif (y <= 2.9e+18) tmp = x - (a * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -4.2e+41], t$95$1, If[LessEqual[y, 8.5e-144], N[(N[(a + x), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[y, 2.9e+18], N[(x - N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-144}:\\
\;\;\;\;\left(a + x\right) + z\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+18}:\\
\;\;\;\;x - a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.1999999999999999e41 or 2.9e18 < y Initial program 94.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6472.4
Applied rewrites72.4%
if -4.1999999999999999e41 < y < 8.49999999999999958e-144Initial program 97.9%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites95.1%
Taylor expanded in a around 0
Applied rewrites61.7%
Taylor expanded in t around 0
Applied rewrites63.1%
Taylor expanded in b around 0
Applied rewrites51.2%
if 8.49999999999999958e-144 < y < 2.9e18Initial program 93.3%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6465.6
Applied rewrites65.6%
Taylor expanded in t around inf
Applied rewrites55.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -4.2e+41)
t_1
(if (<= y 1.7e-144)
(+ (+ a x) z)
(if (<= y 2.05e+18) (* (- b a) t) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -4.2e+41) {
tmp = t_1;
} else if (y <= 1.7e-144) {
tmp = (a + x) + z;
} else if (y <= 2.05e+18) {
tmp = (b - a) * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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 = (b - z) * y
if (y <= (-4.2d+41)) then
tmp = t_1
else if (y <= 1.7d-144) then
tmp = (a + x) + z
else if (y <= 2.05d+18) then
tmp = (b - a) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -4.2e+41) {
tmp = t_1;
} else if (y <= 1.7e-144) {
tmp = (a + x) + z;
} else if (y <= 2.05e+18) {
tmp = (b - a) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y tmp = 0 if y <= -4.2e+41: tmp = t_1 elif y <= 1.7e-144: tmp = (a + x) + z elif y <= 2.05e+18: tmp = (b - a) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -4.2e+41) tmp = t_1; elseif (y <= 1.7e-144) tmp = Float64(Float64(a + x) + z); elseif (y <= 2.05e+18) tmp = Float64(Float64(b - a) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; tmp = 0.0; if (y <= -4.2e+41) tmp = t_1; elseif (y <= 1.7e-144) tmp = (a + x) + z; elseif (y <= 2.05e+18) tmp = (b - a) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -4.2e+41], t$95$1, If[LessEqual[y, 1.7e-144], N[(N[(a + x), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[y, 2.05e+18], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-144}:\\
\;\;\;\;\left(a + x\right) + z\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+18}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.1999999999999999e41 or 2.05e18 < y Initial program 94.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6472.4
Applied rewrites72.4%
if -4.1999999999999999e41 < y < 1.70000000000000009e-144Initial program 97.9%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites95.1%
Taylor expanded in a around 0
Applied rewrites61.7%
Taylor expanded in t around 0
Applied rewrites63.1%
Taylor expanded in b around 0
Applied rewrites51.2%
if 1.70000000000000009e-144 < y < 2.05e18Initial program 93.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6451.2
Applied rewrites51.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.45e+42) (not (<= y 1.6e+140))) (* (- b z) y) (+ (fma (- 1.0 t) a z) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.45e+42) || !(y <= 1.6e+140)) {
tmp = (b - z) * y;
} else {
tmp = fma((1.0 - t), a, z) + x;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.45e+42) || !(y <= 1.6e+140)) tmp = Float64(Float64(b - z) * y); else tmp = Float64(fma(Float64(1.0 - t), a, z) + x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.45e+42], N[Not[LessEqual[y, 1.6e+140]], $MachinePrecision]], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(1.0 - t), $MachinePrecision] * a + z), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.45 \cdot 10^{+42} \lor \neg \left(y \leq 1.6 \cdot 10^{+140}\right):\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, z\right) + x\\
\end{array}
\end{array}
if y < -2.4500000000000001e42 or 1.60000000000000005e140 < y Initial program 92.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6481.4
Applied rewrites81.4%
if -2.4500000000000001e42 < y < 1.60000000000000005e140Initial program 97.5%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites86.7%
Taylor expanded in b around 0
Applied rewrites68.0%
Final simplification72.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.2e+41) (not (<= y 40000.0))) (* (- b z) y) (+ (+ (fma -2.0 b z) x) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.2e+41) || !(y <= 40000.0)) {
tmp = (b - z) * y;
} else {
tmp = (fma(-2.0, b, z) + x) + a;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.2e+41) || !(y <= 40000.0)) tmp = Float64(Float64(b - z) * y); else tmp = Float64(Float64(fma(-2.0, b, z) + x) + a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.2e+41], N[Not[LessEqual[y, 40000.0]], $MachinePrecision]], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(-2.0 * b + z), $MachinePrecision] + x), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+41} \lor \neg \left(y \leq 40000\right):\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(-2, b, z\right) + x\right) + a\\
\end{array}
\end{array}
if y < -4.1999999999999999e41 or 4e4 < y Initial program 94.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6470.7
Applied rewrites70.7%
if -4.1999999999999999e41 < y < 4e4Initial program 96.8%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites94.5%
Taylor expanded in t around 0
Applied rewrites61.1%
Final simplification65.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.4e+78) (not (<= b 0.0175))) (* (- (+ t y) 2.0) b) (fma (- z) (- y 1.0) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.4e+78) || !(b <= 0.0175)) {
tmp = ((t + y) - 2.0) * b;
} else {
tmp = fma(-z, (y - 1.0), x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.4e+78) || !(b <= 0.0175)) tmp = Float64(Float64(Float64(t + y) - 2.0) * b); else tmp = fma(Float64(-z), Float64(y - 1.0), x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.4e+78], N[Not[LessEqual[b, 0.0175]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision], N[((-z) * N[(y - 1.0), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.4 \cdot 10^{+78} \lor \neg \left(b \leq 0.0175\right):\\
\;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-z, y - 1, x\right)\\
\end{array}
\end{array}
if b < -5.40000000000000009e78 or 0.017500000000000002 < b Initial program 91.9%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites97.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6470.8
Applied rewrites70.8%
if -5.40000000000000009e78 < b < 0.017500000000000002Initial program 98.6%
Taylor expanded in a around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6466.9
Applied rewrites66.9%
Taylor expanded in b around 0
Applied rewrites60.2%
Final simplification64.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.7e+55) (not (<= t 2e+16))) (* (- b a) t) (+ (+ a x) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.7e+55) || !(t <= 2e+16)) {
tmp = (b - a) * t;
} else {
tmp = (a + x) + z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((t <= (-1.7d+55)) .or. (.not. (t <= 2d+16))) then
tmp = (b - a) * t
else
tmp = (a + x) + z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.7e+55) || !(t <= 2e+16)) {
tmp = (b - a) * t;
} else {
tmp = (a + x) + z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.7e+55) or not (t <= 2e+16): tmp = (b - a) * t else: tmp = (a + x) + z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.7e+55) || !(t <= 2e+16)) tmp = Float64(Float64(b - a) * t); else tmp = Float64(Float64(a + x) + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.7e+55) || ~((t <= 2e+16))) tmp = (b - a) * t; else tmp = (a + x) + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.7e+55], N[Not[LessEqual[t, 2e+16]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], N[(N[(a + x), $MachinePrecision] + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+55} \lor \neg \left(t \leq 2 \cdot 10^{+16}\right):\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(a + x\right) + z\\
\end{array}
\end{array}
if t < -1.6999999999999999e55 or 2e16 < t Initial program 92.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6466.7
Applied rewrites66.7%
if -1.6999999999999999e55 < t < 2e16Initial program 97.9%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites56.5%
Taylor expanded in a around 0
Applied rewrites42.7%
Taylor expanded in t around 0
Applied rewrites54.7%
Taylor expanded in b around 0
Applied rewrites43.7%
Final simplification53.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.4e+52) (not (<= a 8e+45))) (fma (- a) t a) (* (- 1.0 y) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.4e+52) || !(a <= 8e+45)) {
tmp = fma(-a, t, a);
} else {
tmp = (1.0 - y) * z;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.4e+52) || !(a <= 8e+45)) tmp = fma(Float64(-a), t, a); else tmp = Float64(Float64(1.0 - y) * z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.4e+52], N[Not[LessEqual[a, 8e+45]], $MachinePrecision]], N[((-a) * t + a), $MachinePrecision], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.4 \cdot 10^{+52} \lor \neg \left(a \leq 8 \cdot 10^{+45}\right):\\
\;\;\;\;\mathsf{fma}\left(-a, t, a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\end{array}
\end{array}
if a < -3.4e52 or 7.9999999999999994e45 < a Initial program 90.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6457.2
Applied rewrites57.2%
Taylor expanded in t around 0
Applied rewrites18.8%
Taylor expanded in t around 0
Applied rewrites57.2%
if -3.4e52 < a < 7.9999999999999994e45Initial program 99.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6441.5
Applied rewrites41.5%
Final simplification48.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.9e+146) (not (<= y 6.8e+184))) (* (- z) y) (+ (+ a x) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.9e+146) || !(y <= 6.8e+184)) {
tmp = -z * y;
} else {
tmp = (a + x) + z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((y <= (-1.9d+146)) .or. (.not. (y <= 6.8d+184))) then
tmp = -z * y
else
tmp = (a + x) + z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.9e+146) || !(y <= 6.8e+184)) {
tmp = -z * y;
} else {
tmp = (a + x) + z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.9e+146) or not (y <= 6.8e+184): tmp = -z * y else: tmp = (a + x) + z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.9e+146) || !(y <= 6.8e+184)) tmp = Float64(Float64(-z) * y); else tmp = Float64(Float64(a + x) + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.9e+146) || ~((y <= 6.8e+184))) tmp = -z * y; else tmp = (a + x) + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.9e+146], N[Not[LessEqual[y, 6.8e+184]], $MachinePrecision]], N[((-z) * y), $MachinePrecision], N[(N[(a + x), $MachinePrecision] + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+146} \lor \neg \left(y \leq 6.8 \cdot 10^{+184}\right):\\
\;\;\;\;\left(-z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(a + x\right) + z\\
\end{array}
\end{array}
if y < -1.8999999999999999e146 or 6.8000000000000003e184 < y Initial program 92.0%
Taylor expanded in a around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6485.7
Applied rewrites85.7%
Taylor expanded in b around 0
Applied rewrites59.8%
Taylor expanded in y around inf
Applied rewrites55.8%
if -1.8999999999999999e146 < y < 6.8000000000000003e184Initial program 97.2%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites81.9%
Taylor expanded in a around 0
Applied rewrites54.6%
Taylor expanded in t around 0
Applied rewrites51.4%
Taylor expanded in b around 0
Applied rewrites42.4%
Final simplification46.4%
(FPCore (x y z t a b) :precision binary64 (+ z x))
double code(double x, double y, double z, double t, double a, double b) {
return z + x;
}
real(8) function code(x, y, z, t, a, b)
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 = z + x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z + x;
}
def code(x, y, z, t, a, b): return z + x
function code(x, y, z, t, a, b) return Float64(z + x) end
function tmp = code(x, y, z, t, a, b) tmp = z + x; end
code[x_, y_, z_, t_, a_, b_] := N[(z + x), $MachinePrecision]
\begin{array}{l}
\\
z + x
\end{array}
Initial program 95.7%
Taylor expanded in a around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6474.3
Applied rewrites74.3%
Taylor expanded in b around 0
Applied rewrites44.3%
Taylor expanded in y around 0
Applied rewrites24.6%
herbie shell --seed 2024320
(FPCore (x y z t a b)
:name "Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2"
:precision binary64
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))