
(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 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (fma (- b z) y (+ (fma (- t 2.0) b z) (fma (- 1.0 t) a x))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((b - z), y, (fma((t - 2.0), b, z) + fma((1.0 - t), a, x)));
}
function code(x, y, z, t, a, b) return fma(Float64(b - z), y, Float64(fma(Float64(t - 2.0), b, z) + fma(Float64(1.0 - t), a, x))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(b - z), $MachinePrecision] * y + N[(N[(N[(t - 2.0), $MachinePrecision] * b + z), $MachinePrecision] + N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(b - z, y, \mathsf{fma}\left(t - 2, b, z\right) + \mathsf{fma}\left(1 - t, a, x\right)\right)
\end{array}
Initial program 94.1%
Taylor expanded in y around 0
Applied rewrites97.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -9.2e+125)
t_1
(if (<= b -1.8e+86)
(* (- b a) t)
(if (<= b -1.95e-292)
(fma (- 1.0 y) z (+ a x))
(if (<= b 2.65e+150) (+ (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 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -9.2e+125) {
tmp = t_1;
} else if (b <= -1.8e+86) {
tmp = (b - a) * t;
} else if (b <= -1.95e-292) {
tmp = fma((1.0 - y), z, (a + x));
} else if (b <= 2.65e+150) {
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(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -9.2e+125) tmp = t_1; elseif (b <= -1.8e+86) tmp = Float64(Float64(b - a) * t); elseif (b <= -1.95e-292) tmp = fma(Float64(1.0 - y), z, Float64(a + x)); elseif (b <= 2.65e+150) tmp = Float64(fma(Float64(1.0 - t), a, z) + x); 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, -9.2e+125], t$95$1, If[LessEqual[b, -1.8e+86], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, -1.95e-292], N[(N[(1.0 - y), $MachinePrecision] * z + N[(a + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.65e+150], N[(N[(N[(1.0 - t), $MachinePrecision] * a + z), $MachinePrecision] + x), $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 -9.2 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.8 \cdot 10^{+86}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;b \leq -1.95 \cdot 10^{-292}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, a + x\right)\\
\mathbf{elif}\;b \leq 2.65 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, z\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.20000000000000051e125 or 2.65000000000000007e150 < b Initial program 86.8%
Taylor expanded in y around 0
Applied rewrites93.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6489.4
Applied rewrites89.4%
if -9.20000000000000051e125 < b < -1.80000000000000003e86Initial program 71.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64100.0
Applied rewrites100.0%
if -1.80000000000000003e86 < b < -1.95e-292Initial program 98.6%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in b around 0
Applied rewrites86.7%
Taylor expanded in t around 0
Applied rewrites76.0%
if -1.95e-292 < b < 2.65000000000000007e150Initial program 98.0%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites76.9%
Taylor expanded in b around 0
Applied rewrites68.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -26.0) (not (<= t 7e+112))) (+ (fma (- t 2.0) b z) (fma (- 1.0 t) a x)) (fma (- y 2.0) b (- x (fma (- y 1.0) z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -26.0) || !(t <= 7e+112)) {
tmp = fma((t - 2.0), b, z) + fma((1.0 - t), a, x);
} else {
tmp = fma((y - 2.0), b, (x - fma((y - 1.0), z, -a)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -26.0) || !(t <= 7e+112)) tmp = Float64(fma(Float64(t - 2.0), b, z) + fma(Float64(1.0 - t), a, x)); else tmp = fma(Float64(y - 2.0), b, Float64(x - fma(Float64(y - 1.0), z, Float64(-a)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -26.0], N[Not[LessEqual[t, 7e+112]], $MachinePrecision]], N[(N[(N[(t - 2.0), $MachinePrecision] * b + z), $MachinePrecision] + N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision]), $MachinePrecision], N[(N[(y - 2.0), $MachinePrecision] * b + N[(x - N[(N[(y - 1.0), $MachinePrecision] * z + (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -26 \lor \neg \left(t \leq 7 \cdot 10^{+112}\right):\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, z\right) + \mathsf{fma}\left(1 - t, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, x - \mathsf{fma}\left(y - 1, z, -a\right)\right)\\
\end{array}
\end{array}
if t < -26 or 6.99999999999999994e112 < t Initial program 94.5%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites85.1%
if -26 < t < 6.99999999999999994e112Initial program 93.9%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6491.3
Applied rewrites91.3%
Final simplification89.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -4.25e+46)
t_1
(if (<= t -2.2e-60)
(* (- b z) y)
(if (<= t 2.45e-180)
(fma 1.0 z (+ a x))
(if (<= t 5e+117) (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 <= -4.25e+46) {
tmp = t_1;
} else if (t <= -2.2e-60) {
tmp = (b - z) * y;
} else if (t <= 2.45e-180) {
tmp = fma(1.0, z, (a + x));
} else if (t <= 5e+117) {
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 <= -4.25e+46) tmp = t_1; elseif (t <= -2.2e-60) tmp = Float64(Float64(b - z) * y); elseif (t <= 2.45e-180) tmp = fma(1.0, z, Float64(a + x)); elseif (t <= 5e+117) 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, -4.25e+46], t$95$1, If[LessEqual[t, -2.2e-60], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 2.45e-180], N[(1.0 * z + N[(a + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e+117], 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 -4.25 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.2 \cdot 10^{-60}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{elif}\;t \leq 2.45 \cdot 10^{-180}:\\
\;\;\;\;\mathsf{fma}\left(1, z, a + x\right)\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.2499999999999998e46 or 4.99999999999999983e117 < t Initial program 94.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6477.0
Applied rewrites77.0%
if -4.2499999999999998e46 < t < -2.1999999999999999e-60Initial program 99.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6454.1
Applied rewrites54.1%
if -2.1999999999999999e-60 < t < 2.4500000000000001e-180Initial program 96.7%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in b around 0
Applied rewrites66.5%
Taylor expanded in t around 0
Applied rewrites66.5%
Taylor expanded in y around 0
Applied rewrites56.1%
if 2.4500000000000001e-180 < t < 4.99999999999999983e117Initial program 87.9%
Taylor expanded in y around 0
Applied rewrites96.6%
Taylor expanded in b around 0
Applied rewrites69.5%
Taylor expanded in a around 0
Applied rewrites63.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -3.6e+104) (not (<= b 9.8e+66))) (fma (- 1.0 t) a (fma (- (+ t y) 2.0) b x)) (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 <= -3.6e+104) || !(b <= 9.8e+66)) {
tmp = fma((1.0 - t), a, fma(((t + y) - 2.0), b, x));
} 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 <= -3.6e+104) || !(b <= 9.8e+66)) tmp = fma(Float64(1.0 - t), a, fma(Float64(Float64(t + y) - 2.0), b, x)); 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, -3.6e+104], N[Not[LessEqual[b, 9.8e+66]], $MachinePrecision]], N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $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 -3.6 \cdot 10^{+104} \lor \neg \left(b \leq 9.8 \cdot 10^{+66}\right):\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(1 - t, a, x\right)\right)\\
\end{array}
\end{array}
if b < -3.60000000000000001e104 or 9.7999999999999995e66 < b Initial program 87.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
associate-+l-N/A
distribute-lft-out--N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
distribute-lft-out--N/A
*-rgt-identityN/A
distribute-lft-out--N/A
mul-1-negN/A
distribute-lft-neg-outN/A
Applied rewrites90.1%
if -3.60000000000000001e104 < b < 9.7999999999999995e66Initial program 98.2%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in b around 0
Applied rewrites86.7%
Final simplification87.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- a) t a)))
(if (<= b -6.4e+126)
(* (- y 2.0) b)
(if (<= b -2.6e+57)
t_1
(if (<= b -2.65e-306)
(* (- 1.0 y) z)
(if (<= b 2.6e+47) t_1 (* (- t 2.0) b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(-a, t, a);
double tmp;
if (b <= -6.4e+126) {
tmp = (y - 2.0) * b;
} else if (b <= -2.6e+57) {
tmp = t_1;
} else if (b <= -2.65e-306) {
tmp = (1.0 - y) * z;
} else if (b <= 2.6e+47) {
tmp = t_1;
} else {
tmp = (t - 2.0) * b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(-a), t, a) tmp = 0.0 if (b <= -6.4e+126) tmp = Float64(Float64(y - 2.0) * b); elseif (b <= -2.6e+57) tmp = t_1; elseif (b <= -2.65e-306) tmp = Float64(Float64(1.0 - y) * z); elseif (b <= 2.6e+47) tmp = t_1; else tmp = Float64(Float64(t - 2.0) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-a) * t + a), $MachinePrecision]}, If[LessEqual[b, -6.4e+126], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, -2.6e+57], t$95$1, If[LessEqual[b, -2.65e-306], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[b, 2.6e+47], t$95$1, N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, t, a\right)\\
\mathbf{if}\;b \leq -6.4 \cdot 10^{+126}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\
\mathbf{elif}\;b \leq -2.6 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -2.65 \cdot 10^{-306}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(t - 2\right) \cdot b\\
\end{array}
\end{array}
if b < -6.3999999999999995e126Initial program 85.4%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6471.2
Applied rewrites71.2%
Taylor expanded in b around inf
Applied rewrites69.5%
if -6.3999999999999995e126 < b < -2.6e57 or -2.6499999999999999e-306 < b < 2.60000000000000003e47Initial program 96.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6440.4
Applied rewrites40.4%
Taylor expanded in t around 0
Applied rewrites40.4%
if -2.6e57 < b < -2.6499999999999999e-306Initial program 98.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if 2.60000000000000003e47 < b Initial program 90.7%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6472.6
Applied rewrites72.6%
Taylor expanded in y around 0
Applied rewrites47.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.5e+104) (not (<= b 2.65e+150))) (* (- (+ 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.5e+104) || !(b <= 2.65e+150)) {
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.5e+104) || !(b <= 2.65e+150)) 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.5e+104], N[Not[LessEqual[b, 2.65e+150]], $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.5 \cdot 10^{+104} \lor \neg \left(b \leq 2.65 \cdot 10^{+150}\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.50000000000000017e104 or 2.65000000000000007e150 < b Initial program 86.3%
Taylor expanded in y around 0
Applied rewrites92.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6487.9
Applied rewrites87.9%
if -5.50000000000000017e104 < b < 2.65000000000000007e150Initial program 97.7%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in b around 0
Applied rewrites85.4%
Final simplification86.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -5e+104)
t_1
(if (<= b 1.3e-220)
(fma (- 1.0 y) z (* (- 1.0 t) a))
(if (<= b 2.65e+150) (+ (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 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -5e+104) {
tmp = t_1;
} else if (b <= 1.3e-220) {
tmp = fma((1.0 - y), z, ((1.0 - t) * a));
} else if (b <= 2.65e+150) {
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(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -5e+104) tmp = t_1; elseif (b <= 1.3e-220) tmp = fma(Float64(1.0 - y), z, Float64(Float64(1.0 - t) * a)); elseif (b <= 2.65e+150) tmp = Float64(fma(Float64(1.0 - t), a, z) + x); 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+104], t$95$1, If[LessEqual[b, 1.3e-220], N[(N[(1.0 - y), $MachinePrecision] * z + N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.65e+150], N[(N[(N[(1.0 - t), $MachinePrecision] * a + z), $MachinePrecision] + x), $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^{+104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.3 \cdot 10^{-220}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \left(1 - t\right) \cdot a\right)\\
\mathbf{elif}\;b \leq 2.65 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, z\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -4.9999999999999997e104 or 2.65000000000000007e150 < b Initial program 86.3%
Taylor expanded in y around 0
Applied rewrites92.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6487.9
Applied rewrites87.9%
if -4.9999999999999997e104 < b < 1.3e-220Initial program 98.0%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in b around 0
Applied rewrites89.4%
Taylor expanded in x around 0
Applied rewrites77.8%
if 1.3e-220 < b < 2.65000000000000007e150Initial program 97.3%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites78.9%
Taylor expanded in b around 0
Applied rewrites67.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -9.2e+125)
t_1
(if (<= b -1.8e+86)
(* (- b a) t)
(if (<= b 2.65e+150) (fma (- 1.0 y) z (+ a x)) 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 <= -9.2e+125) {
tmp = t_1;
} else if (b <= -1.8e+86) {
tmp = (b - a) * t;
} else if (b <= 2.65e+150) {
tmp = fma((1.0 - y), z, (a + x));
} 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 <= -9.2e+125) tmp = t_1; elseif (b <= -1.8e+86) tmp = Float64(Float64(b - a) * t); elseif (b <= 2.65e+150) tmp = fma(Float64(1.0 - y), z, Float64(a + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -9.2e+125], t$95$1, If[LessEqual[b, -1.8e+86], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, 2.65e+150], N[(N[(1.0 - y), $MachinePrecision] * z + N[(a + x), $MachinePrecision]), $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 -9.2 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.8 \cdot 10^{+86}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;b \leq 2.65 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, a + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.20000000000000051e125 or 2.65000000000000007e150 < b Initial program 86.8%
Taylor expanded in y around 0
Applied rewrites93.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6489.4
Applied rewrites89.4%
if -9.20000000000000051e125 < b < -1.80000000000000003e86Initial program 71.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64100.0
Applied rewrites100.0%
if -1.80000000000000003e86 < b < 2.65000000000000007e150Initial program 98.2%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in b around 0
Applied rewrites85.1%
Taylor expanded in t around 0
Applied rewrites67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -9.2e+125)
t_1
(if (<= b -1.8e+86)
(* (- b a) t)
(if (<= b 2.65e+150) (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 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -9.2e+125) {
tmp = t_1;
} else if (b <= -1.8e+86) {
tmp = (b - a) * t;
} else if (b <= 2.65e+150) {
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(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -9.2e+125) tmp = t_1; elseif (b <= -1.8e+86) tmp = Float64(Float64(b - a) * t); elseif (b <= 2.65e+150) 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[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -9.2e+125], t$95$1, If[LessEqual[b, -1.8e+86], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, 2.65e+150], N[(N[(1.0 - y), $MachinePrecision] * z + x), $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 -9.2 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.8 \cdot 10^{+86}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;b \leq 2.65 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.20000000000000051e125 or 2.65000000000000007e150 < b Initial program 86.8%
Taylor expanded in y around 0
Applied rewrites93.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6489.4
Applied rewrites89.4%
if -9.20000000000000051e125 < b < -1.80000000000000003e86Initial program 71.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64100.0
Applied rewrites100.0%
if -1.80000000000000003e86 < b < 2.65000000000000007e150Initial program 98.2%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in b around 0
Applied rewrites85.1%
Taylor expanded in a around 0
Applied rewrites55.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -4.25e+46)
t_1
(if (<= t -1.22e-175)
(* (- b z) y)
(if (<= t 5e+117) (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 <= -4.25e+46) {
tmp = t_1;
} else if (t <= -1.22e-175) {
tmp = (b - z) * y;
} else if (t <= 5e+117) {
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 <= -4.25e+46) tmp = t_1; elseif (t <= -1.22e-175) tmp = Float64(Float64(b - z) * y); elseif (t <= 5e+117) 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, -4.25e+46], t$95$1, If[LessEqual[t, -1.22e-175], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 5e+117], 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 -4.25 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.22 \cdot 10^{-175}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.2499999999999998e46 or 4.99999999999999983e117 < t Initial program 94.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6477.0
Applied rewrites77.0%
if -4.2499999999999998e46 < t < -1.2200000000000001e-175Initial program 97.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6448.1
Applied rewrites48.1%
if -1.2200000000000001e-175 < t < 4.99999999999999983e117Initial program 93.0%
Taylor expanded in y around 0
Applied rewrites98.4%
Taylor expanded in b around 0
Applied rewrites68.1%
Taylor expanded in a around 0
Applied rewrites56.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -0.039)
t_1
(if (<= t 4.5e-291)
(* (- y 2.0) b)
(if (<= t 4.5e+111) (* (- 1.0 y) 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 <= -0.039) {
tmp = t_1;
} else if (t <= 4.5e-291) {
tmp = (y - 2.0) * b;
} else if (t <= 4.5e+111) {
tmp = (1.0 - y) * 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 <= (-0.039d0)) then
tmp = t_1
else if (t <= 4.5d-291) then
tmp = (y - 2.0d0) * b
else if (t <= 4.5d+111) then
tmp = (1.0d0 - y) * 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 <= -0.039) {
tmp = t_1;
} else if (t <= 4.5e-291) {
tmp = (y - 2.0) * b;
} else if (t <= 4.5e+111) {
tmp = (1.0 - y) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -0.039: tmp = t_1 elif t <= 4.5e-291: tmp = (y - 2.0) * b elif t <= 4.5e+111: tmp = (1.0 - y) * 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 <= -0.039) tmp = t_1; elseif (t <= 4.5e-291) tmp = Float64(Float64(y - 2.0) * b); elseif (t <= 4.5e+111) tmp = Float64(Float64(1.0 - y) * 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 <= -0.039) tmp = t_1; elseif (t <= 4.5e-291) tmp = (y - 2.0) * b; elseif (t <= 4.5e+111) tmp = (1.0 - y) * 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, -0.039], t$95$1, If[LessEqual[t, 4.5e-291], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 4.5e+111], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -0.039:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-291}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+111}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -0.0389999999999999999 or 4.50000000000000001e111 < t Initial program 94.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6473.4
Applied rewrites73.4%
if -0.0389999999999999999 < t < 4.49999999999999974e-291Initial program 96.2%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6496.1
Applied rewrites96.1%
Taylor expanded in b around inf
Applied rewrites39.6%
if 4.49999999999999974e-291 < t < 4.50000000000000001e111Initial program 91.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6444.4
Applied rewrites44.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- y 2.0) b)))
(if (<= b -6.4e+126)
t_1
(if (<= b 1e+47) (fma (- a) t a) (if (<= b 2.1e+227) t_1 (* b t))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y - 2.0) * b;
double tmp;
if (b <= -6.4e+126) {
tmp = t_1;
} else if (b <= 1e+47) {
tmp = fma(-a, t, a);
} else if (b <= 2.1e+227) {
tmp = t_1;
} else {
tmp = b * t;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y - 2.0) * b) tmp = 0.0 if (b <= -6.4e+126) tmp = t_1; elseif (b <= 1e+47) tmp = fma(Float64(-a), t, a); elseif (b <= 2.1e+227) tmp = t_1; else tmp = Float64(b * t); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -6.4e+126], t$95$1, If[LessEqual[b, 1e+47], N[((-a) * t + a), $MachinePrecision], If[LessEqual[b, 2.1e+227], t$95$1, N[(b * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - 2\right) \cdot b\\
\mathbf{if}\;b \leq -6.4 \cdot 10^{+126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 10^{+47}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, a\right)\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+227}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if b < -6.3999999999999995e126 or 1e47 < b < 2.10000000000000019e227Initial program 87.2%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6472.3
Applied rewrites72.3%
Taylor expanded in b around inf
Applied rewrites60.4%
if -6.3999999999999995e126 < b < 1e47Initial program 97.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6434.0
Applied rewrites34.0%
Taylor expanded in t around 0
Applied rewrites34.0%
if 2.10000000000000019e227 < b Initial program 92.3%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6490.6
Applied rewrites90.6%
Taylor expanded in t around inf
Applied rewrites66.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.25e+46) (not (<= t 7e+112))) (* (- b a) t) (* (- b z) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.25e+46) || !(t <= 7e+112)) {
tmp = (b - a) * t;
} else {
tmp = (b - z) * 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 ((t <= (-4.25d+46)) .or. (.not. (t <= 7d+112))) then
tmp = (b - a) * t
else
tmp = (b - z) * 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 ((t <= -4.25e+46) || !(t <= 7e+112)) {
tmp = (b - a) * t;
} else {
tmp = (b - z) * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4.25e+46) or not (t <= 7e+112): tmp = (b - a) * t else: tmp = (b - z) * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.25e+46) || !(t <= 7e+112)) tmp = Float64(Float64(b - a) * t); else tmp = Float64(Float64(b - z) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -4.25e+46) || ~((t <= 7e+112))) tmp = (b - a) * t; else tmp = (b - z) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.25e+46], N[Not[LessEqual[t, 7e+112]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.25 \cdot 10^{+46} \lor \neg \left(t \leq 7 \cdot 10^{+112}\right):\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\end{array}
\end{array}
if t < -4.2499999999999998e46 or 6.99999999999999994e112 < t Initial program 94.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6476.2
Applied rewrites76.2%
if -4.2499999999999998e46 < t < 6.99999999999999994e112Initial program 94.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6444.9
Applied rewrites44.9%
Final simplification55.4%
(FPCore (x y z t a b) :precision binary64 (if (<= b -6.4e+126) (* (- y 2.0) b) (if (<= b 2.6e+47) (fma (- a) t a) (* (- t 2.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6.4e+126) {
tmp = (y - 2.0) * b;
} else if (b <= 2.6e+47) {
tmp = fma(-a, t, a);
} else {
tmp = (t - 2.0) * b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -6.4e+126) tmp = Float64(Float64(y - 2.0) * b); elseif (b <= 2.6e+47) tmp = fma(Float64(-a), t, a); else tmp = Float64(Float64(t - 2.0) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -6.4e+126], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 2.6e+47], N[((-a) * t + a), $MachinePrecision], N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.4 \cdot 10^{+126}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{+47}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t - 2\right) \cdot b\\
\end{array}
\end{array}
if b < -6.3999999999999995e126Initial program 85.4%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6471.2
Applied rewrites71.2%
Taylor expanded in b around inf
Applied rewrites69.5%
if -6.3999999999999995e126 < b < 2.60000000000000003e47Initial program 97.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6434.0
Applied rewrites34.0%
Taylor expanded in t around 0
Applied rewrites34.0%
if 2.60000000000000003e47 < b Initial program 90.7%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6472.6
Applied rewrites72.6%
Taylor expanded in y around 0
Applied rewrites47.9%
(FPCore (x y z t a b) :precision binary64 (if (<= b -4e+125) (* b y) (if (<= b 1.42e+48) (fma (- a) t a) (* b t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4e+125) {
tmp = b * y;
} else if (b <= 1.42e+48) {
tmp = fma(-a, t, a);
} else {
tmp = b * t;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -4e+125) tmp = Float64(b * y); elseif (b <= 1.42e+48) tmp = fma(Float64(-a), t, a); else tmp = Float64(b * t); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -4e+125], N[(b * y), $MachinePrecision], If[LessEqual[b, 1.42e+48], N[((-a) * t + a), $MachinePrecision], N[(b * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+125}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;b \leq 1.42 \cdot 10^{+48}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if b < -3.9999999999999997e125Initial program 85.7%
Taylor expanded in y around 0
Applied rewrites89.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6488.1
Applied rewrites88.1%
Taylor expanded in y around inf
Applied rewrites57.3%
if -3.9999999999999997e125 < b < 1.42e48Initial program 97.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6434.2
Applied rewrites34.2%
Taylor expanded in t around 0
Applied rewrites34.2%
if 1.42e48 < b Initial program 90.7%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6472.6
Applied rewrites72.6%
Taylor expanded in t around inf
Applied rewrites35.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.1e-5) (not (<= t 2.05e+60))) (* (- t) a) (* b y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.1e-5) || !(t <= 2.05e+60)) {
tmp = -t * a;
} 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 ((t <= (-2.1d-5)) .or. (.not. (t <= 2.05d+60))) then
tmp = -t * a
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 ((t <= -2.1e-5) || !(t <= 2.05e+60)) {
tmp = -t * a;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.1e-5) or not (t <= 2.05e+60): tmp = -t * a else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.1e-5) || !(t <= 2.05e+60)) tmp = Float64(Float64(-t) * a); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.1e-5) || ~((t <= 2.05e+60))) tmp = -t * a; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.1e-5], N[Not[LessEqual[t, 2.05e+60]], $MachinePrecision]], N[((-t) * a), $MachinePrecision], N[(b * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{-5} \lor \neg \left(t \leq 2.05 \cdot 10^{+60}\right):\\
\;\;\;\;\left(-t\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if t < -2.09999999999999988e-5 or 2.05e60 < t Initial program 93.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6441.7
Applied rewrites41.7%
Taylor expanded in t around inf
Applied rewrites41.2%
if -2.09999999999999988e-5 < t < 2.05e60Initial program 94.6%
Taylor expanded in y around 0
Applied rewrites99.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6438.5
Applied rewrites38.5%
Taylor expanded in y around inf
Applied rewrites28.3%
Final simplification33.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.15e-54) (* b y) (if (<= y 6.5e-6) (* 1.0 z) (* (- y) z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.15e-54) {
tmp = b * y;
} else if (y <= 6.5e-6) {
tmp = 1.0 * z;
} else {
tmp = -y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.15d-54)) then
tmp = b * y
else if (y <= 6.5d-6) then
tmp = 1.0d0 * z
else
tmp = -y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.15e-54) {
tmp = b * y;
} else if (y <= 6.5e-6) {
tmp = 1.0 * z;
} else {
tmp = -y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.15e-54: tmp = b * y elif y <= 6.5e-6: tmp = 1.0 * z else: tmp = -y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.15e-54) tmp = Float64(b * y); elseif (y <= 6.5e-6) tmp = Float64(1.0 * z); else tmp = Float64(Float64(-y) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.15e-54) tmp = b * y; elseif (y <= 6.5e-6) tmp = 1.0 * z; else tmp = -y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.15e-54], N[(b * y), $MachinePrecision], If[LessEqual[y, 6.5e-6], N[(1.0 * z), $MachinePrecision], N[((-y) * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{-54}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-6}:\\
\;\;\;\;1 \cdot z\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) \cdot z\\
\end{array}
\end{array}
if y < -1.1499999999999999e-54Initial program 88.2%
Taylor expanded in y around 0
Applied rewrites95.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6449.3
Applied rewrites49.3%
Taylor expanded in y around inf
Applied rewrites39.5%
if -1.1499999999999999e-54 < y < 6.4999999999999996e-6Initial program 98.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6429.0
Applied rewrites29.0%
Taylor expanded in y around 0
Applied rewrites29.0%
if 6.4999999999999996e-6 < y Initial program 93.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6440.6
Applied rewrites40.6%
Taylor expanded in y around inf
Applied rewrites40.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.15e-54) (not (<= y 6.5e-6))) (* b y) (* 1.0 z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.15e-54) || !(y <= 6.5e-6)) {
tmp = b * y;
} else {
tmp = 1.0 * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.15d-54)) .or. (.not. (y <= 6.5d-6))) then
tmp = b * y
else
tmp = 1.0d0 * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.15e-54) || !(y <= 6.5e-6)) {
tmp = b * y;
} else {
tmp = 1.0 * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.15e-54) or not (y <= 6.5e-6): tmp = b * y else: tmp = 1.0 * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.15e-54) || !(y <= 6.5e-6)) tmp = Float64(b * y); else tmp = Float64(1.0 * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.15e-54) || ~((y <= 6.5e-6))) tmp = b * y; else tmp = 1.0 * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.15e-54], N[Not[LessEqual[y, 6.5e-6]], $MachinePrecision]], N[(b * y), $MachinePrecision], N[(1.0 * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{-54} \lor \neg \left(y \leq 6.5 \cdot 10^{-6}\right):\\
\;\;\;\;b \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot z\\
\end{array}
\end{array}
if y < -1.1499999999999999e-54 or 6.4999999999999996e-6 < y Initial program 90.8%
Taylor expanded in y around 0
Applied rewrites97.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6445.4
Applied rewrites45.4%
Taylor expanded in y around inf
Applied rewrites36.2%
if -1.1499999999999999e-54 < y < 6.4999999999999996e-6Initial program 98.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6429.0
Applied rewrites29.0%
Taylor expanded in y around 0
Applied rewrites29.0%
Final simplification33.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -24000000000000.0) (not (<= y 3.4e+50))) (* b y) (* b t)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -24000000000000.0) || !(y <= 3.4e+50)) {
tmp = b * y;
} 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 ((y <= (-24000000000000.0d0)) .or. (.not. (y <= 3.4d+50))) then
tmp = b * y
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 ((y <= -24000000000000.0) || !(y <= 3.4e+50)) {
tmp = b * y;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -24000000000000.0) or not (y <= 3.4e+50): tmp = b * y else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -24000000000000.0) || !(y <= 3.4e+50)) tmp = Float64(b * y); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -24000000000000.0) || ~((y <= 3.4e+50))) tmp = b * y; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -24000000000000.0], N[Not[LessEqual[y, 3.4e+50]], $MachinePrecision]], N[(b * y), $MachinePrecision], N[(b * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -24000000000000 \lor \neg \left(y \leq 3.4 \cdot 10^{+50}\right):\\
\;\;\;\;b \cdot y\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if y < -2.4e13 or 3.3999999999999998e50 < y Initial program 89.8%
Taylor expanded in y around 0
Applied rewrites96.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6446.3
Applied rewrites46.3%
Taylor expanded in y around inf
Applied rewrites40.2%
if -2.4e13 < y < 3.3999999999999998e50Initial program 98.4%
Taylor expanded in y around 0
Applied rewrites98.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6430.2
Applied rewrites30.2%
Taylor expanded in t around inf
Applied rewrites21.2%
Final simplification30.6%
(FPCore (x y z t a b) :precision binary64 (* b t))
double code(double x, double y, double z, double t, double a, double b) {
return b * t;
}
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 = b * t
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return b * t;
}
def code(x, y, z, t, a, b): return b * t
function code(x, y, z, t, a, b) return Float64(b * t) end
function tmp = code(x, y, z, t, a, b) tmp = b * t; end
code[x_, y_, z_, t_, a_, b_] := N[(b * t), $MachinePrecision]
\begin{array}{l}
\\
b \cdot t
\end{array}
Initial program 94.1%
Taylor expanded in y around 0
Applied rewrites97.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6438.2
Applied rewrites38.2%
Taylor expanded in t around inf
Applied rewrites15.6%
herbie shell --seed 2024339
(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)))