Average Error: 9.6 → 0.3
Time: 24.9s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\left(\mathsf{fma}\left(2 \cdot \log \left(\sqrt[3]{y}\right), x, \log \left({y}^{\frac{1}{3}}\right) \cdot x\right) + \mathsf{fma}\left(\frac{-1}{2}, \frac{z \cdot {y}^{2}}{{1}^{2}}, z \cdot \left(\log 1 - 1 \cdot y\right)\right)\right) - t\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(\mathsf{fma}\left(2 \cdot \log \left(\sqrt[3]{y}\right), x, \log \left({y}^{\frac{1}{3}}\right) \cdot x\right) + \mathsf{fma}\left(\frac{-1}{2}, \frac{z \cdot {y}^{2}}{{1}^{2}}, z \cdot \left(\log 1 - 1 \cdot y\right)\right)\right) - t
double f(double x, double y, double z, double t) {
        double r292201 = x;
        double r292202 = y;
        double r292203 = log(r292202);
        double r292204 = r292201 * r292203;
        double r292205 = z;
        double r292206 = 1.0;
        double r292207 = r292206 - r292202;
        double r292208 = log(r292207);
        double r292209 = r292205 * r292208;
        double r292210 = r292204 + r292209;
        double r292211 = t;
        double r292212 = r292210 - r292211;
        return r292212;
}

double f(double x, double y, double z, double t) {
        double r292213 = 2.0;
        double r292214 = y;
        double r292215 = cbrt(r292214);
        double r292216 = log(r292215);
        double r292217 = r292213 * r292216;
        double r292218 = x;
        double r292219 = 0.3333333333333333;
        double r292220 = pow(r292214, r292219);
        double r292221 = log(r292220);
        double r292222 = r292221 * r292218;
        double r292223 = fma(r292217, r292218, r292222);
        double r292224 = -0.5;
        double r292225 = z;
        double r292226 = pow(r292214, r292213);
        double r292227 = r292225 * r292226;
        double r292228 = 1.0;
        double r292229 = pow(r292228, r292213);
        double r292230 = r292227 / r292229;
        double r292231 = log(r292228);
        double r292232 = r292228 * r292214;
        double r292233 = r292231 - r292232;
        double r292234 = r292225 * r292233;
        double r292235 = fma(r292224, r292230, r292234);
        double r292236 = r292223 + r292235;
        double r292237 = t;
        double r292238 = r292236 - r292237;
        return r292238;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original9.6
Target0.3
Herbie0.3
\[\left(-z\right) \cdot \left(\left(0.5 \cdot \left(y \cdot y\right) + y\right) + \frac{0.3333333333333333148296162562473909929395}{1 \cdot \left(1 \cdot 1\right)} \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) - \left(t - x \cdot \log y\right)\]

Derivation

  1. Initial program 9.6

    \[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
  2. Taylor expanded around 0 0.3

    \[\leadsto \left(x \cdot \log y + \color{blue}{\left(z \cdot \log 1 - \left(1 \cdot \left(z \cdot y\right) + \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)}\right) - t\]
  3. Simplified0.3

    \[\leadsto \left(x \cdot \log y + \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, \frac{z \cdot {y}^{2}}{{1}^{2}}, z \cdot \left(\log 1 - 1 \cdot y\right)\right)}\right) - t\]
  4. Using strategy rm
  5. Applied add-cube-cbrt0.3

    \[\leadsto \left(x \cdot \log \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} + \mathsf{fma}\left(\frac{-1}{2}, \frac{z \cdot {y}^{2}}{{1}^{2}}, z \cdot \left(\log 1 - 1 \cdot y\right)\right)\right) - t\]
  6. Applied log-prod0.4

    \[\leadsto \left(x \cdot \color{blue}{\left(\log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \log \left(\sqrt[3]{y}\right)\right)} + \mathsf{fma}\left(\frac{-1}{2}, \frac{z \cdot {y}^{2}}{{1}^{2}}, z \cdot \left(\log 1 - 1 \cdot y\right)\right)\right) - t\]
  7. Applied distribute-lft-in0.4

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

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

    \[\leadsto \left(\left(\left(2 \cdot \log \left(\sqrt[3]{y}\right)\right) \cdot x + \color{blue}{\log \left(\sqrt[3]{y}\right) \cdot x}\right) + \mathsf{fma}\left(\frac{-1}{2}, \frac{z \cdot {y}^{2}}{{1}^{2}}, z \cdot \left(\log 1 - 1 \cdot y\right)\right)\right) - t\]
  10. Using strategy rm
  11. Applied fma-def0.3

    \[\leadsto \left(\color{blue}{\mathsf{fma}\left(2 \cdot \log \left(\sqrt[3]{y}\right), x, \log \left(\sqrt[3]{y}\right) \cdot x\right)} + \mathsf{fma}\left(\frac{-1}{2}, \frac{z \cdot {y}^{2}}{{1}^{2}}, z \cdot \left(\log 1 - 1 \cdot y\right)\right)\right) - t\]
  12. Using strategy rm
  13. Applied pow1/30.3

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

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

Reproduce

herbie shell --seed 2019304 +o rules:numerics
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"
  :precision binary64

  :herbie-target
  (- (* (- z) (+ (+ (* 0.5 (* y y)) y) (* (/ 0.333333333333333315 (* 1 (* 1 1))) (* y (* y y))))) (- t (* x (log y))))

  (- (+ (* x (log y)) (* z (log (- 1 y)))) t))