
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+ (+ (+ x (* z (- 1.0 y))) (* a (- 1.0 t))) (* (- (+ y t) 2.0) b))))
(if (<= t_1 INFINITY) t_1 (fma z (- 1.0 y) (* t (- b a))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * (1.0 - y))) + (a * (1.0 - t))) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(z, (1.0 - y), (t * (b - a)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(z * Float64(1.0 - y))) + Float64(a * Float64(1.0 - t))) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(z, Float64(1.0 - y), Float64(t * Float64(b - a))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(1.0 - y), $MachinePrecision] + N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + z \cdot \left(1 - y\right)\right) + a \cdot \left(1 - t\right)\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, 1 - y, t \cdot \left(b - a\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)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 0.0%
Taylor expanded in x around 0
Applied rewrites64.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6471.4
Applied rewrites71.4%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma z (- 1.0 y) (* t (- b a)))))
(if (<= t -1.6e-14)
t_1
(if (<= t 7.8e-7)
(+ a (* y (- b z)))
(if (<= t 4.8e+20) (fma z (/ x z) z) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (1.0 - y), (t * (b - a)));
double tmp;
if (t <= -1.6e-14) {
tmp = t_1;
} else if (t <= 7.8e-7) {
tmp = a + (y * (b - z));
} else if (t <= 4.8e+20) {
tmp = fma(z, (x / z), z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(1.0 - y), Float64(t * Float64(b - a))) tmp = 0.0 if (t <= -1.6e-14) tmp = t_1; elseif (t <= 7.8e-7) tmp = Float64(a + Float64(y * Float64(b - z))); elseif (t <= 4.8e+20) tmp = fma(z, Float64(x / z), z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - y), $MachinePrecision] + N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e-14], t$95$1, If[LessEqual[t, 7.8e-7], N[(a + N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e+20], N[(z * N[(x / z), $MachinePrecision] + z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, 1 - y, t \cdot \left(b - a\right)\right)\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-7}:\\
\;\;\;\;a + y \cdot \left(b - z\right)\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{x}{z}, z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.6000000000000001e-14 or 4.8e20 < t Initial program 91.2%
Taylor expanded in x around 0
Applied rewrites96.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6481.1
Applied rewrites81.1%
if -1.6000000000000001e-14 < t < 7.80000000000000049e-7Initial program 98.3%
Taylor expanded in x around 0
Applied rewrites99.2%
Taylor expanded in t around 0
sub-negN/A
mul-1-negN/A
lower-+.f64N/A
mul-1-negN/A
sub-negN/A
lower-+.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6499.2
Applied rewrites99.2%
lift--.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.2%
Taylor expanded in y around inf
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f6452.2
Applied rewrites52.2%
if 7.80000000000000049e-7 < t < 4.8e20Initial program 90.6%
Taylor expanded in z around inf
associate--l+N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites90.9%
Taylor expanded in x around inf
lower-/.f6462.3
Applied rewrites62.3%
Final simplification66.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma t (- b a) (+ a (fma b (+ y -2.0) x)))))
(if (<= b -2.3e+127)
t_1
(if (<= b 9.2e-63) (fma a (- 1.0 t) (fma z (- 1.0 y) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (b - a), (a + fma(b, (y + -2.0), x)));
double tmp;
if (b <= -2.3e+127) {
tmp = t_1;
} else if (b <= 9.2e-63) {
tmp = fma(a, (1.0 - t), fma(z, (1.0 - y), x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(t, Float64(b - a), Float64(a + fma(b, Float64(y + -2.0), x))) tmp = 0.0 if (b <= -2.3e+127) tmp = t_1; elseif (b <= 9.2e-63) tmp = fma(a, Float64(1.0 - t), fma(z, Float64(1.0 - y), x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision] + N[(a + N[(b * N[(y + -2.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.3e+127], t$95$1, If[LessEqual[b, 9.2e-63], N[(a * N[(1.0 - t), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, b - a, a + \mathsf{fma}\left(b, y + -2, x\right)\right)\\
\mathbf{if}\;b \leq -2.3 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 9.2 \cdot 10^{-63}:\\
\;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.3000000000000002e127 or 9.2e-63 < b Initial program 90.2%
Taylor expanded in z around 0
Applied rewrites90.5%
if -2.3000000000000002e127 < b < 9.2e-63Initial program 97.9%
Taylor expanded in b around 0
associate--r+N/A
sub-negN/A
+-commutativeN/A
associate-+r-N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites92.1%
Final simplification91.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma z (- 1.0 y) (+ a (+ x (* y b))))))
(if (<= y -1.9e+143)
t_1
(if (<= y 4.2e+29) (+ x (fma b (+ t -2.0) (fma a (- 1.0 t) z))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (1.0 - y), (a + (x + (y * b))));
double tmp;
if (y <= -1.9e+143) {
tmp = t_1;
} else if (y <= 4.2e+29) {
tmp = x + fma(b, (t + -2.0), fma(a, (1.0 - t), z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(1.0 - y), Float64(a + Float64(x + Float64(y * b)))) tmp = 0.0 if (y <= -1.9e+143) tmp = t_1; elseif (y <= 4.2e+29) tmp = Float64(x + fma(b, Float64(t + -2.0), fma(a, Float64(1.0 - t), z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - y), $MachinePrecision] + N[(a + N[(x + N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e+143], t$95$1, If[LessEqual[y, 4.2e+29], N[(x + N[(b * N[(t + -2.0), $MachinePrecision] + N[(a * N[(1.0 - t), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, 1 - y, a + \left(x + y \cdot b\right)\right)\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+29}:\\
\;\;\;\;x + \mathsf{fma}\left(b, t + -2, \mathsf{fma}\left(a, 1 - t, z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.9e143 or 4.2000000000000003e29 < y Initial program 90.8%
Taylor expanded in x around 0
Applied rewrites94.9%
Taylor expanded in t around 0
sub-negN/A
mul-1-negN/A
lower-+.f64N/A
mul-1-negN/A
sub-negN/A
lower-+.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6495.9
Applied rewrites95.9%
Taylor expanded in y around inf
lower-*.f6485.3
Applied rewrites85.3%
if -1.9e143 < y < 4.2000000000000003e29Initial program 96.8%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
sub-negN/A
lower-fma.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
mul-1-negN/A
remove-double-negN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f6493.6
Applied rewrites93.6%
Final simplification90.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (* b (+ t (+ y -2.0))))))
(if (<= b -3e+146)
t_1
(if (<= b 1.4e+117) (fma a (- 1.0 t) (fma z (- 1.0 y) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (b * (t + (y + -2.0)));
double tmp;
if (b <= -3e+146) {
tmp = t_1;
} else if (b <= 1.4e+117) {
tmp = fma(a, (1.0 - t), fma(z, (1.0 - y), x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(b * Float64(t + Float64(y + -2.0)))) tmp = 0.0 if (b <= -3e+146) tmp = t_1; elseif (b <= 1.4e+117) tmp = fma(a, Float64(1.0 - t), fma(z, Float64(1.0 - y), x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(b * N[(t + N[(y + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3e+146], t$95$1, If[LessEqual[b, 1.4e+117], N[(a * N[(1.0 - t), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot \left(t + \left(y + -2\right)\right)\\
\mathbf{if}\;b \leq -3 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.00000000000000002e146 or 1.39999999999999999e117 < b Initial program 88.0%
Taylor expanded in x around 0
Applied rewrites96.0%
Taylor expanded in t around 0
sub-negN/A
mul-1-negN/A
lower-+.f64N/A
mul-1-negN/A
sub-negN/A
lower-+.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6497.3
Applied rewrites97.3%
lift--.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites97.3%
Taylor expanded in b around inf
lower-*.f64N/A
associate--l+N/A
lower-+.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6479.7
Applied rewrites79.7%
if -3.00000000000000002e146 < b < 1.39999999999999999e117Initial program 97.2%
Taylor expanded in b around 0
associate--r+N/A
sub-negN/A
+-commutativeN/A
associate-+r-N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
neg-mul-1N/A
sub-negN/A
lower--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites87.1%
Final simplification85.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma z (- 1.0 y) (* t (- b a))))) (if (<= t -1.6e-14) t_1 (if (<= t 5400000.0) (+ a (* y (- b z))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (1.0 - y), (t * (b - a)));
double tmp;
if (t <= -1.6e-14) {
tmp = t_1;
} else if (t <= 5400000.0) {
tmp = a + (y * (b - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(1.0 - y), Float64(t * Float64(b - a))) tmp = 0.0 if (t <= -1.6e-14) tmp = t_1; elseif (t <= 5400000.0) tmp = Float64(a + Float64(y * Float64(b - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - y), $MachinePrecision] + N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e-14], t$95$1, If[LessEqual[t, 5400000.0], N[(a + N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, 1 - y, t \cdot \left(b - a\right)\right)\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5400000:\\
\;\;\;\;a + y \cdot \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.6000000000000001e-14 or 5.4e6 < t Initial program 91.6%
Taylor expanded in x around 0
Applied rewrites96.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6478.4
Applied rewrites78.4%
if -1.6000000000000001e-14 < t < 5.4e6Initial program 97.6%
Taylor expanded in x around 0
Applied rewrites99.2%
Taylor expanded in t around 0
sub-negN/A
mul-1-negN/A
lower-+.f64N/A
mul-1-negN/A
sub-negN/A
lower-+.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6499.2
Applied rewrites99.2%
lift--.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.2%
Taylor expanded in y around inf
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f6451.2
Applied rewrites51.2%
Final simplification65.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2e+25) (fma (- a) t (* t b)) (if (<= t 1800000000000.0) (+ a (* y (- b z))) (* t (- b a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2e+25) {
tmp = fma(-a, t, (t * b));
} else if (t <= 1800000000000.0) {
tmp = a + (y * (b - z));
} else {
tmp = t * (b - a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2e+25) tmp = fma(Float64(-a), t, Float64(t * b)); elseif (t <= 1800000000000.0) tmp = Float64(a + Float64(y * Float64(b - z))); else tmp = Float64(t * Float64(b - a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2e+25], N[((-a) * t + N[(t * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1800000000000.0], N[(a + N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, t \cdot b\right)\\
\mathbf{elif}\;t \leq 1800000000000:\\
\;\;\;\;a + y \cdot \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(b - a\right)\\
\end{array}
\end{array}
if t < -2.00000000000000018e25Initial program 90.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6464.7
Applied rewrites64.7%
Taylor expanded in b around 0
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6464.7
Applied rewrites64.7%
if -2.00000000000000018e25 < t < 1.8e12Initial program 97.7%
Taylor expanded in x around 0
Applied rewrites99.3%
Taylor expanded in t around 0
sub-negN/A
mul-1-negN/A
lower-+.f64N/A
mul-1-negN/A
sub-negN/A
lower-+.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6499.2
Applied rewrites99.2%
lift--.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.2%
Taylor expanded in y around inf
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f6450.3
Applied rewrites50.3%
if 1.8e12 < t Initial program 91.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6463.5
Applied rewrites63.5%
Final simplification56.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -2e+25) t_1 (if (<= t 1800000000000.0) (+ a (* y (- b z))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -2e+25) {
tmp = t_1;
} else if (t <= 1800000000000.0) {
tmp = a + (y * (b - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-2d+25)) then
tmp = t_1
else if (t <= 1800000000000.0d0) then
tmp = a + (y * (b - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -2e+25) {
tmp = t_1;
} else if (t <= 1800000000000.0) {
tmp = a + (y * (b - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -2e+25: tmp = t_1 elif t <= 1800000000000.0: tmp = a + (y * (b - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -2e+25) tmp = t_1; elseif (t <= 1800000000000.0) tmp = Float64(a + Float64(y * Float64(b - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -2e+25) tmp = t_1; elseif (t <= 1800000000000.0) tmp = a + (y * (b - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e+25], t$95$1, If[LessEqual[t, 1800000000000.0], N[(a + N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -2 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1800000000000:\\
\;\;\;\;a + y \cdot \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.00000000000000018e25 or 1.8e12 < t Initial program 91.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6464.1
Applied rewrites64.1%
if -2.00000000000000018e25 < t < 1.8e12Initial program 97.7%
Taylor expanded in x around 0
Applied rewrites99.3%
Taylor expanded in t around 0
sub-negN/A
mul-1-negN/A
lower-+.f64N/A
mul-1-negN/A
sub-negN/A
lower-+.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6499.2
Applied rewrites99.2%
lift--.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.2%
Taylor expanded in y around inf
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f6450.3
Applied rewrites50.3%
Final simplification56.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* y (- b z)))) (if (<= y -1.8e+143) t_1 (if (<= y 4e+18) (* t (- b a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b - z);
double tmp;
if (y <= -1.8e+143) {
tmp = t_1;
} else if (y <= 4e+18) {
tmp = t * (b - 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 = y * (b - z)
if (y <= (-1.8d+143)) then
tmp = t_1
else if (y <= 4d+18) then
tmp = t * (b - 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 = y * (b - z);
double tmp;
if (y <= -1.8e+143) {
tmp = t_1;
} else if (y <= 4e+18) {
tmp = t * (b - a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b - z) tmp = 0 if y <= -1.8e+143: tmp = t_1 elif y <= 4e+18: tmp = t * (b - a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b - z)) tmp = 0.0 if (y <= -1.8e+143) tmp = t_1; elseif (y <= 4e+18) tmp = Float64(t * Float64(b - a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b - z); tmp = 0.0; if (y <= -1.8e+143) tmp = t_1; elseif (y <= 4e+18) tmp = t * (b - a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+143], t$95$1, If[LessEqual[y, 4e+18], N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+18}:\\
\;\;\;\;t \cdot \left(b - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.8e143 or 4e18 < y Initial program 91.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6473.6
Applied rewrites73.6%
if -1.8e143 < y < 4e18Initial program 96.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6439.1
Applied rewrites39.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -3.9e+21) t_1 (if (<= t 30.0) (* a (- 1.0 t)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -3.9e+21) {
tmp = t_1;
} else if (t <= 30.0) {
tmp = a * (1.0 - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-3.9d+21)) then
tmp = t_1
else if (t <= 30.0d0) then
tmp = a * (1.0d0 - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -3.9e+21) {
tmp = t_1;
} else if (t <= 30.0) {
tmp = a * (1.0 - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -3.9e+21: tmp = t_1 elif t <= 30.0: tmp = a * (1.0 - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -3.9e+21) tmp = t_1; elseif (t <= 30.0) tmp = Float64(a * Float64(1.0 - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -3.9e+21) tmp = t_1; elseif (t <= 30.0) tmp = a * (1.0 - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.9e+21], t$95$1, If[LessEqual[t, 30.0], N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -3.9 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 30:\\
\;\;\;\;a \cdot \left(1 - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.9e21 or 30 < t Initial program 90.4%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6462.7
Applied rewrites62.7%
if -3.9e21 < t < 30Initial program 98.4%
Taylor expanded in x around 0
Applied rewrites99.2%
Taylor expanded in a around inf
mul-1-negN/A
sub-negN/A
lower-*.f64N/A
lower--.f6416.0
Applied rewrites16.0%
(FPCore (x y z t a b) :precision binary64 (if (<= b -2.6e+146) (* t b) (if (<= b 1.7e+117) (* a (- 1.0 t)) (* t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.6e+146) {
tmp = t * b;
} else if (b <= 1.7e+117) {
tmp = a * (1.0 - t);
} else {
tmp = t * 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.6d+146)) then
tmp = t * b
else if (b <= 1.7d+117) then
tmp = a * (1.0d0 - t)
else
tmp = t * 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.6e+146) {
tmp = t * b;
} else if (b <= 1.7e+117) {
tmp = a * (1.0 - t);
} else {
tmp = t * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -2.6e+146: tmp = t * b elif b <= 1.7e+117: tmp = a * (1.0 - t) else: tmp = t * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.6e+146) tmp = Float64(t * b); elseif (b <= 1.7e+117) tmp = Float64(a * Float64(1.0 - t)); else tmp = Float64(t * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -2.6e+146) tmp = t * b; elseif (b <= 1.7e+117) tmp = a * (1.0 - t); else tmp = t * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.6e+146], N[(t * b), $MachinePrecision], If[LessEqual[b, 1.7e+117], N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision], N[(t * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.6 \cdot 10^{+146}:\\
\;\;\;\;t \cdot b\\
\mathbf{elif}\;b \leq 1.7 \cdot 10^{+117}:\\
\;\;\;\;a \cdot \left(1 - t\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot b\\
\end{array}
\end{array}
if b < -2.60000000000000014e146 or 1.7e117 < b Initial program 88.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6437.5
Applied rewrites37.5%
Taylor expanded in b around inf
lower-*.f6434.2
Applied rewrites34.2%
if -2.60000000000000014e146 < b < 1.7e117Initial program 97.2%
Taylor expanded in x around 0
Applied rewrites98.3%
Taylor expanded in a around inf
mul-1-negN/A
sub-negN/A
lower-*.f64N/A
lower--.f6435.7
Applied rewrites35.7%
Final simplification35.3%
(FPCore (x y z t a b) :precision binary64 (if (<= b -2.4e+146) (* t b) (if (<= b 1.24e+117) (* t (- a)) (* t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.4e+146) {
tmp = t * b;
} else if (b <= 1.24e+117) {
tmp = t * -a;
} else {
tmp = t * 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.4d+146)) then
tmp = t * b
else if (b <= 1.24d+117) then
tmp = t * -a
else
tmp = t * 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.4e+146) {
tmp = t * b;
} else if (b <= 1.24e+117) {
tmp = t * -a;
} else {
tmp = t * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -2.4e+146: tmp = t * b elif b <= 1.24e+117: tmp = t * -a else: tmp = t * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.4e+146) tmp = Float64(t * b); elseif (b <= 1.24e+117) tmp = Float64(t * Float64(-a)); else tmp = Float64(t * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -2.4e+146) tmp = t * b; elseif (b <= 1.24e+117) tmp = t * -a; else tmp = t * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.4e+146], N[(t * b), $MachinePrecision], If[LessEqual[b, 1.24e+117], N[(t * (-a)), $MachinePrecision], N[(t * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{+146}:\\
\;\;\;\;t \cdot b\\
\mathbf{elif}\;b \leq 1.24 \cdot 10^{+117}:\\
\;\;\;\;t \cdot \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot b\\
\end{array}
\end{array}
if b < -2.4000000000000002e146 or 1.23999999999999998e117 < b Initial program 88.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6437.5
Applied rewrites37.5%
Taylor expanded in b around inf
lower-*.f6434.2
Applied rewrites34.2%
if -2.4000000000000002e146 < b < 1.23999999999999998e117Initial program 97.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6429.9
Applied rewrites29.9%
Taylor expanded in b around 0
mul-1-negN/A
lower-neg.f6426.9
Applied rewrites26.9%
Final simplification29.0%
(FPCore (x y z t a b) :precision binary64 (* t b))
double code(double x, double y, double z, double t, double a, double b) {
return t * 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 = t * b
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return t * b;
}
def code(x, y, z, t, a, b): return t * b
function code(x, y, z, t, a, b) return Float64(t * b) end
function tmp = code(x, y, z, t, a, b) tmp = t * b; end
code[x_, y_, z_, t_, a_, b_] := N[(t * b), $MachinePrecision]
\begin{array}{l}
\\
t \cdot b
\end{array}
Initial program 94.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.1
Applied rewrites32.1%
Taylor expanded in b around inf
lower-*.f6414.9
Applied rewrites14.9%
Final simplification14.9%
herbie shell --seed 2024220
(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)))