Average Error: 9.8 → 0.4
Time: 17.8s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\left(\mathsf{fma}\left(z, \log 1 - y \cdot 1, \left(2 \cdot \log \left(\sqrt[3]{y}\right)\right) \cdot x + x \cdot \log \left(\sqrt[3]{y}\right)\right) + \left(\mathsf{fma}\left(-1, y, 1 \cdot y\right) \cdot z - \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right) - t\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(\mathsf{fma}\left(z, \log 1 - y \cdot 1, \left(2 \cdot \log \left(\sqrt[3]{y}\right)\right) \cdot x + x \cdot \log \left(\sqrt[3]{y}\right)\right) + \left(\mathsf{fma}\left(-1, y, 1 \cdot y\right) \cdot z - \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right) - t
double f(double x, double y, double z, double t) {
        double r274204 = x;
        double r274205 = y;
        double r274206 = log(r274205);
        double r274207 = r274204 * r274206;
        double r274208 = z;
        double r274209 = 1.0;
        double r274210 = r274209 - r274205;
        double r274211 = log(r274210);
        double r274212 = r274208 * r274211;
        double r274213 = r274207 + r274212;
        double r274214 = t;
        double r274215 = r274213 - r274214;
        return r274215;
}

double f(double x, double y, double z, double t) {
        double r274216 = z;
        double r274217 = 1.0;
        double r274218 = log(r274217);
        double r274219 = y;
        double r274220 = r274219 * r274217;
        double r274221 = r274218 - r274220;
        double r274222 = 2.0;
        double r274223 = cbrt(r274219);
        double r274224 = log(r274223);
        double r274225 = r274222 * r274224;
        double r274226 = x;
        double r274227 = r274225 * r274226;
        double r274228 = r274226 * r274224;
        double r274229 = r274227 + r274228;
        double r274230 = fma(r274216, r274221, r274229);
        double r274231 = -r274217;
        double r274232 = r274217 * r274219;
        double r274233 = fma(r274231, r274219, r274232);
        double r274234 = r274233 * r274216;
        double r274235 = 0.5;
        double r274236 = pow(r274219, r274222);
        double r274237 = r274216 * r274236;
        double r274238 = pow(r274217, r274222);
        double r274239 = r274237 / r274238;
        double r274240 = r274235 * r274239;
        double r274241 = r274234 - r274240;
        double r274242 = r274230 + r274241;
        double r274243 = t;
        double r274244 = r274242 - r274243;
        return r274244;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original9.8
Target0.3
Herbie0.4
\[\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.8

    \[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
  2. Simplified9.8

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, z \cdot \log \left(1 - y\right)\right) - t}\]
  3. Taylor expanded around 0 0.4

    \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{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) - t\]
  4. Simplified0.4

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

    \[\leadsto \color{blue}{\left(x \cdot \log y + \left(z \cdot \left(\log 1 - y \cdot 1\right) - \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)} - t\]
  7. Using strategy rm
  8. Applied pow10.4

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

    \[\leadsto \left(x \cdot \log y + \left(z \cdot \left(\color{blue}{1 \cdot \log 1} - y \cdot 1\right) - \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right) - t\]
  10. Applied prod-diff0.4

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

    \[\leadsto \left(x \cdot \log y + \left(\color{blue}{\left(\mathsf{fma}\left(1, \log 1, -1 \cdot y\right) \cdot z + \mathsf{fma}\left(-1, y, 1 \cdot y\right) \cdot z\right)} - \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right) - t\]
  12. Applied associate--l+0.4

    \[\leadsto \left(x \cdot \log y + \color{blue}{\left(\mathsf{fma}\left(1, \log 1, -1 \cdot y\right) \cdot z + \left(\mathsf{fma}\left(-1, y, 1 \cdot y\right) \cdot z - \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)}\right) - t\]
  13. Applied associate-+r+0.4

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019235 +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))