
(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 15 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 (- 1.0 t) a (+ z (fma (- b z) y (fma (- t 2.0) b x)))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((1.0 - t), a, (z + fma((b - z), y, fma((t - 2.0), b, x))));
}
function code(x, y, z, t, a, b) return fma(Float64(1.0 - t), a, Float64(z + fma(Float64(b - z), y, fma(Float64(t - 2.0), b, x)))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(1.0 - t), $MachinePrecision] * a + N[(z + N[(N[(b - z), $MachinePrecision] * y + N[(N[(t - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(1 - t, a, z + \mathsf{fma}\left(b - z, y, \mathsf{fma}\left(t - 2, b, x\right)\right)\right)
\end{array}
Initial program 93.7%
Taylor expanded in y 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
Applied rewrites97.3%
(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 (<= t_1 -2e+307)
(* (- a) t)
(if (<= t_1 1e+285) (+ (+ z x) a) (* b t)))))
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 <= -2e+307) {
tmp = -a * t;
} else if (t_1 <= 1e+285) {
tmp = (z + x) + a;
} 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) :: t_1
real(8) :: tmp
t_1 = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
if (t_1 <= (-2d+307)) then
tmp = -a * t
else if (t_1 <= 1d+285) then
tmp = (z + x) + a
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 t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= -2e+307) {
tmp = -a * t;
} else if (t_1 <= 1e+285) {
tmp = (z + x) + a;
} else {
tmp = b * t;
}
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 <= -2e+307: tmp = -a * t elif t_1 <= 1e+285: tmp = (z + x) + a else: tmp = b * t 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 <= -2e+307) tmp = Float64(Float64(-a) * t); elseif (t_1 <= 1e+285) tmp = Float64(Float64(z + x) + a); else tmp = Float64(b * t); 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 <= -2e+307) tmp = -a * t; elseif (t_1 <= 1e+285) tmp = (z + x) + a; else tmp = b * t; 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[LessEqual[t$95$1, -2e+307], N[((-a) * t), $MachinePrecision], If[LessEqual[t$95$1, 1e+285], N[(N[(z + x), $MachinePrecision] + a), $MachinePrecision], N[(b * t), $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 -2 \cdot 10^{+307}:\\
\;\;\;\;\left(-a\right) \cdot t\\
\mathbf{elif}\;t\_1 \leq 10^{+285}:\\
\;\;\;\;\left(z + x\right) + a\\
\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)) < -1.99999999999999997e307Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6461.8
Applied rewrites61.8%
Taylor expanded in a around inf
Applied rewrites40.7%
if -1.99999999999999997e307 < (+.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.9999999999999998e284Initial program 100.0%
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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites81.5%
Taylor expanded in b around 0
Applied rewrites64.0%
Taylor expanded in y around 0
Applied rewrites52.5%
if 9.9999999999999998e284 < (+.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 77.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6458.1
Applied rewrites58.1%
Taylor expanded in y around inf
Applied rewrites29.5%
Taylor expanded in t around inf
Applied rewrites36.4%
(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 (<= t_1 (- INFINITY))
(* (- y) z)
(if (<= t_1 1e+285) (+ (+ z x) a) (* b t)))))
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)) {
tmp = -y * z;
} else if (t_1 <= 1e+285) {
tmp = (z + x) + a;
} 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 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = -y * z;
} else if (t_1 <= 1e+285) {
tmp = (z + x) + a;
} else {
tmp = b * t;
}
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: tmp = -y * z elif t_1 <= 1e+285: tmp = (z + x) + a else: tmp = b * t 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)) tmp = Float64(Float64(-y) * z); elseif (t_1 <= 1e+285) tmp = Float64(Float64(z + x) + a); else tmp = Float64(b * t); 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) tmp = -y * z; elseif (t_1 <= 1e+285) tmp = (z + x) + a; else tmp = b * t; 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[LessEqual[t$95$1, (-Infinity)], N[((-y) * z), $MachinePrecision], If[LessEqual[t$95$1, 1e+285], N[(N[(z + x), $MachinePrecision] + a), $MachinePrecision], N[(b * t), $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:\\
\;\;\;\;\left(-y\right) \cdot z\\
\mathbf{elif}\;t\_1 \leq 10^{+285}:\\
\;\;\;\;\left(z + x\right) + a\\
\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.0Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
sub-negN/A
neg-mul-1N/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
sub-negN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f6434.3
Applied rewrites34.3%
Taylor expanded in y around inf
Applied rewrites33.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.9999999999999998e284Initial program 100.0%
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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites81.0%
Taylor expanded in b around 0
Applied rewrites63.6%
Taylor expanded in y around 0
Applied rewrites52.2%
if 9.9999999999999998e284 < (+.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 77.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6458.1
Applied rewrites58.1%
Taylor expanded in y around inf
Applied rewrites29.5%
Taylor expanded in t around inf
Applied rewrites36.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -6.8e+78) (not (<= t 2e+14))) (fma (- 1.0 t) a (+ z (fma (- t 2.0) b x))) (fma (- 1.0 y) z (+ a (fma (- y 2.0) b x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -6.8e+78) || !(t <= 2e+14)) {
tmp = fma((1.0 - t), a, (z + fma((t - 2.0), b, x)));
} else {
tmp = fma((1.0 - y), z, (a + fma((y - 2.0), b, x)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -6.8e+78) || !(t <= 2e+14)) tmp = fma(Float64(1.0 - t), a, Float64(z + fma(Float64(t - 2.0), b, x))); else tmp = fma(Float64(1.0 - y), z, Float64(a + fma(Float64(y - 2.0), b, x))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -6.8e+78], N[Not[LessEqual[t, 2e+14]], $MachinePrecision]], N[(N[(1.0 - t), $MachinePrecision] * a + N[(z + N[(N[(t - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - y), $MachinePrecision] * z + N[(a + N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{+78} \lor \neg \left(t \leq 2 \cdot 10^{+14}\right):\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, z + \mathsf{fma}\left(t - 2, b, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, a + \mathsf{fma}\left(y - 2, b, x\right)\right)\\
\end{array}
\end{array}
if t < -6.80000000000000014e78 or 2e14 < t Initial program 87.8%
Taylor expanded in y 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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites85.7%
if -6.80000000000000014e78 < t < 2e14Initial program 98.6%
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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites93.7%
Final simplification90.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)) (t_2 (* (- b a) t)))
(if (<= t -2e+54)
t_2
(if (<= t -1.7e-14)
t_1
(if (<= t 3.2e-79) (+ (fma -2.0 b x) a) (if (<= t 2e+14) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double t_2 = (b - a) * t;
double tmp;
if (t <= -2e+54) {
tmp = t_2;
} else if (t <= -1.7e-14) {
tmp = t_1;
} else if (t <= 3.2e-79) {
tmp = fma(-2.0, b, x) + a;
} else if (t <= 2e+14) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) t_2 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -2e+54) tmp = t_2; elseif (t <= -1.7e-14) tmp = t_1; elseif (t <= 3.2e-79) tmp = Float64(fma(-2.0, b, x) + a); elseif (t <= 2e+14) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2e+54], t$95$2, If[LessEqual[t, -1.7e-14], t$95$1, If[LessEqual[t, 3.2e-79], N[(N[(-2.0 * b + x), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t, 2e+14], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
t_2 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -2 \cdot 10^{+54}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-79}:\\
\;\;\;\;\mathsf{fma}\left(-2, b, x\right) + a\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.0000000000000002e54 or 2e14 < t Initial program 88.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6470.8
Applied rewrites70.8%
if -2.0000000000000002e54 < t < -1.70000000000000001e-14 or 3.19999999999999988e-79 < t < 2e14Initial program 97.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6458.8
Applied rewrites58.8%
if -1.70000000000000001e-14 < t < 3.19999999999999988e-79Initial program 99.0%
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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites100.0%
Taylor expanded in y around 0
Applied rewrites68.3%
Taylor expanded in z around 0
Applied rewrites59.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)) (t_2 (* (- b a) t)))
(if (<= t -2e+54)
t_2
(if (<= t -4.6e-222)
t_1
(if (<= t 1.55e-83) (+ (+ z x) a) (if (<= t 2e+14) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double t_2 = (b - a) * t;
double tmp;
if (t <= -2e+54) {
tmp = t_2;
} else if (t <= -4.6e-222) {
tmp = t_1;
} else if (t <= 1.55e-83) {
tmp = (z + x) + a;
} else if (t <= 2e+14) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (b - z) * y
t_2 = (b - a) * t
if (t <= (-2d+54)) then
tmp = t_2
else if (t <= (-4.6d-222)) then
tmp = t_1
else if (t <= 1.55d-83) then
tmp = (z + x) + a
else if (t <= 2d+14) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double t_2 = (b - a) * t;
double tmp;
if (t <= -2e+54) {
tmp = t_2;
} else if (t <= -4.6e-222) {
tmp = t_1;
} else if (t <= 1.55e-83) {
tmp = (z + x) + a;
} else if (t <= 2e+14) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y t_2 = (b - a) * t tmp = 0 if t <= -2e+54: tmp = t_2 elif t <= -4.6e-222: tmp = t_1 elif t <= 1.55e-83: tmp = (z + x) + a elif t <= 2e+14: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) t_2 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -2e+54) tmp = t_2; elseif (t <= -4.6e-222) tmp = t_1; elseif (t <= 1.55e-83) tmp = Float64(Float64(z + x) + a); elseif (t <= 2e+14) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; t_2 = (b - a) * t; tmp = 0.0; if (t <= -2e+54) tmp = t_2; elseif (t <= -4.6e-222) tmp = t_1; elseif (t <= 1.55e-83) tmp = (z + x) + a; elseif (t <= 2e+14) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2e+54], t$95$2, If[LessEqual[t, -4.6e-222], t$95$1, If[LessEqual[t, 1.55e-83], N[(N[(z + x), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t, 2e+14], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
t_2 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -2 \cdot 10^{+54}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -4.6 \cdot 10^{-222}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-83}:\\
\;\;\;\;\left(z + x\right) + a\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.0000000000000002e54 or 2e14 < t Initial program 88.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6470.8
Applied rewrites70.8%
if -2.0000000000000002e54 < t < -4.6000000000000003e-222 or 1.54999999999999996e-83 < t < 2e14Initial program 98.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6451.0
Applied rewrites51.0%
if -4.6000000000000003e-222 < t < 1.54999999999999996e-83Initial program 98.4%
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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites100.0%
Taylor expanded in b around 0
Applied rewrites73.2%
Taylor expanded in y around 0
Applied rewrites59.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.2e+125) (not (<= b 3.3e+63))) (* (- (+ t y) 2.0) b) (fma (- 1.0 y) z (fma (- 1.0 t) a x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.2e+125) || !(b <= 3.3e+63)) {
tmp = ((t + y) - 2.0) * b;
} else {
tmp = fma((1.0 - y), z, fma((1.0 - t), a, x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.2e+125) || !(b <= 3.3e+63)) tmp = Float64(Float64(Float64(t + y) - 2.0) * b); else tmp = fma(Float64(1.0 - y), z, fma(Float64(1.0 - t), a, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.2e+125], N[Not[LessEqual[b, 3.3e+63]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision], N[(N[(1.0 - y), $MachinePrecision] * z + N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.2 \cdot 10^{+125} \lor \neg \left(b \leq 3.3 \cdot 10^{+63}\right):\\
\;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(1 - t, a, x\right)\right)\\
\end{array}
\end{array}
if b < -5.20000000000000006e125 or 3.3000000000000002e63 < b Initial program 87.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6482.9
Applied rewrites82.9%
if -5.20000000000000006e125 < b < 3.3000000000000002e63Initial program 97.4%
Taylor expanded in y 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
Applied rewrites98.7%
Taylor expanded in b around 0
sub-negN/A
+-commutativeN/A
Applied rewrites93.0%
Final simplification89.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -5e+125)
t_1
(if (<= b -2.5e-175)
(fma -2.0 b (fma (- 1.0 t) a x))
(if (<= b 3.6e+60) (+ (fma (- 1.0 y) z x) a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -5e+125) {
tmp = t_1;
} else if (b <= -2.5e-175) {
tmp = fma(-2.0, b, fma((1.0 - t), a, x));
} else if (b <= 3.6e+60) {
tmp = fma((1.0 - y), z, x) + a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -5e+125) tmp = t_1; elseif (b <= -2.5e-175) tmp = fma(-2.0, b, fma(Float64(1.0 - t), a, x)); elseif (b <= 3.6e+60) tmp = Float64(fma(Float64(1.0 - y), z, x) + a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -5e+125], t$95$1, If[LessEqual[b, -2.5e-175], N[(-2.0 * b + N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.6e+60], N[(N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -5 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -2.5 \cdot 10^{-175}:\\
\;\;\;\;\mathsf{fma}\left(-2, b, \mathsf{fma}\left(1 - t, a, x\right)\right)\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{+60}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, x\right) + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -4.99999999999999962e125 or 3.59999999999999968e60 < b Initial program 87.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6482.9
Applied rewrites82.9%
if -4.99999999999999962e125 < b < -2.5e-175Initial program 97.9%
Taylor expanded in y 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
Applied rewrites100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
sub-negN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
sub-negN/A
*-commutativeN/A
mul-1-negN/A
remove-double-negN/A
Applied rewrites82.0%
Taylor expanded in z around 0
Applied rewrites74.0%
Taylor expanded in t around 0
Applied rewrites71.9%
if -2.5e-175 < b < 3.59999999999999968e60Initial program 97.2%
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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites75.9%
Taylor expanded in b around 0
Applied rewrites72.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 2.0) b)))
(if (<= b -3.05e+50)
t_1
(if (<= b 1.9e-16) (+ (+ z x) a) (if (<= b 4.5e+30) (* (- a) t) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 2.0) * b;
double tmp;
if (b <= -3.05e+50) {
tmp = t_1;
} else if (b <= 1.9e-16) {
tmp = (z + x) + a;
} else if (b <= 4.5e+30) {
tmp = -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 = (t - 2.0d0) * b
if (b <= (-3.05d+50)) then
tmp = t_1
else if (b <= 1.9d-16) then
tmp = (z + x) + a
else if (b <= 4.5d+30) then
tmp = -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 = (t - 2.0) * b;
double tmp;
if (b <= -3.05e+50) {
tmp = t_1;
} else if (b <= 1.9e-16) {
tmp = (z + x) + a;
} else if (b <= 4.5e+30) {
tmp = -a * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - 2.0) * b tmp = 0 if b <= -3.05e+50: tmp = t_1 elif b <= 1.9e-16: tmp = (z + x) + a elif b <= 4.5e+30: tmp = -a * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - 2.0) * b) tmp = 0.0 if (b <= -3.05e+50) tmp = t_1; elseif (b <= 1.9e-16) tmp = Float64(Float64(z + x) + a); elseif (b <= 4.5e+30) tmp = Float64(Float64(-a) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - 2.0) * b; tmp = 0.0; if (b <= -3.05e+50) tmp = t_1; elseif (b <= 1.9e-16) tmp = (z + x) + a; elseif (b <= 4.5e+30) tmp = -a * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -3.05e+50], t$95$1, If[LessEqual[b, 1.9e-16], N[(N[(z + x), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[b, 4.5e+30], N[((-a) * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 2\right) \cdot b\\
\mathbf{if}\;b \leq -3.05 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{-16}:\\
\;\;\;\;\left(z + x\right) + a\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{+30}:\\
\;\;\;\;\left(-a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.05000000000000013e50 or 4.49999999999999995e30 < b Initial program 88.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6475.7
Applied rewrites75.7%
Taylor expanded in y around 0
Applied rewrites55.7%
if -3.05000000000000013e50 < b < 1.90000000000000006e-16Initial program 98.4%
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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites75.6%
Taylor expanded in b around 0
Applied rewrites73.2%
Taylor expanded in y around 0
Applied rewrites50.2%
if 1.90000000000000006e-16 < b < 4.49999999999999995e30Initial program 90.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6461.3
Applied rewrites61.3%
Taylor expanded in a around inf
Applied rewrites61.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -4.2e+125) (not (<= b 3.6e+60))) (* (- (+ t y) 2.0) b) (+ (fma (- 1.0 y) z x) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.2e+125) || !(b <= 3.6e+60)) {
tmp = ((t + y) - 2.0) * b;
} else {
tmp = fma((1.0 - y), z, x) + a;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4.2e+125) || !(b <= 3.6e+60)) tmp = Float64(Float64(Float64(t + y) - 2.0) * b); else tmp = Float64(fma(Float64(1.0 - y), z, x) + a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4.2e+125], N[Not[LessEqual[b, 3.6e+60]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision], N[(N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.2 \cdot 10^{+125} \lor \neg \left(b \leq 3.6 \cdot 10^{+60}\right):\\
\;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, x\right) + a\\
\end{array}
\end{array}
if b < -4.2000000000000001e125 or 3.59999999999999968e60 < b Initial program 87.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6482.9
Applied rewrites82.9%
if -4.2000000000000001e125 < b < 3.59999999999999968e60Initial program 97.4%
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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites73.0%
Taylor expanded in b around 0
Applied rewrites68.5%
Final simplification74.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -5e+14) (not (<= t 8.2e+45))) (* (- b a) t) (+ (+ (fma -2.0 b z) x) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5e+14) || !(t <= 8.2e+45)) {
tmp = (b - a) * t;
} else {
tmp = (fma(-2.0, b, z) + x) + a;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -5e+14) || !(t <= 8.2e+45)) tmp = Float64(Float64(b - a) * t); 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[t, -5e+14], N[Not[LessEqual[t, 8.2e+45]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], N[(N[(N[(-2.0 * b + z), $MachinePrecision] + x), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+14} \lor \neg \left(t \leq 8.2 \cdot 10^{+45}\right):\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(-2, b, z\right) + x\right) + a\\
\end{array}
\end{array}
if t < -5e14 or 8.20000000000000025e45 < t Initial program 89.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6470.4
Applied rewrites70.4%
if -5e14 < t < 8.20000000000000025e45Initial program 98.4%
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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites96.5%
Taylor expanded in y around 0
Applied rewrites60.7%
Final simplification65.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -5e+14) (not (<= t 8.2e+45))) (* (- b a) t) (+ (+ z x) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5e+14) || !(t <= 8.2e+45)) {
tmp = (b - a) * t;
} else {
tmp = (z + x) + a;
}
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 <= (-5d+14)) .or. (.not. (t <= 8.2d+45))) then
tmp = (b - a) * t
else
tmp = (z + x) + a
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 <= -5e+14) || !(t <= 8.2e+45)) {
tmp = (b - a) * t;
} else {
tmp = (z + x) + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -5e+14) or not (t <= 8.2e+45): tmp = (b - a) * t else: tmp = (z + x) + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -5e+14) || !(t <= 8.2e+45)) tmp = Float64(Float64(b - a) * t); else tmp = Float64(Float64(z + x) + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -5e+14) || ~((t <= 8.2e+45))) tmp = (b - a) * t; else tmp = (z + x) + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -5e+14], N[Not[LessEqual[t, 8.2e+45]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], N[(N[(z + x), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+14} \lor \neg \left(t \leq 8.2 \cdot 10^{+45}\right):\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(z + x\right) + a\\
\end{array}
\end{array}
if t < -5e14 or 8.20000000000000025e45 < t Initial program 89.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6470.4
Applied rewrites70.4%
if -5e14 < t < 8.20000000000000025e45Initial program 98.4%
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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites96.5%
Taylor expanded in b around 0
Applied rewrites66.8%
Taylor expanded in y around 0
Applied rewrites45.9%
Final simplification58.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.7e+129) (not (<= b 1.9e+63))) (* b t) (+ (+ z x) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.7e+129) || !(b <= 1.9e+63)) {
tmp = b * t;
} else {
tmp = (z + x) + a;
}
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 ((b <= (-2.7d+129)) .or. (.not. (b <= 1.9d+63))) then
tmp = b * t
else
tmp = (z + x) + a
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 ((b <= -2.7e+129) || !(b <= 1.9e+63)) {
tmp = b * t;
} else {
tmp = (z + x) + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.7e+129) or not (b <= 1.9e+63): tmp = b * t else: tmp = (z + x) + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.7e+129) || !(b <= 1.9e+63)) tmp = Float64(b * t); else tmp = Float64(Float64(z + x) + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -2.7e+129) || ~((b <= 1.9e+63))) tmp = b * t; else tmp = (z + x) + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.7e+129], N[Not[LessEqual[b, 1.9e+63]], $MachinePrecision]], N[(b * t), $MachinePrecision], N[(N[(z + x), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.7 \cdot 10^{+129} \lor \neg \left(b \leq 1.9 \cdot 10^{+63}\right):\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(z + x\right) + a\\
\end{array}
\end{array}
if b < -2.7000000000000001e129 or 1.9000000000000001e63 < b Initial program 87.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6482.4
Applied rewrites82.4%
Taylor expanded in y around inf
Applied rewrites33.3%
Taylor expanded in t around inf
Applied rewrites45.8%
if -2.7000000000000001e129 < b < 1.9000000000000001e63Initial 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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites73.5%
Taylor expanded in b around 0
Applied rewrites67.3%
Taylor expanded in y around 0
Applied rewrites44.1%
Final simplification44.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.3e+122) (not (<= b 3.3e+61))) (* b t) (+ a x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.3e+122) || !(b <= 3.3e+61)) {
tmp = b * t;
} 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 ((b <= (-5.3d+122)) .or. (.not. (b <= 3.3d+61))) then
tmp = b * t
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 ((b <= -5.3e+122) || !(b <= 3.3e+61)) {
tmp = b * t;
} else {
tmp = a + x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.3e+122) or not (b <= 3.3e+61): tmp = b * t else: tmp = a + x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.3e+122) || !(b <= 3.3e+61)) tmp = Float64(b * t); else tmp = Float64(a + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5.3e+122) || ~((b <= 3.3e+61))) tmp = b * t; else tmp = a + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.3e+122], N[Not[LessEqual[b, 3.3e+61]], $MachinePrecision]], N[(b * t), $MachinePrecision], N[(a + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.3 \cdot 10^{+122} \lor \neg \left(b \leq 3.3 \cdot 10^{+61}\right):\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;a + x\\
\end{array}
\end{array}
if b < -5.3e122 or 3.2999999999999998e61 < b Initial program 87.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6481.3
Applied rewrites81.3%
Taylor expanded in y around inf
Applied rewrites32.7%
Taylor expanded in t around inf
Applied rewrites44.6%
if -5.3e122 < b < 3.2999999999999998e61Initial program 98.1%
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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites73.3%
Taylor expanded in b around 0
Applied rewrites68.8%
Taylor expanded in z around 0
Applied rewrites34.3%
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 93.7%
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
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
lower-+.f64N/A
Applied rewrites67.9%
Taylor expanded in b around 0
Applied rewrites49.5%
Taylor expanded in z around 0
Applied rewrites24.5%
herbie shell --seed 2024309
(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)))