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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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(1 - y, z, \mathsf{fma}\left(b, \left(y + t\right) - 2, x\right) - \left(t - 1\right) \cdot a\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.0

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

    \[\leadsto \mathsf{fma}\left(1 - y, z, \color{blue}{b \cdot \left(\left(y + t\right) - 2\right) + \left(x - \left(t - 1\right) \cdot a\right)}\right)\]
  6. Using strategy rm
  7. Applied associate--l+0.0

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

    \[\leadsto \mathsf{fma}\left(1 - y, z, \color{blue}{\left(b \cdot y + b \cdot \left(t - 2\right)\right)} + \left(x - \left(t - 1\right) \cdot a\right)\right)\]
  9. Using strategy rm
  10. Applied add-sqr-sqrt31.7

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

    \[\leadsto \mathsf{fma}\left(1 - y, z, \left(b \cdot y + b \cdot \left(t - 2\right)\right) + \color{blue}{\left(\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -a \cdot \left(t - 1\right)\right) + \mathsf{fma}\left(-a, t - 1, a \cdot \left(t - 1\right)\right)\right)}\right)\]
  12. Applied associate-+r+31.7

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

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

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

Reproduce

herbie shell --seed 2020056 +o rules:numerics
(FPCore (x y z t a b)
  :name "Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2"
  :precision binary64
  (+ (- (- x (* (- y 1) z)) (* (- t 1) a)) (* (- (+ y t) 2) b)))