
(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 20 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 (if (<= b -7.5e+244) (* (- (+ t y) 2.0) b) (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) {
double tmp;
if (b <= -7.5e+244) {
tmp = ((t + y) - 2.0) * b;
} else {
tmp = fma((b - a), t, 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 (b <= -7.5e+244) tmp = Float64(Float64(Float64(t + y) - 2.0) * b); else tmp = fma(Float64(b - a), t, 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[LessEqual[b, -7.5e+244], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.5 \cdot 10^{+244}:\\
\;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\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}
\end{array}
if b < -7.5e244Initial program 75.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64100.0
Applied rewrites100.0%
if -7.5e244 < b Initial program 95.7%
Taylor expanded in t around 0
associate-+r+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
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6499.1
Applied rewrites99.1%
(FPCore (x y z t a b)
:precision binary64
(if (<=
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))
2e+286)
(fma (- b z) y (fma (- t 2.0) b (fma (- 1.0 t) a (+ z x))))
(fma (- 1.0 t) a (fma (- (+ t y) 2.0) b (fma (- z) y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)) <= 2e+286) {
tmp = fma((b - z), y, fma((t - 2.0), b, fma((1.0 - t), a, (z + x))));
} else {
tmp = fma((1.0 - t), a, fma(((t + y) - 2.0), b, fma(-z, y, z)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) <= 2e+286) tmp = fma(Float64(b - z), y, fma(Float64(t - 2.0), b, fma(Float64(1.0 - t), a, Float64(z + x)))); else tmp = fma(Float64(1.0 - t), a, fma(Float64(Float64(t + y) - 2.0), b, fma(Float64(-z), y, z))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], 2e+286], N[(N[(b - z), $MachinePrecision] * y + N[(N[(t - 2.0), $MachinePrecision] * b + N[(N[(1.0 - t), $MachinePrecision] * a + N[(z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \leq 2 \cdot 10^{+286}:\\
\;\;\;\;\mathsf{fma}\left(b - z, y, \mathsf{fma}\left(t - 2, b, \mathsf{fma}\left(1 - t, a, z + x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, \mathsf{fma}\left(-z, y, z\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < 2.00000000000000007e286Initial program 100.0%
Taylor expanded in y around 0
associate-+r+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
+-commutativeN/A
associate--r+N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
Applied rewrites100.0%
if 2.00000000000000007e286 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 73.7%
Taylor expanded in x around 0
associate--r+N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
associate-*r*N/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
*-commutativeN/A
Applied rewrites91.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -8.2e+126)
(fma (- t 2.0) b (fma (- 1.0 t) a (+ z x)))
(if (<= x 7e+195)
(fma (- 1.0 t) a (fma (- (+ t y) 2.0) b (fma (- z) y z)))
(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 (x <= -8.2e+126) {
tmp = fma((t - 2.0), b, fma((1.0 - t), a, (z + x)));
} else if (x <= 7e+195) {
tmp = fma((1.0 - t), a, fma(((t + y) - 2.0), b, fma(-z, y, z)));
} 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 (x <= -8.2e+126) tmp = fma(Float64(t - 2.0), b, fma(Float64(1.0 - t), a, Float64(z + x))); elseif (x <= 7e+195) tmp = fma(Float64(1.0 - t), a, fma(Float64(Float64(t + y) - 2.0), b, fma(Float64(-z), y, z))); 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[LessEqual[x, -8.2e+126], N[(N[(t - 2.0), $MachinePrecision] * b + N[(N[(1.0 - t), $MachinePrecision] * a + N[(z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7e+195], 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[(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}\;x \leq -8.2 \cdot 10^{+126}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, \mathsf{fma}\left(1 - t, a, z + x\right)\right)\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+195}:\\
\;\;\;\;\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(y - 2, b, x - \mathsf{fma}\left(y - 1, z, -a\right)\right)\\
\end{array}
\end{array}
if x < -8.2000000000000001e126Initial program 94.7%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
Applied rewrites82.5%
if -8.2000000000000001e126 < x < 7.0000000000000005e195Initial program 93.2%
Taylor expanded in x around 0
associate--r+N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
associate-*r*N/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
*-commutativeN/A
Applied rewrites96.1%
if 7.0000000000000005e195 < x Initial program 99.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.f6492.5
Applied rewrites92.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ t y) 2.0)))
(if (<= b -3.15e+218)
(* t_1 b)
(if (<= b -8.5e-93)
(fma (- t 2.0) b (fma (- 1.0 t) a (+ z x)))
(if (<= b 1.15e+79)
(fma (- 1.0 t) a (fma (- z) (- y 1.0) x))
(fma t_1 b (* (- z) y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) - 2.0;
double tmp;
if (b <= -3.15e+218) {
tmp = t_1 * b;
} else if (b <= -8.5e-93) {
tmp = fma((t - 2.0), b, fma((1.0 - t), a, (z + x)));
} else if (b <= 1.15e+79) {
tmp = fma((1.0 - t), a, fma(-z, (y - 1.0), x));
} else {
tmp = fma(t_1, b, (-z * y));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) tmp = 0.0 if (b <= -3.15e+218) tmp = Float64(t_1 * b); elseif (b <= -8.5e-93) tmp = fma(Float64(t - 2.0), b, fma(Float64(1.0 - t), a, Float64(z + x))); elseif (b <= 1.15e+79) tmp = fma(Float64(1.0 - t), a, fma(Float64(-z), Float64(y - 1.0), x)); else tmp = fma(t_1, b, Float64(Float64(-z) * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[b, -3.15e+218], N[(t$95$1 * b), $MachinePrecision], If[LessEqual[b, -8.5e-93], N[(N[(t - 2.0), $MachinePrecision] * b + N[(N[(1.0 - t), $MachinePrecision] * a + N[(z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.15e+79], N[(N[(1.0 - t), $MachinePrecision] * a + N[((-z) * N[(y - 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * b + N[((-z) * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
\mathbf{if}\;b \leq -3.15 \cdot 10^{+218}:\\
\;\;\;\;t\_1 \cdot b\\
\mathbf{elif}\;b \leq -8.5 \cdot 10^{-93}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, \mathsf{fma}\left(1 - t, a, z + x\right)\right)\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{+79}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(-z, y - 1, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, \left(-z\right) \cdot y\right)\\
\end{array}
\end{array}
if b < -3.1499999999999998e218Initial program 80.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6496.2
Applied rewrites96.2%
if -3.1499999999999998e218 < b < -8.5000000000000007e-93Initial program 94.6%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
Applied rewrites77.1%
if -8.5000000000000007e-93 < b < 1.15e79Initial program 100.0%
Taylor expanded in t around 0
associate-+r+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
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in b around 0
Applied rewrites94.3%
if 1.15e79 < b Initial program 86.3%
Taylor expanded in y around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6486.5
Applied rewrites86.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6488.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6488.8
Applied rewrites88.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.5e+89) (not (<= y 0.0033))) (fma (- y 2.0) b (- x (fma (- y 1.0) z (- a)))) (fma (- t 2.0) b (fma (- 1.0 t) a (+ z x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.5e+89) || !(y <= 0.0033)) {
tmp = fma((y - 2.0), b, (x - fma((y - 1.0), z, -a)));
} else {
tmp = fma((t - 2.0), b, fma((1.0 - t), a, (z + x)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5.5e+89) || !(y <= 0.0033)) tmp = fma(Float64(y - 2.0), b, Float64(x - fma(Float64(y - 1.0), z, Float64(-a)))); else tmp = fma(Float64(t - 2.0), b, fma(Float64(1.0 - t), a, Float64(z + x))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5.5e+89], N[Not[LessEqual[y, 0.0033]], $MachinePrecision]], N[(N[(y - 2.0), $MachinePrecision] * b + N[(x - N[(N[(y - 1.0), $MachinePrecision] * z + (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - 2.0), $MachinePrecision] * b + N[(N[(1.0 - t), $MachinePrecision] * a + N[(z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+89} \lor \neg \left(y \leq 0.0033\right):\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, x - \mathsf{fma}\left(y - 1, z, -a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, \mathsf{fma}\left(1 - t, a, z + x\right)\right)\\
\end{array}
\end{array}
if y < -5.49999999999999976e89 or 0.0033 < y Initial program 90.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.f6484.0
Applied rewrites84.0%
if -5.49999999999999976e89 < y < 0.0033Initial program 96.5%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
Applied rewrites93.3%
Final simplification89.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -1.85e+220)
t_1
(if (<= b -2.45e-45)
(fma (- t 2.0) b (+ z x))
(if (<= b 7.5e+74) (fma (- 1.0 t) a (fma (- z) y z)) 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.85e+220) {
tmp = t_1;
} else if (b <= -2.45e-45) {
tmp = fma((t - 2.0), b, (z + x));
} else if (b <= 7.5e+74) {
tmp = fma((1.0 - t), a, fma(-z, y, z));
} 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.85e+220) tmp = t_1; elseif (b <= -2.45e-45) tmp = fma(Float64(t - 2.0), b, Float64(z + x)); elseif (b <= 7.5e+74) tmp = fma(Float64(1.0 - t), a, fma(Float64(-z), y, z)); 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, -1.85e+220], t$95$1, If[LessEqual[b, -2.45e-45], N[(N[(t - 2.0), $MachinePrecision] * b + N[(z + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.5e+74], N[(N[(1.0 - t), $MachinePrecision] * a + N[((-z) * y + z), $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 -1.85 \cdot 10^{+220}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -2.45 \cdot 10^{-45}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, z + x\right)\\
\mathbf{elif}\;b \leq 7.5 \cdot 10^{+74}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(-z, y, z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.85e220 or 7.5e74 < b Initial program 84.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6490.2
Applied rewrites90.2%
if -1.85e220 < b < -2.4499999999999999e-45Initial program 93.7%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
Applied rewrites79.2%
Taylor expanded in a around 0
Applied rewrites68.6%
if -2.4499999999999999e-45 < b < 7.5e74Initial program 99.9%
Taylor expanded in x around 0
associate--r+N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
associate-*r*N/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
*-commutativeN/A
Applied rewrites82.8%
Taylor expanded in z around inf
Applied rewrites74.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.35e+48) (not (<= b 1.15e+79))) (fma (- (+ t y) 2.0) b (* (- z) y)) (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 <= -2.35e+48) || !(b <= 1.15e+79)) {
tmp = fma(((t + y) - 2.0), b, (-z * y));
} 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 <= -2.35e+48) || !(b <= 1.15e+79)) tmp = fma(Float64(Float64(t + y) - 2.0), b, Float64(Float64(-z) * y)); 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, -2.35e+48], N[Not[LessEqual[b, 1.15e+79]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[((-z) * y), $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 -2.35 \cdot 10^{+48} \lor \neg \left(b \leq 1.15 \cdot 10^{+79}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, \left(-z\right) \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(-z, y - 1, x\right)\right)\\
\end{array}
\end{array}
if b < -2.35000000000000006e48 or 1.15e79 < b Initial program 87.1%
Taylor expanded in y around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6478.1
Applied rewrites78.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6481.6
lift-+.f64N/A
+-commutativeN/A
lift-+.f6481.6
Applied rewrites81.6%
if -2.35000000000000006e48 < b < 1.15e79Initial program 99.9%
Taylor expanded in t around 0
associate-+r+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
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in b around 0
Applied rewrites89.3%
Final simplification85.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.58) (not (<= y 3.85e-7))) (fma (- (+ t y) 2.0) 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 <= -1.58) || !(y <= 3.85e-7)) {
tmp = fma(((t + y) - 2.0), 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 <= -1.58) || !(y <= 3.85e-7)) tmp = fma(Float64(Float64(t + y) - 2.0), b, Float64(Float64(-z) * y)); else tmp = fma(Float64(t - 2.0), b, Float64(z + x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.58], N[Not[LessEqual[y, 3.85e-7]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[((-z) * y), $MachinePrecision]), $MachinePrecision], N[(N[(t - 2.0), $MachinePrecision] * b + N[(z + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.58 \lor \neg \left(y \leq 3.85 \cdot 10^{-7}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, \left(-z\right) \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, z + x\right)\\
\end{array}
\end{array}
if y < -1.5800000000000001 or 3.8500000000000002e-7 < y Initial program 92.5%
Taylor expanded in y around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6469.0
Applied rewrites69.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6472.0
lift-+.f64N/A
+-commutativeN/A
lift-+.f6472.0
Applied rewrites72.0%
if -1.5800000000000001 < y < 3.8500000000000002e-7Initial program 95.9%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
Applied rewrites96.4%
Taylor expanded in a around 0
Applied rewrites85.1%
Final simplification78.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.9e-7) (not (<= y 0.00073))) (fma (- 1.0 y) z (fma (- y 2.0) b a)) (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.9e-7) || !(y <= 0.00073)) {
tmp = fma((1.0 - y), z, fma((y - 2.0), b, a));
} 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.9e-7) || !(y <= 0.00073)) tmp = fma(Float64(1.0 - y), z, fma(Float64(y - 2.0), b, a)); else tmp = fma(Float64(t - 2.0), b, Float64(z + x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.9e-7], N[Not[LessEqual[y, 0.00073]], $MachinePrecision]], N[(N[(1.0 - y), $MachinePrecision] * z + N[(N[(y - 2.0), $MachinePrecision] * b + a), $MachinePrecision]), $MachinePrecision], N[(N[(t - 2.0), $MachinePrecision] * b + N[(z + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{-7} \lor \neg \left(y \leq 0.00073\right):\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(y - 2, b, a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, z + x\right)\\
\end{array}
\end{array}
if y < -3.90000000000000025e-7 or 7.2999999999999996e-4 < y Initial program 92.4%
Taylor expanded in x around 0
associate--r+N/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
associate-*r*N/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
*-commutativeN/A
Applied rewrites88.2%
Taylor expanded in t around 0
Applied rewrites70.5%
if -3.90000000000000025e-7 < y < 7.2999999999999996e-4Initial program 95.9%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
Applied rewrites96.4%
Taylor expanded in a around 0
Applied rewrites85.2%
Final simplification77.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -6e+89)
t_1
(if (<= y -1.45e-165)
(* (- b a) t)
(if (<= y 780.0) (+ (fma -2.0 b (+ z x)) 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 <= -6e+89) {
tmp = t_1;
} else if (y <= -1.45e-165) {
tmp = (b - a) * t;
} else if (y <= 780.0) {
tmp = fma(-2.0, b, (z + x)) + 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 <= -6e+89) tmp = t_1; elseif (y <= -1.45e-165) tmp = Float64(Float64(b - a) * t); elseif (y <= 780.0) tmp = Float64(fma(-2.0, b, Float64(z + x)) + 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, -6e+89], t$95$1, If[LessEqual[y, -1.45e-165], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 780.0], N[(N[(-2.0 * b + N[(z + x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -6 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-165}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;y \leq 780:\\
\;\;\;\;\mathsf{fma}\left(-2, b, z + x\right) + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.00000000000000025e89 or 780 < y Initial program 90.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.6
Applied rewrites71.6%
if -6.00000000000000025e89 < y < -1.45e-165Initial program 98.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6455.6
Applied rewrites55.6%
if -1.45e-165 < y < 780Initial program 95.6%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
Applied rewrites94.3%
Taylor expanded in t around 0
Applied rewrites67.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -6.8e+40)
(* b t)
(if (<= t -5.5e-102)
(* b y)
(if (<= t 4.5e-174) (* 1.0 z) (if (<= t 5.2e+95) (* b y) (* b t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6.8e+40) {
tmp = b * t;
} else if (t <= -5.5e-102) {
tmp = b * y;
} else if (t <= 4.5e-174) {
tmp = 1.0 * z;
} else if (t <= 5.2e+95) {
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 <= (-6.8d+40)) then
tmp = b * t
else if (t <= (-5.5d-102)) then
tmp = b * y
else if (t <= 4.5d-174) then
tmp = 1.0d0 * z
else if (t <= 5.2d+95) 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 <= -6.8e+40) {
tmp = b * t;
} else if (t <= -5.5e-102) {
tmp = b * y;
} else if (t <= 4.5e-174) {
tmp = 1.0 * z;
} else if (t <= 5.2e+95) {
tmp = b * y;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -6.8e+40: tmp = b * t elif t <= -5.5e-102: tmp = b * y elif t <= 4.5e-174: tmp = 1.0 * z elif t <= 5.2e+95: tmp = b * y else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -6.8e+40) tmp = Float64(b * t); elseif (t <= -5.5e-102) tmp = Float64(b * y); elseif (t <= 4.5e-174) tmp = Float64(1.0 * z); elseif (t <= 5.2e+95) 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 <= -6.8e+40) tmp = b * t; elseif (t <= -5.5e-102) tmp = b * y; elseif (t <= 4.5e-174) tmp = 1.0 * z; elseif (t <= 5.2e+95) tmp = b * y; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6.8e+40], N[(b * t), $MachinePrecision], If[LessEqual[t, -5.5e-102], N[(b * y), $MachinePrecision], If[LessEqual[t, 4.5e-174], N[(1.0 * z), $MachinePrecision], If[LessEqual[t, 5.2e+95], N[(b * y), $MachinePrecision], N[(b * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{+40}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{-102}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-174}:\\
\;\;\;\;1 \cdot z\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{+95}:\\
\;\;\;\;b \cdot y\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -6.79999999999999977e40 or 5.19999999999999981e95 < t Initial program 92.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6453.3
Applied rewrites53.3%
Taylor expanded in t around inf
Applied rewrites48.0%
if -6.79999999999999977e40 < t < -5.4999999999999997e-102 or 4.49999999999999964e-174 < t < 5.19999999999999981e95Initial program 93.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6440.7
Applied rewrites40.7%
Taylor expanded in y around inf
Applied rewrites28.8%
if -5.4999999999999997e-102 < t < 4.49999999999999964e-174Initial program 97.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6446.0
Applied rewrites46.0%
Taylor expanded in y around 0
Applied rewrites23.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -6e+89)
t_1
(if (<= y -2.15e-139)
(* (- b a) t)
(if (<= y 450000.0) (* (- t 2.0) b) 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 <= -6e+89) {
tmp = t_1;
} else if (y <= -2.15e-139) {
tmp = (b - a) * t;
} else if (y <= 450000.0) {
tmp = (t - 2.0) * b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (b - z) * y
if (y <= (-6d+89)) then
tmp = t_1
else if (y <= (-2.15d-139)) then
tmp = (b - a) * t
else if (y <= 450000.0d0) then
tmp = (t - 2.0d0) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -6e+89) {
tmp = t_1;
} else if (y <= -2.15e-139) {
tmp = (b - a) * t;
} else if (y <= 450000.0) {
tmp = (t - 2.0) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y tmp = 0 if y <= -6e+89: tmp = t_1 elif y <= -2.15e-139: tmp = (b - a) * t elif y <= 450000.0: tmp = (t - 2.0) * b 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 <= -6e+89) tmp = t_1; elseif (y <= -2.15e-139) tmp = Float64(Float64(b - a) * t); elseif (y <= 450000.0) tmp = Float64(Float64(t - 2.0) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; tmp = 0.0; if (y <= -6e+89) tmp = t_1; elseif (y <= -2.15e-139) tmp = (b - a) * t; elseif (y <= 450000.0) tmp = (t - 2.0) * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -6e+89], t$95$1, If[LessEqual[y, -2.15e-139], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 450000.0], N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -6 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.15 \cdot 10^{-139}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;y \leq 450000:\\
\;\;\;\;\left(t - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.00000000000000025e89 or 4.5e5 < y Initial program 90.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.6
Applied rewrites71.6%
if -6.00000000000000025e89 < y < -2.15000000000000009e-139Initial program 97.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6452.2
Applied rewrites52.2%
if -2.15000000000000009e-139 < y < 4.5e5Initial program 95.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6449.8
Applied rewrites49.8%
Taylor expanded in y around 0
Applied rewrites49.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6e+89) (not (<= y 700000.0))) (* (- 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 <= -6e+89) || !(y <= 700000.0)) {
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 <= -6e+89) || !(y <= 700000.0)) tmp = Float64(Float64(b - z) * y); else tmp = fma(Float64(t - 2.0), b, Float64(z + x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6e+89], N[Not[LessEqual[y, 700000.0]], $MachinePrecision]], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], N[(N[(t - 2.0), $MachinePrecision] * b + N[(z + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+89} \lor \neg \left(y \leq 700000\right):\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, z + x\right)\\
\end{array}
\end{array}
if y < -6.00000000000000025e89 or 7e5 < y Initial program 90.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.6
Applied rewrites71.6%
if -6.00000000000000025e89 < y < 7e5Initial program 96.5%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
associate--r+N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
Applied rewrites92.8%
Taylor expanded in a around 0
Applied rewrites77.4%
Final simplification74.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1e-12) (not (<= b 2.4e+66))) (* (- (+ t y) 2.0) b) (fma (- z) y z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1e-12) || !(b <= 2.4e+66)) {
tmp = ((t + y) - 2.0) * b;
} else {
tmp = fma(-z, y, z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1e-12) || !(b <= 2.4e+66)) tmp = Float64(Float64(Float64(t + y) - 2.0) * b); else tmp = fma(Float64(-z), y, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1e-12], N[Not[LessEqual[b, 2.4e+66]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision], N[((-z) * y + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-12} \lor \neg \left(b \leq 2.4 \cdot 10^{+66}\right):\\
\;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-z, y, z\right)\\
\end{array}
\end{array}
if b < -9.9999999999999998e-13 or 2.4000000000000002e66 < b Initial program 88.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6474.3
Applied rewrites74.3%
if -9.9999999999999998e-13 < b < 2.4000000000000002e66Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6450.0
Applied rewrites50.0%
Taylor expanded in y around 0
Applied rewrites50.0%
Final simplification62.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.05e+173) (not (<= t 2.2e+37))) (* (- b a) t) (fma (- z) y z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.05e+173) || !(t <= 2.2e+37)) {
tmp = (b - a) * t;
} else {
tmp = fma(-z, y, z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.05e+173) || !(t <= 2.2e+37)) tmp = Float64(Float64(b - a) * t); else tmp = fma(Float64(-z), y, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.05e+173], N[Not[LessEqual[t, 2.2e+37]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], N[((-z) * y + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{+173} \lor \neg \left(t \leq 2.2 \cdot 10^{+37}\right):\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-z, y, z\right)\\
\end{array}
\end{array}
if t < -2.04999999999999988e173 or 2.2000000000000001e37 < t Initial program 89.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6472.8
Applied rewrites72.8%
if -2.04999999999999988e173 < t < 2.2000000000000001e37Initial program 96.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6442.9
Applied rewrites42.9%
Taylor expanded in y around 0
Applied rewrites42.9%
Final simplification53.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1e-12) (not (<= b 1.85e+86))) (* (- t 2.0) b) (fma (- z) y z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1e-12) || !(b <= 1.85e+86)) {
tmp = (t - 2.0) * b;
} else {
tmp = fma(-z, y, z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1e-12) || !(b <= 1.85e+86)) tmp = Float64(Float64(t - 2.0) * b); else tmp = fma(Float64(-z), y, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1e-12], N[Not[LessEqual[b, 1.85e+86]], $MachinePrecision]], N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision], N[((-z) * y + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-12} \lor \neg \left(b \leq 1.85 \cdot 10^{+86}\right):\\
\;\;\;\;\left(t - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-z, y, z\right)\\
\end{array}
\end{array}
if b < -9.9999999999999998e-13 or 1.84999999999999996e86 < b Initial program 88.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6474.7
Applied rewrites74.7%
Taylor expanded in y around 0
Applied rewrites52.1%
if -9.9999999999999998e-13 < b < 1.84999999999999996e86Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6449.2
Applied rewrites49.2%
Taylor expanded in y around 0
Applied rewrites49.2%
Final simplification50.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.6e+173) (not (<= t 5.4e+95))) (* b t) (fma (- z) y z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.6e+173) || !(t <= 5.4e+95)) {
tmp = b * t;
} else {
tmp = fma(-z, y, z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.6e+173) || !(t <= 5.4e+95)) tmp = Float64(b * t); else tmp = fma(Float64(-z), y, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.6e+173], N[Not[LessEqual[t, 5.4e+95]], $MachinePrecision]], N[(b * t), $MachinePrecision], N[((-z) * y + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+173} \lor \neg \left(t \leq 5.4 \cdot 10^{+95}\right):\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-z, y, z\right)\\
\end{array}
\end{array}
if t < -2.5999999999999999e173 or 5.4e95 < t Initial program 90.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6461.8
Applied rewrites61.8%
Taylor expanded in t around inf
Applied rewrites56.0%
if -2.5999999999999999e173 < t < 5.4e95Initial program 96.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6441.8
Applied rewrites41.8%
Taylor expanded in y around 0
Applied rewrites41.8%
Final simplification46.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.6e+55) (not (<= y 510000.0))) (* (- y) z) (* b t)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.6e+55) || !(y <= 510000.0)) {
tmp = -y * z;
} 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 <= (-8.6d+55)) .or. (.not. (y <= 510000.0d0))) then
tmp = -y * z
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 <= -8.6e+55) || !(y <= 510000.0)) {
tmp = -y * z;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8.6e+55) or not (y <= 510000.0): tmp = -y * z else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8.6e+55) || !(y <= 510000.0)) tmp = Float64(Float64(-y) * z); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -8.6e+55) || ~((y <= 510000.0))) tmp = -y * z; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.6e+55], N[Not[LessEqual[y, 510000.0]], $MachinePrecision]], N[((-y) * z), $MachinePrecision], N[(b * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.6 \cdot 10^{+55} \lor \neg \left(y \leq 510000\right):\\
\;\;\;\;\left(-y\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if y < -8.5999999999999998e55 or 5.1e5 < y Initial program 91.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6445.8
Applied rewrites45.8%
Taylor expanded in y around inf
Applied rewrites45.3%
if -8.5999999999999998e55 < y < 5.1e5Initial program 96.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6446.3
Applied rewrites46.3%
Taylor expanded in t around inf
Applied rewrites31.5%
Final simplification37.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6e+89) (not (<= y 1.75e+124))) (* b y) (* b t)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6e+89) || !(y <= 1.75e+124)) {
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 <= (-6d+89)) .or. (.not. (y <= 1.75d+124))) 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 <= -6e+89) || !(y <= 1.75e+124)) {
tmp = b * y;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6e+89) or not (y <= 1.75e+124): tmp = b * y else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6e+89) || !(y <= 1.75e+124)) 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 <= -6e+89) || ~((y <= 1.75e+124))) tmp = b * y; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6e+89], N[Not[LessEqual[y, 1.75e+124]], $MachinePrecision]], N[(b * y), $MachinePrecision], N[(b * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+89} \lor \neg \left(y \leq 1.75 \cdot 10^{+124}\right):\\
\;\;\;\;b \cdot y\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if y < -6.00000000000000025e89 or 1.7500000000000001e124 < y Initial program 89.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6439.8
Applied rewrites39.8%
Taylor expanded in y around inf
Applied rewrites35.7%
if -6.00000000000000025e89 < y < 1.7500000000000001e124Initial program 96.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6443.8
Applied rewrites43.8%
Taylor expanded in t around inf
Applied rewrites30.7%
Final simplification32.3%
(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 b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6442.5
Applied rewrites42.5%
Taylor expanded in t around inf
Applied rewrites23.5%
herbie shell --seed 2024338
(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)))