Average Error: 2.0 → 0.2
Time: 13.7s
Precision: binary64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
\[x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right) + a \cdot \left(b \cdot 0\right)\right)} \]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right) + a \cdot \left(b \cdot 0\right)\right)}
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
(FPCore (x y z t a b)
 :precision binary64
 (*
  x
  (exp (fma y (- (log z) t) (+ (* a (- (log1p (- z)) b)) (* a (* b 0.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp((y * (log(z) - t)) + (a * (log(1.0 - z) - b)));
}
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(fma(y, (log(z) - t), ((a * (log1p(-z) - b)) + (a * (b * 0.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 2.0

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

    \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
  3. Applied add-cube-cbrt_binary640.2

    \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - \color{blue}{\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \sqrt[3]{b}}\right)\right)} \]
  4. Applied add-cube-cbrt_binary640.2

    \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\left(\sqrt[3]{\mathsf{log1p}\left(-z\right)} \cdot \sqrt[3]{\mathsf{log1p}\left(-z\right)}\right) \cdot \sqrt[3]{\mathsf{log1p}\left(-z\right)}} - \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \sqrt[3]{b}\right)\right)} \]
  5. Applied prod-diff_binary640.2

    \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{\mathsf{log1p}\left(-z\right)} \cdot \sqrt[3]{\mathsf{log1p}\left(-z\right)}, \sqrt[3]{\mathsf{log1p}\left(-z\right)}, -\sqrt[3]{b} \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{b}, \sqrt[3]{b} \cdot \sqrt[3]{b}, \sqrt[3]{b} \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right)\right)}\right)} \]
  6. Applied distribute-rgt-in_binary643.2

    \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, \color{blue}{\mathsf{fma}\left(\sqrt[3]{\mathsf{log1p}\left(-z\right)} \cdot \sqrt[3]{\mathsf{log1p}\left(-z\right)}, \sqrt[3]{\mathsf{log1p}\left(-z\right)}, -\sqrt[3]{b} \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right) \cdot a + \mathsf{fma}\left(-\sqrt[3]{b}, \sqrt[3]{b} \cdot \sqrt[3]{b}, \sqrt[3]{b} \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right) \cdot a}\right)} \]
  7. Simplified3.1

    \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, \color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)} + \mathsf{fma}\left(-\sqrt[3]{b}, \sqrt[3]{b} \cdot \sqrt[3]{b}, \sqrt[3]{b} \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right) \cdot a\right)} \]
  8. Simplified0.2

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

    \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right) + a \cdot \left(b \cdot 0\right)\right)} \]

Reproduce

herbie shell --seed 2022068 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
  :precision binary64
  (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))