?

Average Error: 0.0 → 0.0
Time: 1.3min
Precision: binary64
Cost: 13888

?

\[\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 \]
\[\mathsf{fma}\left(b, \left(y + t\right) + -2, x - \mathsf{fma}\left(z, -1 + y, \left(-1 + t\right) \cdot a\right)\right) \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
(FPCore (x y z t a b)
 :precision binary64
 (fma b (+ (+ y t) -2.0) (- x (fma z (+ -1.0 y) (* (+ -1.0 t) a)))))
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);
}
double code(double x, double y, double z, double t, double a, double b) {
	return fma(b, ((y + t) + -2.0), (x - fma(z, (-1.0 + y), ((-1.0 + t) * a))));
}
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 code(x, y, z, t, a, b)
	return fma(b, Float64(Float64(y + t) + -2.0), Float64(x - fma(z, Float64(-1.0 + y), Float64(Float64(-1.0 + t) * a))))
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]
code[x_, y_, z_, t_, a_, b_] := N[(b * N[(N[(y + t), $MachinePrecision] + -2.0), $MachinePrecision] + N[(x - N[(z * N[(-1.0 + y), $MachinePrecision] + N[(N[(-1.0 + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\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
\mathsf{fma}\left(b, \left(y + t\right) + -2, x - \mathsf{fma}\left(z, -1 + y, \left(-1 + t\right) \cdot a\right)\right)

Error?

Derivation?

  1. Initial program 0.0

    \[\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 \]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(b, \left(y + t\right) + -2, x - \mathsf{fma}\left(z, -1 + y, \left(-1 + t\right) \cdot a\right)\right)} \]
    Proof

Alternatives

Alternative 1
Error29.0
Cost1636
\[\begin{array}{l} t_1 := x - \left(t \cdot a - a\right)\\ t_2 := \left(b - z\right) \cdot y\\ t_3 := x - \left(t \cdot a - z\right)\\ \mathbf{if}\;y \leq -7.5 \cdot 10^{+53}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-231}:\\ \;\;\;\;a + \left(z + x\right)\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-190}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-180}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-138}:\\ \;\;\;\;\left(\left(y + t\right) - 2\right) \cdot b\\ \mathbf{elif}\;y \leq 2.95 \cdot 10^{-33}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{+18}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;y \leq 7.3 \cdot 10^{+102}:\\ \;\;\;\;x - y \cdot z\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+149}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error30.0
Cost1636
\[\begin{array}{l} t_1 := x - \left(t \cdot a - a\right)\\ t_2 := x - \left(t \cdot a - z\right)\\ \mathbf{if}\;y \leq -1.4 \cdot 10^{+15}:\\ \;\;\;\;\left(a + z\right) - y \cdot z\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-231}:\\ \;\;\;\;a + \left(z + x\right)\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{-190}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{-180}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-138}:\\ \;\;\;\;\left(\left(y + t\right) - 2\right) \cdot b\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-33}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+17}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+103}:\\ \;\;\;\;x - y \cdot z\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+148}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\left(b - z\right) \cdot y\\ \end{array} \]
Alternative 3
Error28.3
Cost1504
\[\begin{array}{l} t_1 := a + \left(z + x\right)\\ t_2 := x - \left(t \cdot a - a\right)\\ t_3 := \left(b - z\right) \cdot y\\ \mathbf{if}\;y \leq -2.9 \cdot 10^{+55}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-234}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{-190}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{-180}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-138}:\\ \;\;\;\;\left(\left(y + t\right) - 2\right) \cdot b\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{+17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{+103}:\\ \;\;\;\;x - y \cdot z\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{+149}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 4
Error37.1
Cost1376
\[\begin{array}{l} t_1 := \left(1 - t\right) \cdot a\\ t_2 := z \cdot \left(1 - y\right)\\ \mathbf{if}\;x \leq -3.1 \cdot 10^{+23}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;x \leq -3.5 \cdot 10^{-187}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 5.3 \cdot 10^{-307}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 5.6 \cdot 10^{-150}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 4.9 \cdot 10^{-113}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+97}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+134}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;x \leq 7.8 \cdot 10^{+185}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;a + x\\ \end{array} \]
Alternative 5
Error37.3
Cost1376
\[\begin{array}{l} t_1 := z \cdot \left(1 - y\right)\\ \mathbf{if}\;x \leq -4.2 \cdot 10^{+20}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-187}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 5.6 \cdot 10^{-307}:\\ \;\;\;\;\left(1 - t\right) \cdot a\\ \mathbf{elif}\;x \leq 3.7 \cdot 10^{-147}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-112}:\\ \;\;\;\;\left(b - a\right) \cdot t\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{+97}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+134}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+185}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a + x\\ \end{array} \]
Alternative 6
Error26.7
Cost1372
\[\begin{array}{l} t_1 := x - \left(t \cdot a - a\right)\\ t_2 := x - \left(y \cdot z - z\right)\\ \mathbf{if}\;z \leq -8.8 \cdot 10^{+73}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{+59}:\\ \;\;\;\;\left(b - z\right) \cdot y\\ \mathbf{elif}\;z \leq -8 \cdot 10^{+24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-15}:\\ \;\;\;\;a + \left(z + x\right)\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-231}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-270}:\\ \;\;\;\;\left(\left(y + t\right) - 2\right) \cdot b\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-66}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error20.9
Cost1368
\[\begin{array}{l} t_1 := x - \left(\left(y \cdot z - z\right) - a\right)\\ t_2 := \left(\left(y + t\right) - 2\right) \cdot b\\ \mathbf{if}\;b \leq -4.4 \cdot 10^{+117}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -5 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -6.8 \cdot 10^{-30}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -2 \cdot 10^{-301}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 1.35 \cdot 10^{-114}:\\ \;\;\;\;x - \left(\left(t \cdot a - a\right) - z\right)\\ \mathbf{elif}\;b \leq 2.2 \cdot 10^{+151}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error14.9
Cost1360
\[\begin{array}{l} t_1 := x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)\\ t_2 := \left(\left(y + t\right) - 2\right) \cdot b\\ \mathbf{if}\;b \leq -4 \cdot 10^{+137}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -5 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -6.8 \cdot 10^{-30}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{+151}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 9
Error7.4
Cost1356
\[\begin{array}{l} t_1 := z \cdot \left(y - 1\right)\\ t_2 := \left(\left(y + t\right) - 2\right) \cdot b + x\\ t_3 := t_2 - t_1\\ t_4 := \left(t - 1\right) \cdot a\\ \mathbf{if}\;z \leq -3.4 \cdot 10^{+57}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-16}:\\ \;\;\;\;t_2 - t_4\\ \mathbf{elif}\;z \leq 1.86 \cdot 10^{+127}:\\ \;\;\;\;x - \left(t_4 + t_1\right)\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 10
Error0.0
Cost1344
\[\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 \]
Alternative 11
Error24.9
Cost1240
\[\begin{array}{l} t_1 := t \cdot a - a\\ t_2 := x - \left(t_1 - z\right)\\ \mathbf{if}\;y \leq -1.95 \cdot 10^{+15}:\\ \;\;\;\;\left(a + z\right) - y \cdot z\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{-180}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-138}:\\ \;\;\;\;\left(\left(y + t\right) - 2\right) \cdot b\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{+19}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+102}:\\ \;\;\;\;x - y \cdot z\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+149}:\\ \;\;\;\;x - t_1\\ \mathbf{else}:\\ \;\;\;\;\left(b - z\right) \cdot y\\ \end{array} \]
Alternative 12
Error8.3
Cost1224
\[\begin{array}{l} t_1 := z \cdot \left(y - 1\right)\\ t_2 := \left(\left(\left(y + t\right) - 2\right) \cdot b + x\right) - t_1\\ \mathbf{if}\;b \leq -1.1 \cdot 10^{-42}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 1.3 \cdot 10^{-8}:\\ \;\;\;\;x - \left(\left(t - 1\right) \cdot a + t_1\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 13
Error28.2
Cost1112
\[\begin{array}{l} t_1 := a + \left(z + x\right)\\ t_2 := \left(b - z\right) \cdot y\\ \mathbf{if}\;y \leq -1.45 \cdot 10^{+54}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{-180}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-138}:\\ \;\;\;\;\left(t + -2\right) \cdot b\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{+17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+103}:\\ \;\;\;\;x - y \cdot z\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+145}:\\ \;\;\;\;a + x\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 14
Error28.2
Cost1112
\[\begin{array}{l} t_1 := a + \left(z + x\right)\\ t_2 := \left(b - z\right) \cdot y\\ \mathbf{if}\;y \leq -6.2 \cdot 10^{+53}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-180}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-138}:\\ \;\;\;\;\left(\left(y + t\right) - 2\right) \cdot b\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+18}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{+102}:\\ \;\;\;\;x - y \cdot z\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+145}:\\ \;\;\;\;a + x\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 15
Error35.2
Cost980
\[\begin{array}{l} t_1 := z \cdot \left(1 - y\right)\\ \mathbf{if}\;z \leq -4.6 \cdot 10^{+119}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{+58}:\\ \;\;\;\;\left(b - z\right) \cdot y\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-192}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-265}:\\ \;\;\;\;\left(b - a\right) \cdot t\\ \mathbf{elif}\;z \leq 8.6 \cdot 10^{+70}:\\ \;\;\;\;a + x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Error34.7
Cost980
\[\begin{array}{l} t_1 := z \cdot \left(1 - y\right)\\ \mathbf{if}\;z \leq -7.6 \cdot 10^{+119}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{+58}:\\ \;\;\;\;\left(b - z\right) \cdot y\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-231}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-265}:\\ \;\;\;\;\left(y - 2\right) \cdot b\\ \mathbf{elif}\;z \leq 10^{+71}:\\ \;\;\;\;a + x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 17
Error34.2
Cost848
\[\begin{array}{l} t_1 := z \cdot \left(1 - y\right)\\ \mathbf{if}\;z \leq -2.8 \cdot 10^{+75}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{-231}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-274}:\\ \;\;\;\;\left(t + -2\right) \cdot b\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{+70}:\\ \;\;\;\;a + x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 18
Error27.9
Cost848
\[\begin{array}{l} t_1 := a + \left(z + x\right)\\ t_2 := \left(b - z\right) \cdot y\\ \mathbf{if}\;y \leq -1.55 \cdot 10^{+53}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{-180}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-137}:\\ \;\;\;\;\left(t + -2\right) \cdot b\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+50}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 19
Error32.6
Cost584
\[\begin{array}{l} t_1 := z \cdot \left(1 - y\right)\\ \mathbf{if}\;z \leq -5.2 \cdot 10^{+75}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+73}:\\ \;\;\;\;a + x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 20
Error39.2
Cost388
\[\begin{array}{l} \mathbf{if}\;t \leq -1.55 \cdot 10^{+159}:\\ \;\;\;\;-t \cdot a\\ \mathbf{else}:\\ \;\;\;\;a + x\\ \end{array} \]
Alternative 21
Error44.0
Cost328
\[\begin{array}{l} \mathbf{if}\;a \leq -5.7 \cdot 10^{+48}:\\ \;\;\;\;a\\ \mathbf{elif}\;a \leq 6 \cdot 10^{+52}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
Alternative 22
Error39.5
Cost324
\[\begin{array}{l} \mathbf{if}\;t \leq -5.5 \cdot 10^{+187}:\\ \;\;\;\;t \cdot b\\ \mathbf{else}:\\ \;\;\;\;a + x\\ \end{array} \]
Alternative 23
Error53.6
Cost64
\[a \]

Error

Reproduce?

herbie shell --seed 2023033 
(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)))