Average Error: 0.0 → 0.0
Time: 6.4s
Precision: binary64
\[\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(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right) + \mathsf{fma}\left(b, t + y, b \cdot -2\right) \]
\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(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right) + \mathsf{fma}\left(b, t + y, b \cdot -2\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 a (- 1.0 t) (fma z (- 1.0 y) x)) (fma b (+ t y) (* b -2.0))))
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(a, (1.0 - t), fma(z, (1.0 - y), x)) + fma(b, (t + y), (b * -2.0));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

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. Taylor expanded in x around 0 0.0

    \[\leadsto \color{blue}{\left(\left(a + \left(z + x\right)\right) - \left(y \cdot z + a \cdot t\right)\right)} + \left(\left(y + t\right) - 2\right) \cdot b \]
  3. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)} + \left(\left(y + t\right) - 2\right) \cdot b \]
  4. Taylor expanded in y around 0 0.0

    \[\leadsto \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right) + \color{blue}{\left(\left(y \cdot b + t \cdot b\right) - 2 \cdot b\right)} \]
  5. Applied distribute-rgt-out_binary640.0

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

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

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

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

Reproduce

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