
(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 17 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
(let* ((t_1
(+ (* b (- (+ t y) 2.0)) (- (- x (* z (- y 1.0))) (* a (- t 1.0))))))
(if (<= t_1 INFINITY) t_1 (* (- b z) y))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (b - z) * y;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (b - z) * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (b - z) * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b * Float64(Float64(t + y) - 2.0)) + Float64(Float64(x - Float64(z * Float64(y - 1.0))) - Float64(a * Float64(t - 1.0)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(b - z) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (b - z) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(\left(t + y\right) - 2\right) + \left(\left(x - z \cdot \left(y - 1\right)\right) - a \cdot \left(t - 1\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\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%
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 y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.5
Applied rewrites71.5%
Final simplification99.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+ (* b (- (+ t y) 2.0)) (- (- x (* z (- y 1.0))) (* a (- t 1.0))))))
(if (<= t_1 (- INFINITY))
(* (- a) t)
(if (<= t_1 1e+302) (+ (+ a x) z) (* (- 1.0 t) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = -a * t;
} else if (t_1 <= 1e+302) {
tmp = (a + x) + z;
} else {
tmp = (1.0 - t) * a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = -a * t;
} else if (t_1 <= 1e+302) {
tmp = (a + x) + z;
} else {
tmp = (1.0 - t) * a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0))) tmp = 0 if t_1 <= -math.inf: tmp = -a * t elif t_1 <= 1e+302: tmp = (a + x) + z else: tmp = (1.0 - t) * a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b * Float64(Float64(t + y) - 2.0)) + Float64(Float64(x - Float64(z * Float64(y - 1.0))) - Float64(a * Float64(t - 1.0)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(-a) * t); elseif (t_1 <= 1e+302) tmp = Float64(Float64(a + x) + z); else tmp = Float64(Float64(1.0 - t) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0))); tmp = 0.0; if (t_1 <= -Inf) tmp = -a * t; elseif (t_1 <= 1e+302) tmp = (a + x) + z; else tmp = (1.0 - t) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[((-a) * t), $MachinePrecision], If[LessEqual[t$95$1, 1e+302], N[(N[(a + x), $MachinePrecision] + z), $MachinePrecision], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(\left(t + y\right) - 2\right) + \left(\left(x - z \cdot \left(y - 1\right)\right) - a \cdot \left(t - 1\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(-a\right) \cdot t\\
\mathbf{elif}\;t\_1 \leq 10^{+302}:\\
\;\;\;\;\left(a + x\right) + z\\
\mathbf{else}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\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 t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.4
Applied rewrites69.4%
Taylor expanded in b around 0
Applied rewrites49.5%
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)) < 1.0000000000000001e302Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites84.4%
Taylor expanded in b around 0
Applied rewrites68.9%
Taylor expanded in t around 0
Applied rewrites60.0%
if 1.0000000000000001e302 < (+.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 87.9%
Taylor expanded in a around inf
*-commutativeN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f6432.6
Applied rewrites32.6%
Final simplification52.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+ (* b (- (+ t y) 2.0)) (- (- x (* z (- y 1.0))) (* a (- t 1.0)))))
(t_2 (* (- a) t)))
(if (<= t_1 (- INFINITY)) t_2 (if (<= t_1 1e+302) (+ (+ a x) z) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0)));
double t_2 = -a * t;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 1e+302) {
tmp = (a + x) + z;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0)));
double t_2 = -a * t;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= 1e+302) {
tmp = (a + x) + z;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0))) t_2 = -a * t tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 1e+302: tmp = (a + x) + z else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b * Float64(Float64(t + y) - 2.0)) + Float64(Float64(x - Float64(z * Float64(y - 1.0))) - Float64(a * Float64(t - 1.0)))) t_2 = Float64(Float64(-a) * t) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 1e+302) tmp = Float64(Float64(a + x) + z); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0))); t_2 = -a * t; tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 1e+302) tmp = (a + x) + z; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-a) * t), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 1e+302], N[(N[(a + x), $MachinePrecision] + z), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(\left(t + y\right) - 2\right) + \left(\left(x - z \cdot \left(y - 1\right)\right) - a \cdot \left(t - 1\right)\right)\\
t_2 := \left(-a\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+302}:\\
\;\;\;\;\left(a + x\right) + z\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\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 1.0000000000000001e302 < (+.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 91.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6460.2
Applied rewrites60.2%
Taylor expanded in b around 0
Applied rewrites37.6%
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)) < 1.0000000000000001e302Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites84.4%
Taylor expanded in b around 0
Applied rewrites68.9%
Taylor expanded in t around 0
Applied rewrites60.0%
Final simplification52.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+ (* b (- (+ t y) 2.0)) (- (- x (* z (- y 1.0))) (* a (- t 1.0))))))
(if (<= t_1 (- INFINITY))
(* b t)
(if (<= t_1 1e+305) (+ (+ a x) z) (* b t)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = b * t;
} else if (t_1 <= 1e+305) {
tmp = (a + x) + z;
} else {
tmp = b * t;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = b * t;
} else if (t_1 <= 1e+305) {
tmp = (a + x) + z;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0))) tmp = 0 if t_1 <= -math.inf: tmp = b * t elif t_1 <= 1e+305: tmp = (a + x) + z else: tmp = b * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b * Float64(Float64(t + y) - 2.0)) + Float64(Float64(x - Float64(z * Float64(y - 1.0))) - Float64(a * Float64(t - 1.0)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(b * t); elseif (t_1 <= 1e+305) tmp = Float64(Float64(a + x) + z); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b * ((t + y) - 2.0)) + ((x - (z * (y - 1.0))) - (a * (t - 1.0))); tmp = 0.0; if (t_1 <= -Inf) tmp = b * t; elseif (t_1 <= 1e+305) tmp = (a + x) + z; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(b * t), $MachinePrecision], If[LessEqual[t$95$1, 1e+305], N[(N[(a + x), $MachinePrecision] + z), $MachinePrecision], N[(b * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(\left(t + y\right) - 2\right) + \left(\left(x - z \cdot \left(y - 1\right)\right) - a \cdot \left(t - 1\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t\_1 \leq 10^{+305}:\\
\;\;\;\;\left(a + x\right) + z\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\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 9.9999999999999994e304 < (+.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 91.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6445.7
Applied rewrites45.7%
Taylor expanded in t around inf
Applied rewrites28.9%
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)) < 9.9999999999999994e304Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites84.6%
Taylor expanded in b around 0
Applied rewrites69.2%
Taylor expanded in t around 0
Applied rewrites59.3%
Final simplification49.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 t) a x)) (t_2 (* b (- (+ t y) 2.0))))
(if (<= b -7.5e+40)
t_2
(if (<= b -4.5e-185)
t_1
(if (<= b -1.2e-246)
(fma (- 1.0 y) z x)
(if (<= b 3.1e+84) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - t), a, x);
double t_2 = b * ((t + y) - 2.0);
double tmp;
if (b <= -7.5e+40) {
tmp = t_2;
} else if (b <= -4.5e-185) {
tmp = t_1;
} else if (b <= -1.2e-246) {
tmp = fma((1.0 - y), z, x);
} else if (b <= 3.1e+84) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - t), a, x) t_2 = Float64(b * Float64(Float64(t + y) - 2.0)) tmp = 0.0 if (b <= -7.5e+40) tmp = t_2; elseif (b <= -4.5e-185) tmp = t_1; elseif (b <= -1.2e-246) tmp = fma(Float64(1.0 - y), z, x); elseif (b <= 3.1e+84) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -7.5e+40], t$95$2, If[LessEqual[b, -4.5e-185], t$95$1, If[LessEqual[b, -1.2e-246], N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[b, 3.1e+84], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - t, a, x\right)\\
t_2 := b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{if}\;b \leq -7.5 \cdot 10^{+40}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -4.5 \cdot 10^{-185}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.2 \cdot 10^{-246}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, x\right)\\
\mathbf{elif}\;b \leq 3.1 \cdot 10^{+84}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -7.4999999999999996e40 or 3.10000000000000003e84 < b Initial program 94.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6470.3
Applied rewrites70.3%
if -7.4999999999999996e40 < b < -4.5000000000000001e-185 or -1.1999999999999999e-246 < b < 3.10000000000000003e84Initial program 99.3%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites84.7%
Taylor expanded in b around 0
Applied rewrites79.0%
Taylor expanded in z around 0
Applied rewrites64.3%
if -4.5000000000000001e-185 < b < -1.1999999999999999e-246Initial program 95.2%
Taylor expanded in b around 0
+-commutativeN/A
associate--r+N/A
sub-negN/A
+-commutativeN/A
associate-+r-N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites95.2%
Taylor expanded in a around 0
Applied rewrites81.9%
Final simplification67.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -1.05e+32)
t_1
(if (<= t -225000.0)
(* (- 1.0 y) z)
(if (<= t 3.2e-78)
(fma (- y 2.0) b (+ a x))
(if (<= t 4.2e+115) (fma (- 1.0 y) z x) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -1.05e+32) {
tmp = t_1;
} else if (t <= -225000.0) {
tmp = (1.0 - y) * z;
} else if (t <= 3.2e-78) {
tmp = fma((y - 2.0), b, (a + x));
} else if (t <= 4.2e+115) {
tmp = fma((1.0 - y), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -1.05e+32) tmp = t_1; elseif (t <= -225000.0) tmp = Float64(Float64(1.0 - y) * z); elseif (t <= 3.2e-78) tmp = fma(Float64(y - 2.0), b, Float64(a + x)); elseif (t <= 4.2e+115) tmp = fma(Float64(1.0 - y), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.05e+32], t$95$1, If[LessEqual[t, -225000.0], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 3.2e-78], N[(N[(y - 2.0), $MachinePrecision] * b + N[(a + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e+115], N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -225000:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-78}:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, a + x\right)\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+115}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.05e32 or 4.20000000000000007e115 < t Initial program 96.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6474.4
Applied rewrites74.4%
if -1.05e32 < t < -225000Initial program 99.8%
Taylor expanded in z around inf
*-commutativeN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f6486.3
Applied rewrites86.3%
if -225000 < t < 3.2e-78Initial program 97.3%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
associate-+l+N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
Applied rewrites98.2%
Taylor expanded in z around 0
Applied rewrites73.6%
if 3.2e-78 < t < 4.20000000000000007e115Initial program 97.6%
Taylor expanded in b around 0
+-commutativeN/A
associate--r+N/A
sub-negN/A
+-commutativeN/A
associate-+r-N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites76.1%
Taylor expanded in a around 0
Applied rewrites64.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 y) z (+ (fma (- y 2.0) b x) a))))
(if (<= y -3.1e+120)
t_1
(if (<= y 7.5e+72) (fma (- t 2.0) b (+ (fma (- 1.0 t) a x) z)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - y), z, (fma((y - 2.0), b, x) + a));
double tmp;
if (y <= -3.1e+120) {
tmp = t_1;
} else if (y <= 7.5e+72) {
tmp = fma((t - 2.0), b, (fma((1.0 - t), a, x) + z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - y), z, Float64(fma(Float64(y - 2.0), b, x) + a)) tmp = 0.0 if (y <= -3.1e+120) tmp = t_1; elseif (y <= 7.5e+72) tmp = fma(Float64(t - 2.0), b, Float64(fma(Float64(1.0 - t), a, x) + z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z + N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e+120], t$95$1, If[LessEqual[y, 7.5e+72], N[(N[(t - 2.0), $MachinePrecision] * b + N[(N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(y - 2, b, x\right) + a\right)\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+72}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, \mathsf{fma}\left(1 - t, a, x\right) + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.09999999999999974e120 or 7.50000000000000027e72 < y Initial program 92.5%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
associate-+l+N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
Applied rewrites85.5%
if -3.09999999999999974e120 < y < 7.50000000000000027e72Initial program 99.4%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites95.7%
Final simplification92.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -3.4e+27)
(fma (- 1.0 y) z (fma (- 1.0 t) a x))
(if (<= t 7.2e+114)
(fma (- 1.0 y) z (+ (fma (- y 2.0) b x) a))
(fma t b (* (- a) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.4e+27) {
tmp = fma((1.0 - y), z, fma((1.0 - t), a, x));
} else if (t <= 7.2e+114) {
tmp = fma((1.0 - y), z, (fma((y - 2.0), b, x) + a));
} else {
tmp = fma(t, b, (-a * t));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.4e+27) tmp = fma(Float64(1.0 - y), z, fma(Float64(1.0 - t), a, x)); elseif (t <= 7.2e+114) tmp = fma(Float64(1.0 - y), z, Float64(fma(Float64(y - 2.0), b, x) + a)); else tmp = fma(t, b, Float64(Float64(-a) * t)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.4e+27], N[(N[(1.0 - y), $MachinePrecision] * z + N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e+114], N[(N[(1.0 - y), $MachinePrecision] * z + N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], N[(t * b + N[((-a) * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(1 - t, a, x\right)\right)\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(y - 2, b, x\right) + a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, b, \left(-a\right) \cdot t\right)\\
\end{array}
\end{array}
if t < -3.4e27Initial program 95.9%
Taylor expanded in b around 0
+-commutativeN/A
associate--r+N/A
sub-negN/A
+-commutativeN/A
associate-+r-N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites78.1%
if -3.4e27 < t < 7.2000000000000001e114Initial program 97.5%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
associate-+l+N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
Applied rewrites93.3%
if 7.2000000000000001e114 < t Initial program 97.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6473.7
Applied rewrites73.7%
Applied rewrites73.8%
Final simplification86.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- (+ t y) 2.0))))
(if (<= b -1.5e+170)
t_1
(if (<= b 1.25e+126) (fma (- 1.0 y) z (fma (- 1.0 t) a x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * ((t + y) - 2.0);
double tmp;
if (b <= -1.5e+170) {
tmp = t_1;
} else if (b <= 1.25e+126) {
tmp = fma((1.0 - y), z, fma((1.0 - t), a, x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(Float64(t + y) - 2.0)) tmp = 0.0 if (b <= -1.5e+170) tmp = t_1; elseif (b <= 1.25e+126) tmp = fma(Float64(1.0 - y), z, fma(Float64(1.0 - t), a, x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.5e+170], t$95$1, If[LessEqual[b, 1.25e+126], N[(N[(1.0 - y), $MachinePrecision] * z + N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{if}\;b \leq -1.5 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.25 \cdot 10^{+126}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(1 - t, a, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.49999999999999998e170 or 1.24999999999999994e126 < b Initial program 94.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6483.2
Applied rewrites83.2%
if -1.49999999999999998e170 < b < 1.24999999999999994e126Initial program 98.0%
Taylor expanded in b around 0
+-commutativeN/A
associate--r+N/A
sub-negN/A
+-commutativeN/A
associate-+r-N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites85.8%
Final simplification85.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -5.2e+79)
(* b t)
(if (<= t -1.6e-138)
(+ a z)
(if (<= t 2.7e-77) (+ a x) (if (<= t 3.4e+101) (+ z x) (* b t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5.2e+79) {
tmp = b * t;
} else if (t <= -1.6e-138) {
tmp = a + z;
} else if (t <= 2.7e-77) {
tmp = a + x;
} else if (t <= 3.4e+101) {
tmp = z + x;
} else {
tmp = b * t;
}
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 <= (-5.2d+79)) then
tmp = b * t
else if (t <= (-1.6d-138)) then
tmp = a + z
else if (t <= 2.7d-77) then
tmp = a + x
else if (t <= 3.4d+101) then
tmp = z + x
else
tmp = b * t
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 <= -5.2e+79) {
tmp = b * t;
} else if (t <= -1.6e-138) {
tmp = a + z;
} else if (t <= 2.7e-77) {
tmp = a + x;
} else if (t <= 3.4e+101) {
tmp = z + x;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -5.2e+79: tmp = b * t elif t <= -1.6e-138: tmp = a + z elif t <= 2.7e-77: tmp = a + x elif t <= 3.4e+101: tmp = z + x else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -5.2e+79) tmp = Float64(b * t); elseif (t <= -1.6e-138) tmp = Float64(a + z); elseif (t <= 2.7e-77) tmp = Float64(a + x); elseif (t <= 3.4e+101) tmp = Float64(z + x); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -5.2e+79) tmp = b * t; elseif (t <= -1.6e-138) tmp = a + z; elseif (t <= 2.7e-77) tmp = a + x; elseif (t <= 3.4e+101) tmp = z + x; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -5.2e+79], N[(b * t), $MachinePrecision], If[LessEqual[t, -1.6e-138], N[(a + z), $MachinePrecision], If[LessEqual[t, 2.7e-77], N[(a + x), $MachinePrecision], If[LessEqual[t, 3.4e+101], N[(z + x), $MachinePrecision], N[(b * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+79}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq -1.6 \cdot 10^{-138}:\\
\;\;\;\;a + z\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-77}:\\
\;\;\;\;a + x\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+101}:\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -5.20000000000000029e79 or 3.40000000000000017e101 < t Initial program 95.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6435.1
Applied rewrites35.1%
Taylor expanded in t around inf
Applied rewrites35.1%
if -5.20000000000000029e79 < t < -1.60000000000000005e-138Initial program 97.4%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites80.2%
Taylor expanded in b around 0
Applied rewrites69.7%
Taylor expanded in t around 0
Applied rewrites62.5%
Taylor expanded in x around 0
Applied rewrites57.1%
if -1.60000000000000005e-138 < t < 2.7e-77Initial program 97.7%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites67.6%
Taylor expanded in b around 0
Applied rewrites56.2%
Taylor expanded in t around 0
Applied rewrites56.2%
Taylor expanded in z around 0
Applied rewrites43.1%
if 2.7e-77 < t < 3.40000000000000017e101Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites72.5%
Taylor expanded in b around 0
Applied rewrites61.7%
Taylor expanded in a around 0
Applied rewrites49.0%
Final simplification43.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -2e+33)
t_1
(if (<= t 6e-201)
(+ (+ a x) z)
(if (<= t 4.2e+115) (fma (- 1.0 y) z x) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -2e+33) {
tmp = t_1;
} else if (t <= 6e-201) {
tmp = (a + x) + z;
} else if (t <= 4.2e+115) {
tmp = fma((1.0 - y), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -2e+33) tmp = t_1; elseif (t <= 6e-201) tmp = Float64(Float64(a + x) + z); elseif (t <= 4.2e+115) tmp = fma(Float64(1.0 - y), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2e+33], t$95$1, If[LessEqual[t, 6e-201], N[(N[(a + x), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[t, 4.2e+115], N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -2 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-201}:\\
\;\;\;\;\left(a + x\right) + z\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+115}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.9999999999999999e33 or 4.20000000000000007e115 < t Initial program 96.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6474.4
Applied rewrites74.4%
if -1.9999999999999999e33 < t < 6.00000000000000004e-201Initial program 96.8%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites75.5%
Taylor expanded in b around 0
Applied rewrites64.9%
Taylor expanded in t around 0
Applied rewrites63.8%
if 6.00000000000000004e-201 < t < 4.20000000000000007e115Initial program 98.5%
Taylor expanded in b around 0
+-commutativeN/A
associate--r+N/A
sub-negN/A
+-commutativeN/A
associate-+r-N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites69.8%
Taylor expanded in a around 0
Applied rewrites56.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- (+ t y) 2.0)))) (if (<= b -4.4e+94) t_1 (if (<= b 5.6e+88) (fma (- 1.0 t) a (+ z x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * ((t + y) - 2.0);
double tmp;
if (b <= -4.4e+94) {
tmp = t_1;
} else if (b <= 5.6e+88) {
tmp = fma((1.0 - t), a, (z + x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(Float64(t + y) - 2.0)) tmp = 0.0 if (b <= -4.4e+94) tmp = t_1; elseif (b <= 5.6e+88) tmp = fma(Float64(1.0 - t), a, Float64(z + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4.4e+94], t$95$1, If[LessEqual[b, 5.6e+88], N[(N[(1.0 - t), $MachinePrecision] * a + N[(z + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{if}\;b \leq -4.4 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+88}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, z + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -4.40000000000000024e94 or 5.59999999999999977e88 < b Initial program 94.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6474.1
Applied rewrites74.1%
if -4.40000000000000024e94 < b < 5.59999999999999977e88Initial program 98.3%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites80.1%
Taylor expanded in b around 0
Applied rewrites74.4%
Final simplification74.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- b a) t))) (if (<= t -2e+33) t_1 (if (<= t 1.6e+53) (+ (+ a x) z) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -2e+33) {
tmp = t_1;
} else if (t <= 1.6e+53) {
tmp = (a + x) + z;
} 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 - a) * t
if (t <= (-2d+33)) then
tmp = t_1
else if (t <= 1.6d+53) then
tmp = (a + x) + z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -2e+33) {
tmp = t_1;
} else if (t <= 1.6e+53) {
tmp = (a + x) + z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -2e+33: tmp = t_1 elif t <= 1.6e+53: tmp = (a + x) + z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -2e+33) tmp = t_1; elseif (t <= 1.6e+53) tmp = Float64(Float64(a + x) + z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - a) * t; tmp = 0.0; if (t <= -2e+33) tmp = t_1; elseif (t <= 1.6e+53) tmp = (a + x) + z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2e+33], t$95$1, If[LessEqual[t, 1.6e+53], N[(N[(a + x), $MachinePrecision] + z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -2 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+53}:\\
\;\;\;\;\left(a + x\right) + z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.9999999999999999e33 or 1.6e53 < t Initial program 96.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.2
Applied rewrites69.2%
if -1.9999999999999999e33 < t < 1.6e53Initial program 97.9%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites70.5%
Taylor expanded in b around 0
Applied rewrites60.1%
Taylor expanded in t around 0
Applied rewrites58.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6.5e+38) (* (- y) z) (if (<= y 2.5e+81) (+ (+ a x) z) (* b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.5e+38) {
tmp = -y * z;
} else if (y <= 2.5e+81) {
tmp = (a + x) + z;
} else {
tmp = b * y;
}
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 <= (-6.5d+38)) then
tmp = -y * z
else if (y <= 2.5d+81) then
tmp = (a + x) + z
else
tmp = b * y
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 <= -6.5e+38) {
tmp = -y * z;
} else if (y <= 2.5e+81) {
tmp = (a + x) + z;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6.5e+38: tmp = -y * z elif y <= 2.5e+81: tmp = (a + x) + z else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6.5e+38) tmp = Float64(Float64(-y) * z); elseif (y <= 2.5e+81) tmp = Float64(Float64(a + x) + z); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -6.5e+38) tmp = -y * z; elseif (y <= 2.5e+81) tmp = (a + x) + z; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.5e+38], N[((-y) * z), $MachinePrecision], If[LessEqual[y, 2.5e+81], N[(N[(a + x), $MachinePrecision] + z), $MachinePrecision], N[(b * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+38}:\\
\;\;\;\;\left(-y\right) \cdot z\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+81}:\\
\;\;\;\;\left(a + x\right) + z\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if y < -6.5e38Initial program 93.8%
Taylor expanded in z around inf
*-commutativeN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f6450.1
Applied rewrites50.1%
Taylor expanded in y around inf
Applied rewrites50.1%
if -6.5e38 < y < 2.4999999999999999e81Initial program 99.4%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites96.0%
Taylor expanded in b around 0
Applied rewrites74.2%
Taylor expanded in t around 0
Applied rewrites54.1%
if 2.4999999999999999e81 < y Initial program 92.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6448.7
Applied rewrites48.7%
Taylor expanded in y around inf
Applied rewrites43.7%
(FPCore (x y z t a b) :precision binary64 (if (<= a -5.7e+150) (+ a z) (if (<= a 7.5e+78) (+ z x) (+ a x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.7e+150) {
tmp = a + z;
} else if (a <= 7.5e+78) {
tmp = z + x;
} else {
tmp = a + x;
}
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 (a <= (-5.7d+150)) then
tmp = a + z
else if (a <= 7.5d+78) then
tmp = z + x
else
tmp = a + x
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 (a <= -5.7e+150) {
tmp = a + z;
} else if (a <= 7.5e+78) {
tmp = z + x;
} else {
tmp = a + x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5.7e+150: tmp = a + z elif a <= 7.5e+78: tmp = z + x else: tmp = a + x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.7e+150) tmp = Float64(a + z); elseif (a <= 7.5e+78) tmp = Float64(z + x); else tmp = Float64(a + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -5.7e+150) tmp = a + z; elseif (a <= 7.5e+78) tmp = z + x; else tmp = a + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.7e+150], N[(a + z), $MachinePrecision], If[LessEqual[a, 7.5e+78], N[(z + x), $MachinePrecision], N[(a + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.7 \cdot 10^{+150}:\\
\;\;\;\;a + z\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{+78}:\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;a + x\\
\end{array}
\end{array}
if a < -5.7000000000000002e150Initial program 93.8%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites88.1%
Taylor expanded in b around 0
Applied rewrites85.0%
Taylor expanded in t around 0
Applied rewrites49.2%
Taylor expanded in x around 0
Applied rewrites48.6%
if -5.7000000000000002e150 < a < 7.49999999999999934e78Initial program 98.3%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites73.4%
Taylor expanded in b around 0
Applied rewrites49.4%
Taylor expanded in a around 0
Applied rewrites37.3%
if 7.49999999999999934e78 < a Initial program 95.7%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites81.6%
Taylor expanded in b around 0
Applied rewrites77.8%
Taylor expanded in t around 0
Applied rewrites46.7%
Taylor expanded in z around 0
Applied rewrites44.6%
Final simplification40.0%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.8e+185) (+ a z) (if (<= z 2.7e+88) (+ a x) (+ a z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.8e+185) {
tmp = a + z;
} else if (z <= 2.7e+88) {
tmp = a + x;
} else {
tmp = a + 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 (z <= (-3.8d+185)) then
tmp = a + z
else if (z <= 2.7d+88) then
tmp = a + x
else
tmp = a + 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 (z <= -3.8e+185) {
tmp = a + z;
} else if (z <= 2.7e+88) {
tmp = a + x;
} else {
tmp = a + z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.8e+185: tmp = a + z elif z <= 2.7e+88: tmp = a + x else: tmp = a + z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.8e+185) tmp = Float64(a + z); elseif (z <= 2.7e+88) tmp = Float64(a + x); else tmp = Float64(a + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.8e+185) tmp = a + z; elseif (z <= 2.7e+88) tmp = a + x; else tmp = a + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.8e+185], N[(a + z), $MachinePrecision], If[LessEqual[z, 2.7e+88], N[(a + x), $MachinePrecision], N[(a + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+185}:\\
\;\;\;\;a + z\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+88}:\\
\;\;\;\;a + x\\
\mathbf{else}:\\
\;\;\;\;a + z\\
\end{array}
\end{array}
if z < -3.7999999999999998e185 or 2.70000000000000016e88 < z Initial program 94.9%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites71.7%
Taylor expanded in b around 0
Applied rewrites60.3%
Taylor expanded in t around 0
Applied rewrites50.5%
Taylor expanded in x around 0
Applied rewrites43.3%
if -3.7999999999999998e185 < z < 2.70000000000000016e88Initial program 98.3%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites78.8%
Taylor expanded in b around 0
Applied rewrites58.4%
Taylor expanded in t around 0
Applied rewrites37.9%
Taylor expanded in z around 0
Applied rewrites36.1%
Final simplification38.3%
(FPCore (x y z t a b) :precision binary64 (+ a x))
double code(double x, double y, double z, double t, double a, double b) {
return a + 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 = a + x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a + x;
}
def code(x, y, z, t, a, b): return a + x
function code(x, y, z, t, a, b) return Float64(a + x) end
function tmp = code(x, y, z, t, a, b) tmp = a + x; end
code[x_, y_, z_, t_, a_, b_] := N[(a + x), $MachinePrecision]
\begin{array}{l}
\\
a + x
\end{array}
Initial program 97.3%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
lower-+.f64N/A
Applied rewrites76.7%
Taylor expanded in b around 0
Applied rewrites59.0%
Taylor expanded in t around 0
Applied rewrites41.7%
Taylor expanded in z around 0
Applied rewrites29.2%
herbie shell --seed 2024249
(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)))