Average Error: 0.1 → 0.1
Time: 11.2s
Precision: binary64
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
\[\mathsf{fma}\left(z, \log \left(\sqrt[3]{e^{2}} \cdot \frac{\sqrt[3]{e}}{t}\right), \mathsf{fma}\left(a - 0.5, b, x + 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(z, \log \left(\sqrt[3]{e^{2}} \cdot \frac{\sqrt[3]{e}}{t}\right), \mathsf{fma}\left(a - 0.5, b, x + y\right)\right)
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
(FPCore (x y z t a b)
 :precision binary64
 (fma z (log (* (cbrt (exp 2.0)) (/ (cbrt E) t))) (fma (- a 0.5) b (+ x y))))
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(z, log((cbrt(exp(2.0)) * (cbrt(((double) M_E)) / t))), fma((a - 0.5), b, (x + 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

Target

Original0.1
Target0.4
Herbie0.1
\[\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{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(z, 1 - \log t, \mathsf{fma}\left(a - 0.5, b, x + y\right)\right)} \]
  3. Applied add-log-exp_binary640.1

    \[\leadsto \mathsf{fma}\left(z, \color{blue}{\log \left(e^{1}\right)} - \log t, \mathsf{fma}\left(a - 0.5, b, x + y\right)\right) \]
  4. Applied diff-log_binary640.1

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

    \[\leadsto \mathsf{fma}\left(z, \log \color{blue}{\left(\frac{e}{t}\right)}, \mathsf{fma}\left(a - 0.5, b, x + y\right)\right) \]
  6. Applied *-un-lft-identity_binary640.1

    \[\leadsto \mathsf{fma}\left(z, \log \left(\frac{e}{\color{blue}{1 \cdot t}}\right), \mathsf{fma}\left(a - 0.5, b, x + y\right)\right) \]
  7. Applied add-cube-cbrt_binary640.1

    \[\leadsto \mathsf{fma}\left(z, \log \left(\frac{\color{blue}{\left(\sqrt[3]{e} \cdot \sqrt[3]{e}\right) \cdot \sqrt[3]{e}}}{1 \cdot t}\right), \mathsf{fma}\left(a - 0.5, b, x + y\right)\right) \]
  8. Applied times-frac_binary640.1

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

    \[\leadsto \mathsf{fma}\left(z, \log \left(\color{blue}{\left(\sqrt[3]{e} \cdot \sqrt[3]{e}\right)} \cdot \frac{\sqrt[3]{e}}{t}\right), \mathsf{fma}\left(a - 0.5, b, x + y\right)\right) \]
  10. Applied add-cbrt-cube_binary640.1

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

    \[\leadsto \mathsf{fma}\left(z, \log \left(\sqrt[3]{\color{blue}{e^{2}}} \cdot \frac{\sqrt[3]{e}}{t}\right), \mathsf{fma}\left(a - 0.5, b, x + y\right)\right) \]
  12. Final simplification0.1

    \[\leadsto \mathsf{fma}\left(z, \log \left(\sqrt[3]{e^{2}} \cdot \frac{\sqrt[3]{e}}{t}\right), \mathsf{fma}\left(a - 0.5, b, x + y\right)\right) \]

Reproduce

herbie shell --seed 2022125 
(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.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))

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