
(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 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (fma (- b a) t (fma (- y 2.0) b (- x (fma (- y 1.0) z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((b - a), t, fma((y - 2.0), b, (x - fma((y - 1.0), z, -a))));
}
function code(x, y, z, t, a, b) return fma(Float64(b - a), t, fma(Float64(y - 2.0), b, Float64(x - fma(Float64(y - 1.0), z, Float64(-a))))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b + N[(x - N[(N[(y - 1.0), $MachinePrecision] * z + (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, x - \mathsf{fma}\left(y - 1, z, -a\right)\right)\right)
\end{array}
Initial program 95.7%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites98.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -19.5) (not (<= z 3.3e-48))) (fma (- 1.0 t) a (fma (- (+ t y) 2.0) b (fma (- z) y z))) (fma (- b a) t (+ (fma (- y 2.0) b x) a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -19.5) || !(z <= 3.3e-48)) {
tmp = fma((1.0 - t), a, fma(((t + y) - 2.0), b, fma(-z, y, z)));
} else {
tmp = fma((b - a), t, (fma((y - 2.0), b, x) + a));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -19.5) || !(z <= 3.3e-48)) tmp = fma(Float64(1.0 - t), a, fma(Float64(Float64(t + y) - 2.0), b, fma(Float64(-z), y, z))); else tmp = fma(Float64(b - a), t, Float64(fma(Float64(y - 2.0), b, x) + a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -19.5], N[Not[LessEqual[z, 3.3e-48]], $MachinePrecision]], N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[((-z) * y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * t + N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -19.5 \lor \neg \left(z \leq 3.3 \cdot 10^{-48}\right):\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, \mathsf{fma}\left(-z, y, z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, x\right) + a\right)\\
\end{array}
\end{array}
if z < -19.5 or 3.3e-48 < z Initial program 92.9%
Taylor expanded in x around 0
associate--r+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
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate--l+N/A
Applied rewrites94.5%
if -19.5 < z < 3.3e-48Initial program 99.1%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in z around 0
Applied rewrites95.9%
Final simplification95.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ z x) a)) (t_2 (* (- b a) t)))
(if (<= t -9.2e+51)
t_2
(if (<= t -7.5e-116)
t_1
(if (<= t -1.2e-267)
(* (- 1.0 y) z)
(if (<= t 4.5e-226) (* (- y 2.0) b) (if (<= t 3.9e+39) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + x) + a;
double t_2 = (b - a) * t;
double tmp;
if (t <= -9.2e+51) {
tmp = t_2;
} else if (t <= -7.5e-116) {
tmp = t_1;
} else if (t <= -1.2e-267) {
tmp = (1.0 - y) * z;
} else if (t <= 4.5e-226) {
tmp = (y - 2.0) * b;
} else if (t <= 3.9e+39) {
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 = (z + x) + a
t_2 = (b - a) * t
if (t <= (-9.2d+51)) then
tmp = t_2
else if (t <= (-7.5d-116)) then
tmp = t_1
else if (t <= (-1.2d-267)) then
tmp = (1.0d0 - y) * z
else if (t <= 4.5d-226) then
tmp = (y - 2.0d0) * b
else if (t <= 3.9d+39) 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 = (z + x) + a;
double t_2 = (b - a) * t;
double tmp;
if (t <= -9.2e+51) {
tmp = t_2;
} else if (t <= -7.5e-116) {
tmp = t_1;
} else if (t <= -1.2e-267) {
tmp = (1.0 - y) * z;
} else if (t <= 4.5e-226) {
tmp = (y - 2.0) * b;
} else if (t <= 3.9e+39) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + x) + a t_2 = (b - a) * t tmp = 0 if t <= -9.2e+51: tmp = t_2 elif t <= -7.5e-116: tmp = t_1 elif t <= -1.2e-267: tmp = (1.0 - y) * z elif t <= 4.5e-226: tmp = (y - 2.0) * b elif t <= 3.9e+39: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + x) + a) t_2 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -9.2e+51) tmp = t_2; elseif (t <= -7.5e-116) tmp = t_1; elseif (t <= -1.2e-267) tmp = Float64(Float64(1.0 - y) * z); elseif (t <= 4.5e-226) tmp = Float64(Float64(y - 2.0) * b); elseif (t <= 3.9e+39) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + x) + a; t_2 = (b - a) * t; tmp = 0.0; if (t <= -9.2e+51) tmp = t_2; elseif (t <= -7.5e-116) tmp = t_1; elseif (t <= -1.2e-267) tmp = (1.0 - y) * z; elseif (t <= 4.5e-226) tmp = (y - 2.0) * b; elseif (t <= 3.9e+39) 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[(z + x), $MachinePrecision] + a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -9.2e+51], t$95$2, If[LessEqual[t, -7.5e-116], t$95$1, If[LessEqual[t, -1.2e-267], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 4.5e-226], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 3.9e+39], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + x\right) + a\\
t_2 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{+51}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{-267}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-226}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -9.2000000000000002e51 or 3.9000000000000001e39 < t Initial program 91.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6474.1
Applied rewrites74.1%
if -9.2000000000000002e51 < t < -7.5000000000000004e-116 or 4.50000000000000011e-226 < t < 3.9000000000000001e39Initial program 97.8%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites64.3%
Taylor expanded in t around 0
Applied rewrites56.0%
Taylor expanded in b around 0
Applied rewrites44.7%
if -7.5000000000000004e-116 < t < -1.1999999999999999e-267Initial program 96.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6459.9
Applied rewrites59.9%
if -1.1999999999999999e-267 < t < 4.50000000000000011e-226Initial program 99.9%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites99.9%
Taylor expanded in z around 0
Applied rewrites74.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6450.5
Applied rewrites50.5%
Taylor expanded in t around 0
Applied rewrites50.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -3.6e+34)
t_1
(if (<= y 2.45e-26)
(+ (fma (- t 2.0) b z) x)
(if (<= y 5.4e+127) (+ (* b t) (fma (- 1.0 t) a x)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -3.6e+34) {
tmp = t_1;
} else if (y <= 2.45e-26) {
tmp = fma((t - 2.0), b, z) + x;
} else if (y <= 5.4e+127) {
tmp = (b * t) + fma((1.0 - t), a, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -3.6e+34) tmp = t_1; elseif (y <= 2.45e-26) tmp = Float64(fma(Float64(t - 2.0), b, z) + x); elseif (y <= 5.4e+127) tmp = Float64(Float64(b * t) + fma(Float64(1.0 - t), a, x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -3.6e+34], t$95$1, If[LessEqual[y, 2.45e-26], N[(N[(N[(t - 2.0), $MachinePrecision] * b + z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 5.4e+127], N[(N[(b * t), $MachinePrecision] + N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{-26}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, z\right) + x\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+127}:\\
\;\;\;\;b \cdot t + \mathsf{fma}\left(1 - t, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.6e34 or 5.4000000000000004e127 < y Initial program 92.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.6
Applied rewrites79.6%
if -3.6e34 < y < 2.45e-26Initial program 98.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 rewrites96.6%
Taylor expanded in a around 0
Applied rewrites74.3%
if 2.45e-26 < y < 5.4000000000000004e127Initial program 96.8%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites63.3%
Taylor expanded in t around inf
Applied rewrites62.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -7e+35) (not (<= b 8e+26))) (fma (- 1.0 t) a (fma (- (+ t y) 2.0) b x)) (fma (- 1.0 t) a (fma (- z) (- y 1.0) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -7e+35) || !(b <= 8e+26)) {
tmp = fma((1.0 - t), a, fma(((t + y) - 2.0), b, x));
} else {
tmp = fma((1.0 - t), a, fma(-z, (y - 1.0), x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -7e+35) || !(b <= 8e+26)) tmp = fma(Float64(1.0 - t), a, fma(Float64(Float64(t + y) - 2.0), b, x)); else tmp = fma(Float64(1.0 - t), a, fma(Float64(-z), Float64(y - 1.0), x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -7e+35], N[Not[LessEqual[b, 8e+26]], $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 - t), $MachinePrecision] * a + N[((-z) * N[(y - 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{+35} \lor \neg \left(b \leq 8 \cdot 10^{+26}\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 - t, a, \mathsf{fma}\left(-z, y - 1, x\right)\right)\\
\end{array}
\end{array}
if b < -7.0000000000000001e35 or 8.00000000000000038e26 < b Initial program 92.8%
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 rewrites88.3%
if -7.0000000000000001e35 < b < 8.00000000000000038e26Initial program 98.4%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites99.2%
Taylor expanded in b around 0
Applied rewrites88.4%
Final simplification88.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.15e+37) (not (<= y 5.2e+127))) (* (- 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) {
double tmp;
if ((y <= -1.15e+37) || !(y <= 5.2e+127)) {
tmp = (b - z) * y;
} else {
tmp = fma((t - 2.0), b, z) + fma((1.0 - t), a, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.15e+37) || !(y <= 5.2e+127)) tmp = Float64(Float64(b - z) * y); else tmp = Float64(fma(Float64(t - 2.0), b, z) + fma(Float64(1.0 - t), a, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.15e+37], N[Not[LessEqual[y, 5.2e+127]], $MachinePrecision]], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(t - 2.0), $MachinePrecision] * b + z), $MachinePrecision] + N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+37} \lor \neg \left(y \leq 5.2 \cdot 10^{+127}\right):\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, z\right) + \mathsf{fma}\left(1 - t, a, x\right)\\
\end{array}
\end{array}
if y < -1.15000000000000001e37 or 5.2000000000000004e127 < y Initial program 92.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.6
Applied rewrites79.6%
if -1.15000000000000001e37 < y < 5.2000000000000004e127Initial 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 rewrites89.6%
Final simplification85.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.42e+81) (not (<= b 1.9e+30))) (fma (- b a) t (+ (* (- y 2.0) b) a)) (fma (- 1.0 t) a (fma (- z) (- y 1.0) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.42e+81) || !(b <= 1.9e+30)) {
tmp = fma((b - a), t, (((y - 2.0) * b) + a));
} else {
tmp = fma((1.0 - t), a, fma(-z, (y - 1.0), x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.42e+81) || !(b <= 1.9e+30)) tmp = fma(Float64(b - a), t, Float64(Float64(Float64(y - 2.0) * b) + a)); else tmp = fma(Float64(1.0 - t), a, fma(Float64(-z), Float64(y - 1.0), x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.42e+81], N[Not[LessEqual[b, 1.9e+30]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t + N[(N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t), $MachinePrecision] * a + N[((-z) * N[(y - 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.42 \cdot 10^{+81} \lor \neg \left(b \leq 1.9 \cdot 10^{+30}\right):\\
\;\;\;\;\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b + a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(-z, y - 1, x\right)\right)\\
\end{array}
\end{array}
if b < -1.41999999999999998e81 or 1.9000000000000001e30 < b Initial program 92.5%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites96.7%
Taylor expanded in z around 0
Applied rewrites87.0%
Taylor expanded in x around 0
Applied rewrites81.3%
if -1.41999999999999998e81 < b < 1.9000000000000001e30Initial program 98.5%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites99.3%
Taylor expanded in b around 0
Applied rewrites87.0%
Final simplification84.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -2.9e+47)
(* (- (+ t y) 2.0) b)
(if (<= b 5.2e+112)
(fma (- 1.0 t) a (fma (- z) (- y 1.0) x))
(fma y b (* (- t 2.0) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.9e+47) {
tmp = ((t + y) - 2.0) * b;
} else if (b <= 5.2e+112) {
tmp = fma((1.0 - t), a, fma(-z, (y - 1.0), x));
} else {
tmp = fma(y, b, ((t - 2.0) * b));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.9e+47) tmp = Float64(Float64(Float64(t + y) - 2.0) * b); elseif (b <= 5.2e+112) tmp = fma(Float64(1.0 - t), a, fma(Float64(-z), Float64(y - 1.0), x)); else tmp = fma(y, b, Float64(Float64(t - 2.0) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.9e+47], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 5.2e+112], N[(N[(1.0 - t), $MachinePrecision] * a + N[((-z) * N[(y - 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(y * b + N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.9 \cdot 10^{+47}:\\
\;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(-z, y - 1, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, b, \left(t - 2\right) \cdot b\right)\\
\end{array}
\end{array}
if b < -2.8999999999999998e47Initial program 94.5%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites96.3%
Taylor expanded in z around 0
Applied rewrites91.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6484.2
Applied rewrites84.2%
if -2.8999999999999998e47 < b < 5.2000000000000001e112Initial program 98.1%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites99.4%
Taylor expanded in b around 0
Applied rewrites83.9%
if 5.2000000000000001e112 < b Initial program 88.9%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites95.5%
Taylor expanded in z around 0
Applied rewrites84.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6481.9
Applied rewrites81.9%
Applied rewrites82.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.15e+37) (not (<= y 5.2e+127))) (* (- b z) y) (fma (- b a) t (+ (fma -2.0 b x) a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.15e+37) || !(y <= 5.2e+127)) {
tmp = (b - z) * y;
} else {
tmp = fma((b - a), t, (fma(-2.0, b, x) + a));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.15e+37) || !(y <= 5.2e+127)) tmp = Float64(Float64(b - z) * y); else tmp = fma(Float64(b - a), t, Float64(fma(-2.0, b, x) + a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.15e+37], N[Not[LessEqual[y, 5.2e+127]], $MachinePrecision]], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * t + N[(N[(-2.0 * b + x), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+37} \lor \neg \left(y \leq 5.2 \cdot 10^{+127}\right):\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(-2, b, x\right) + a\right)\\
\end{array}
\end{array}
if y < -1.15000000000000001e37 or 5.2000000000000004e127 < y Initial program 92.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.6
Applied rewrites79.6%
if -1.15000000000000001e37 < y < 5.2000000000000004e127Initial program 98.0%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites98.7%
Taylor expanded in z around 0
Applied rewrites80.5%
Taylor expanded in y around 0
Applied rewrites76.5%
Final simplification77.8%
(FPCore (x y z t a b) :precision binary64 (fma (- b z) y (+ (fma (- t 2.0) b z) (fma (- 1.0 t) a x))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((b - z), y, (fma((t - 2.0), b, z) + fma((1.0 - t), a, x)));
}
function code(x, y, z, t, a, b) return fma(Float64(b - z), y, Float64(fma(Float64(t - 2.0), b, z) + fma(Float64(1.0 - t), a, x))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(b - z), $MachinePrecision] * y + N[(N[(N[(t - 2.0), $MachinePrecision] * b + z), $MachinePrecision] + N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(b - z, y, \mathsf{fma}\left(t - 2, b, z\right) + \mathsf{fma}\left(1 - t, a, x\right)\right)
\end{array}
Initial program 95.7%
Taylor expanded in y around 0
Applied rewrites97.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.75e+41)
(* b t)
(if (<= t 1.75e-272)
(* b y)
(if (<= t 4.5e-72) (* -2.0 b) (if (<= t 2.1e+60) (* b y) (* b t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.75e+41) {
tmp = b * t;
} else if (t <= 1.75e-272) {
tmp = b * y;
} else if (t <= 4.5e-72) {
tmp = -2.0 * b;
} else if (t <= 2.1e+60) {
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 (t <= (-1.75d+41)) then
tmp = b * t
else if (t <= 1.75d-272) then
tmp = b * y
else if (t <= 4.5d-72) then
tmp = (-2.0d0) * b
else if (t <= 2.1d+60) 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 (t <= -1.75e+41) {
tmp = b * t;
} else if (t <= 1.75e-272) {
tmp = b * y;
} else if (t <= 4.5e-72) {
tmp = -2.0 * b;
} else if (t <= 2.1e+60) {
tmp = b * y;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.75e+41: tmp = b * t elif t <= 1.75e-272: tmp = b * y elif t <= 4.5e-72: tmp = -2.0 * b elif t <= 2.1e+60: tmp = b * y else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.75e+41) tmp = Float64(b * t); elseif (t <= 1.75e-272) tmp = Float64(b * y); elseif (t <= 4.5e-72) tmp = Float64(-2.0 * b); elseif (t <= 2.1e+60) 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 (t <= -1.75e+41) tmp = b * t; elseif (t <= 1.75e-272) tmp = b * y; elseif (t <= 4.5e-72) tmp = -2.0 * b; elseif (t <= 2.1e+60) tmp = b * y; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.75e+41], N[(b * t), $MachinePrecision], If[LessEqual[t, 1.75e-272], N[(b * y), $MachinePrecision], If[LessEqual[t, 4.5e-72], N[(-2.0 * b), $MachinePrecision], If[LessEqual[t, 2.1e+60], N[(b * y), $MachinePrecision], N[(b * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+41}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-272}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-72}:\\
\;\;\;\;-2 \cdot b\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{+60}:\\
\;\;\;\;b \cdot y\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -1.75e41 or 2.1000000000000001e60 < t Initial program 92.6%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites94.7%
Taylor expanded in b around -inf
Applied rewrites49.8%
Taylor expanded in t around inf
Applied rewrites44.7%
if -1.75e41 < t < 1.7499999999999998e-272 or 4.5e-72 < t < 2.1000000000000001e60Initial program 96.2%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in b around -inf
Applied rewrites38.5%
Taylor expanded in y around inf
Applied rewrites28.7%
if 1.7499999999999998e-272 < t < 4.5e-72Initial program 100.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 rewrites64.6%
Taylor expanded in t around 0
Applied rewrites64.6%
Taylor expanded in b around inf
Applied rewrites27.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -1.45e+25)
t_1
(if (<= b 2.6e-253)
(* (- 1.0 y) z)
(if (<= b 1.9e+30) (+ (+ 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 <= -1.45e+25) {
tmp = t_1;
} else if (b <= 2.6e-253) {
tmp = (1.0 - y) * z;
} else if (b <= 1.9e+30) {
tmp = (z + x) + a;
} 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 + y) - 2.0d0) * b
if (b <= (-1.45d+25)) then
tmp = t_1
else if (b <= 2.6d-253) then
tmp = (1.0d0 - y) * z
else if (b <= 1.9d+30) then
tmp = (z + x) + a
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 + y) - 2.0) * b;
double tmp;
if (b <= -1.45e+25) {
tmp = t_1;
} else if (b <= 2.6e-253) {
tmp = (1.0 - y) * z;
} else if (b <= 1.9e+30) {
tmp = (z + x) + a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t + y) - 2.0) * b tmp = 0 if b <= -1.45e+25: tmp = t_1 elif b <= 2.6e-253: tmp = (1.0 - y) * z elif b <= 1.9e+30: tmp = (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 <= -1.45e+25) tmp = t_1; elseif (b <= 2.6e-253) tmp = Float64(Float64(1.0 - y) * z); elseif (b <= 1.9e+30) tmp = Float64(Float64(z + x) + a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t + y) - 2.0) * b; tmp = 0.0; if (b <= -1.45e+25) tmp = t_1; elseif (b <= 2.6e-253) tmp = (1.0 - y) * z; elseif (b <= 1.9e+30) tmp = (z + x) + a; else tmp = t_1; end tmp_2 = 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, -1.45e+25], t$95$1, If[LessEqual[b, 2.6e-253], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[b, 1.9e+30], N[(N[(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 -1.45 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{-253}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{+30}:\\
\;\;\;\;\left(z + x\right) + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.44999999999999995e25 or 1.9000000000000001e30 < b Initial program 92.8%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites96.8%
Taylor expanded in z around 0
Applied rewrites86.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6475.1
Applied rewrites75.1%
if -1.44999999999999995e25 < b < 2.6e-253Initial program 97.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6452.3
Applied rewrites52.3%
if 2.6e-253 < b < 1.9000000000000001e30Initial program 100.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.0%
Taylor expanded in t around 0
Applied rewrites51.5%
Taylor expanded in b around 0
Applied rewrites49.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -3.5e+33)
t_1
(if (<= y -1.7e-51)
(* (- b a) t)
(if (<= y 400000.0) (+ (fma -2.0 b z) a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -3.5e+33) {
tmp = t_1;
} else if (y <= -1.7e-51) {
tmp = (b - a) * t;
} else if (y <= 400000.0) {
tmp = fma(-2.0, b, z) + a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -3.5e+33) tmp = t_1; elseif (y <= -1.7e-51) tmp = Float64(Float64(b - a) * t); elseif (y <= 400000.0) tmp = Float64(fma(-2.0, b, z) + a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -3.5e+33], t$95$1, If[LessEqual[y, -1.7e-51], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 400000.0], N[(N[(-2.0 * b + z), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.7 \cdot 10^{-51}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;y \leq 400000:\\
\;\;\;\;\mathsf{fma}\left(-2, b, z\right) + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.5000000000000001e33 or 4e5 < y Initial program 93.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.0
Applied rewrites71.0%
if -3.5000000000000001e33 < y < -1.70000000000000001e-51Initial program 94.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6454.5
Applied rewrites54.5%
if -1.70000000000000001e-51 < y < 4e5Initial program 99.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 rewrites98.4%
Taylor expanded in t around 0
Applied rewrites64.9%
Taylor expanded in x around 0
Applied rewrites47.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -2.9e+47)
(* (- y 2.0) b)
(if (<= b 2.6e-253)
(* (- 1.0 y) z)
(if (<= b 1.4e+113) (+ (+ z x) a) (* (- t 2.0) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.9e+47) {
tmp = (y - 2.0) * b;
} else if (b <= 2.6e-253) {
tmp = (1.0 - y) * z;
} else if (b <= 1.4e+113) {
tmp = (z + x) + a;
} else {
tmp = (t - 2.0) * b;
}
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.9d+47)) then
tmp = (y - 2.0d0) * b
else if (b <= 2.6d-253) then
tmp = (1.0d0 - y) * z
else if (b <= 1.4d+113) then
tmp = (z + x) + a
else
tmp = (t - 2.0d0) * b
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.9e+47) {
tmp = (y - 2.0) * b;
} else if (b <= 2.6e-253) {
tmp = (1.0 - y) * z;
} else if (b <= 1.4e+113) {
tmp = (z + x) + a;
} else {
tmp = (t - 2.0) * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -2.9e+47: tmp = (y - 2.0) * b elif b <= 2.6e-253: tmp = (1.0 - y) * z elif b <= 1.4e+113: tmp = (z + x) + a else: tmp = (t - 2.0) * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.9e+47) tmp = Float64(Float64(y - 2.0) * b); elseif (b <= 2.6e-253) tmp = Float64(Float64(1.0 - y) * z); elseif (b <= 1.4e+113) tmp = Float64(Float64(z + x) + a); else tmp = Float64(Float64(t - 2.0) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -2.9e+47) tmp = (y - 2.0) * b; elseif (b <= 2.6e-253) tmp = (1.0 - y) * z; elseif (b <= 1.4e+113) tmp = (z + x) + a; else tmp = (t - 2.0) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.9e+47], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 2.6e-253], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[b, 1.4e+113], N[(N[(z + x), $MachinePrecision] + a), $MachinePrecision], N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.9 \cdot 10^{+47}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{-253}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{+113}:\\
\;\;\;\;\left(z + x\right) + a\\
\mathbf{else}:\\
\;\;\;\;\left(t - 2\right) \cdot b\\
\end{array}
\end{array}
if b < -2.8999999999999998e47Initial program 94.5%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites96.3%
Taylor expanded in z around 0
Applied rewrites91.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6484.2
Applied rewrites84.2%
Taylor expanded in t around 0
Applied rewrites61.8%
if -2.8999999999999998e47 < b < 2.6e-253Initial program 97.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6451.0
Applied rewrites51.0%
if 2.6e-253 < b < 1.39999999999999999e113Initial program 98.7%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites75.7%
Taylor expanded in t around 0
Applied rewrites48.4%
Taylor expanded in b around 0
Applied rewrites44.3%
if 1.39999999999999999e113 < b Initial program 88.9%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites60.7%
Taylor expanded in t around 0
Applied rewrites24.6%
Taylor expanded in b around inf
Applied rewrites51.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -1.92e+46)
(* (- y 2.0) b)
(if (<= b -6.2e-167)
(* (- y) z)
(if (<= b 1.4e+113) (+ (+ z x) a) (* (- t 2.0) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.92e+46) {
tmp = (y - 2.0) * b;
} else if (b <= -6.2e-167) {
tmp = -y * z;
} else if (b <= 1.4e+113) {
tmp = (z + x) + a;
} else {
tmp = (t - 2.0) * b;
}
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 <= (-1.92d+46)) then
tmp = (y - 2.0d0) * b
else if (b <= (-6.2d-167)) then
tmp = -y * z
else if (b <= 1.4d+113) then
tmp = (z + x) + a
else
tmp = (t - 2.0d0) * b
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 <= -1.92e+46) {
tmp = (y - 2.0) * b;
} else if (b <= -6.2e-167) {
tmp = -y * z;
} else if (b <= 1.4e+113) {
tmp = (z + x) + a;
} else {
tmp = (t - 2.0) * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.92e+46: tmp = (y - 2.0) * b elif b <= -6.2e-167: tmp = -y * z elif b <= 1.4e+113: tmp = (z + x) + a else: tmp = (t - 2.0) * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.92e+46) tmp = Float64(Float64(y - 2.0) * b); elseif (b <= -6.2e-167) tmp = Float64(Float64(-y) * z); elseif (b <= 1.4e+113) tmp = Float64(Float64(z + x) + a); else tmp = Float64(Float64(t - 2.0) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.92e+46) tmp = (y - 2.0) * b; elseif (b <= -6.2e-167) tmp = -y * z; elseif (b <= 1.4e+113) tmp = (z + x) + a; else tmp = (t - 2.0) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.92e+46], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, -6.2e-167], N[((-y) * z), $MachinePrecision], If[LessEqual[b, 1.4e+113], N[(N[(z + x), $MachinePrecision] + a), $MachinePrecision], N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.92 \cdot 10^{+46}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\
\mathbf{elif}\;b \leq -6.2 \cdot 10^{-167}:\\
\;\;\;\;\left(-y\right) \cdot z\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{+113}:\\
\;\;\;\;\left(z + x\right) + a\\
\mathbf{else}:\\
\;\;\;\;\left(t - 2\right) \cdot b\\
\end{array}
\end{array}
if b < -1.91999999999999992e46Initial program 94.5%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites96.3%
Taylor expanded in z around 0
Applied rewrites91.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6484.2
Applied rewrites84.2%
Taylor expanded in t around 0
Applied rewrites61.8%
if -1.91999999999999992e46 < b < -6.2e-167Initial program 97.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6450.5
Applied rewrites50.5%
Taylor expanded in y around inf
Applied rewrites45.7%
if -6.2e-167 < b < 1.39999999999999999e113Initial program 98.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 rewrites73.4%
Taylor expanded in t around 0
Applied rewrites46.1%
Taylor expanded in b around 0
Applied rewrites43.2%
if 1.39999999999999999e113 < b Initial program 88.9%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites60.7%
Taylor expanded in t around 0
Applied rewrites24.6%
Taylor expanded in b around inf
Applied rewrites51.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 2.0) b)))
(if (<= b -2.45e+80)
t_1
(if (<= b -6.2e-167)
(* (- y) z)
(if (<= b 1.4e+113) (+ (+ z x) a) 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 <= -2.45e+80) {
tmp = t_1;
} else if (b <= -6.2e-167) {
tmp = -y * z;
} else if (b <= 1.4e+113) {
tmp = (z + x) + a;
} 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 <= (-2.45d+80)) then
tmp = t_1
else if (b <= (-6.2d-167)) then
tmp = -y * z
else if (b <= 1.4d+113) then
tmp = (z + x) + a
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 <= -2.45e+80) {
tmp = t_1;
} else if (b <= -6.2e-167) {
tmp = -y * z;
} else if (b <= 1.4e+113) {
tmp = (z + x) + a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - 2.0) * b tmp = 0 if b <= -2.45e+80: tmp = t_1 elif b <= -6.2e-167: tmp = -y * z elif b <= 1.4e+113: tmp = (z + x) + a 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 <= -2.45e+80) tmp = t_1; elseif (b <= -6.2e-167) tmp = Float64(Float64(-y) * z); elseif (b <= 1.4e+113) tmp = Float64(Float64(z + x) + a); 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 <= -2.45e+80) tmp = t_1; elseif (b <= -6.2e-167) tmp = -y * z; elseif (b <= 1.4e+113) tmp = (z + x) + a; 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, -2.45e+80], t$95$1, If[LessEqual[b, -6.2e-167], N[((-y) * z), $MachinePrecision], If[LessEqual[b, 1.4e+113], N[(N[(z + x), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 2\right) \cdot b\\
\mathbf{if}\;b \leq -2.45 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -6.2 \cdot 10^{-167}:\\
\;\;\;\;\left(-y\right) \cdot z\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{+113}:\\
\;\;\;\;\left(z + x\right) + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.4499999999999998e80 or 1.39999999999999999e113 < b Initial program 91.8%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites62.0%
Taylor expanded in t around 0
Applied rewrites31.2%
Taylor expanded in b around inf
Applied rewrites51.5%
if -2.4499999999999998e80 < b < -6.2e-167Initial program 97.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6450.5
Applied rewrites50.5%
Taylor expanded in y around inf
Applied rewrites45.9%
if -6.2e-167 < b < 1.39999999999999999e113Initial program 98.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 rewrites73.4%
Taylor expanded in t around 0
Applied rewrites46.1%
Taylor expanded in b around 0
Applied rewrites43.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.6e+34) (not (<= y 1.26e+42))) (* (- b z) y) (+ (fma (- t 2.0) b z) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.6e+34) || !(y <= 1.26e+42)) {
tmp = (b - z) * y;
} else {
tmp = fma((t - 2.0), b, z) + x;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.6e+34) || !(y <= 1.26e+42)) tmp = Float64(Float64(b - z) * y); else tmp = Float64(fma(Float64(t - 2.0), b, z) + x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.6e+34], N[Not[LessEqual[y, 1.26e+42]], $MachinePrecision]], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(t - 2.0), $MachinePrecision] * b + z), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+34} \lor \neg \left(y \leq 1.26 \cdot 10^{+42}\right):\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, z\right) + x\\
\end{array}
\end{array}
if y < -3.6e34 or 1.26e42 < y Initial program 92.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6475.0
Applied rewrites75.0%
if -3.6e34 < y < 1.26e42Initial program 98.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 rewrites93.6%
Taylor expanded in a around 0
Applied rewrites71.1%
Final simplification72.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.6e+34) (not (<= y 400000.0))) (* (- b z) y) (+ (+ (fma -2.0 b z) x) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.6e+34) || !(y <= 400000.0)) {
tmp = (b - z) * y;
} else {
tmp = (fma(-2.0, b, z) + x) + a;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.6e+34) || !(y <= 400000.0)) tmp = Float64(Float64(b - z) * y); else tmp = Float64(Float64(fma(-2.0, b, z) + x) + a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.6e+34], N[Not[LessEqual[y, 400000.0]], $MachinePrecision]], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(-2.0 * b + z), $MachinePrecision] + x), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+34} \lor \neg \left(y \leq 400000\right):\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(-2, b, z\right) + x\right) + a\\
\end{array}
\end{array}
if y < -3.6e34 or 4e5 < y Initial program 93.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6472.1
Applied rewrites72.1%
if -3.6e34 < y < 4e5Initial program 98.4%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites96.2%
Taylor expanded in t around 0
Applied rewrites60.9%
Final simplification66.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.6e+34) (not (<= y 400000.0))) (* (- b z) y) (+ (+ z x) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.6e+34) || !(y <= 400000.0)) {
tmp = (b - z) * y;
} 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 ((y <= (-3.6d+34)) .or. (.not. (y <= 400000.0d0))) then
tmp = (b - z) * y
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 ((y <= -3.6e+34) || !(y <= 400000.0)) {
tmp = (b - z) * y;
} else {
tmp = (z + x) + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.6e+34) or not (y <= 400000.0): tmp = (b - z) * y else: tmp = (z + x) + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.6e+34) || !(y <= 400000.0)) tmp = Float64(Float64(b - z) * y); 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 ((y <= -3.6e+34) || ~((y <= 400000.0))) tmp = (b - z) * y; else tmp = (z + x) + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.6e+34], N[Not[LessEqual[y, 400000.0]], $MachinePrecision]], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], N[(N[(z + x), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+34} \lor \neg \left(y \leq 400000\right):\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(z + x\right) + a\\
\end{array}
\end{array}
if y < -3.6e34 or 4e5 < y Initial program 93.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6472.1
Applied rewrites72.1%
if -3.6e34 < y < 4e5Initial program 98.4%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites96.2%
Taylor expanded in t around 0
Applied rewrites60.9%
Taylor expanded in b around 0
Applied rewrites44.9%
Final simplification58.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.9e+36) (not (<= y 23500000.0))) (* (- y) z) (+ (+ z x) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.9e+36) || !(y <= 23500000.0)) {
tmp = -y * z;
} 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 ((y <= (-1.9d+36)) .or. (.not. (y <= 23500000.0d0))) then
tmp = -y * z
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 ((y <= -1.9e+36) || !(y <= 23500000.0)) {
tmp = -y * z;
} else {
tmp = (z + x) + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.9e+36) or not (y <= 23500000.0): tmp = -y * z else: tmp = (z + x) + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.9e+36) || !(y <= 23500000.0)) tmp = Float64(Float64(-y) * z); 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 ((y <= -1.9e+36) || ~((y <= 23500000.0))) tmp = -y * z; else tmp = (z + x) + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.9e+36], N[Not[LessEqual[y, 23500000.0]], $MachinePrecision]], N[((-y) * z), $MachinePrecision], N[(N[(z + x), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+36} \lor \neg \left(y \leq 23500000\right):\\
\;\;\;\;\left(-y\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\left(z + x\right) + a\\
\end{array}
\end{array}
if y < -1.90000000000000012e36 or 2.35e7 < y Initial program 92.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
Taylor expanded in y around inf
Applied rewrites45.6%
if -1.90000000000000012e36 < y < 2.35e7Initial program 98.4%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites95.5%
Taylor expanded in t around 0
Applied rewrites60.5%
Taylor expanded in b around 0
Applied rewrites44.6%
Final simplification45.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.42e+35) (not (<= y 4.8e+38))) (* b y) (+ (+ z x) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.42e+35) || !(y <= 4.8e+38)) {
tmp = b * y;
} 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 ((y <= (-1.42d+35)) .or. (.not. (y <= 4.8d+38))) then
tmp = b * y
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 ((y <= -1.42e+35) || !(y <= 4.8e+38)) {
tmp = b * y;
} else {
tmp = (z + x) + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.42e+35) or not (y <= 4.8e+38): tmp = b * y else: tmp = (z + x) + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.42e+35) || !(y <= 4.8e+38)) tmp = Float64(b * y); 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 ((y <= -1.42e+35) || ~((y <= 4.8e+38))) tmp = b * y; else tmp = (z + x) + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.42e+35], N[Not[LessEqual[y, 4.8e+38]], $MachinePrecision]], N[(b * y), $MachinePrecision], N[(N[(z + x), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.42 \cdot 10^{+35} \lor \neg \left(y \leq 4.8 \cdot 10^{+38}\right):\\
\;\;\;\;b \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(z + x\right) + a\\
\end{array}
\end{array}
if y < -1.41999999999999991e35 or 4.80000000000000035e38 < y Initial program 92.5%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites96.7%
Taylor expanded in b around -inf
Applied rewrites45.6%
Taylor expanded in y around inf
Applied rewrites37.1%
if -1.41999999999999991e35 < y < 4.80000000000000035e38Initial program 98.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 rewrites93.5%
Taylor expanded in t around 0
Applied rewrites58.9%
Taylor expanded in b around 0
Applied rewrites43.8%
Final simplification40.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.75e+41) (not (<= t 2.1e+60))) (* b t) (* b y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.75e+41) || !(t <= 2.1e+60)) {
tmp = b * t;
} 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 <= (-1.75d+41)) .or. (.not. (t <= 2.1d+60))) then
tmp = b * t
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 <= -1.75e+41) || !(t <= 2.1e+60)) {
tmp = b * t;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.75e+41) or not (t <= 2.1e+60): tmp = b * t else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.75e+41) || !(t <= 2.1e+60)) tmp = Float64(b * t); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.75e+41) || ~((t <= 2.1e+60))) tmp = b * t; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.75e+41], N[Not[LessEqual[t, 2.1e+60]], $MachinePrecision]], N[(b * t), $MachinePrecision], N[(b * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+41} \lor \neg \left(t \leq 2.1 \cdot 10^{+60}\right):\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if t < -1.75e41 or 2.1000000000000001e60 < t Initial program 92.6%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites94.7%
Taylor expanded in b around -inf
Applied rewrites49.8%
Taylor expanded in t around inf
Applied rewrites44.7%
if -1.75e41 < t < 2.1000000000000001e60Initial program 97.5%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in b around -inf
Applied rewrites38.3%
Taylor expanded in y around inf
Applied rewrites23.0%
Final simplification31.0%
(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 95.7%
Taylor expanded in t around 0
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate--l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
Applied rewrites98.0%
Taylor expanded in b around -inf
Applied rewrites42.6%
Taylor expanded in t around inf
Applied rewrites18.5%
herbie shell --seed 2024329
(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)))