Average Error: 0.1 → 0.1
Time: 3.5s
Precision: 64
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\]
\[\mathsf{fma}\left(b, a - 0.5, x + \mathsf{fma}\left(\log \left(\frac{1}{t}\right), z, z + y\right)\right)\]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\mathsf{fma}\left(b, a - 0.5, x + \mathsf{fma}\left(\log \left(\frac{1}{t}\right), z, z + y\right)\right)
double code(double x, double y, double z, double t, double a, double b) {
	return ((((x + y) + z) - (z * log(t))) + ((a - 0.5) * b));
}
double code(double x, double y, double z, double t, double a, double b) {
	return fma(b, (a - 0.5), (x + fma(log((1.0 / t)), z, (z + y))));
}

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

Target

Original0.1
Target0.4
Herbie0.1
\[\left(\left(x + y\right) + \frac{\left(1 - {\left(\log t\right)}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b\]

Derivation

  1. Initial program 0.1

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\]
  2. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a - 0.5, \left(\left(x + y\right) + z\right) - z \cdot \log t\right)}\]
  3. Using strategy rm
  4. Applied associate-+l+0.1

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

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

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, x + \color{blue}{\left(\mathsf{fma}\left(\log \left(\frac{1}{t}\right), z, y\right) + z\right)}\right)\]
  7. Taylor expanded around 0 0.1

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

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, x + \color{blue}{\mathsf{fma}\left(\log \left(\frac{1}{t}\right), z, z + y\right)}\right)\]
  9. Final simplification0.1

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

Reproduce

herbie shell --seed 2020078 +o rules:numerics
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 0.5) b))

  (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))