Average Error: 9.5 → 0.4
Time: 27.2s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\left(\left(x \cdot \left(2 \cdot \log \left(\sqrt[3]{y}\right)\right) + \frac{1}{3} \cdot \left(x \cdot \log y\right)\right) + z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right) - t\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(\left(x \cdot \left(2 \cdot \log \left(\sqrt[3]{y}\right)\right) + \frac{1}{3} \cdot \left(x \cdot \log y\right)\right) + z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right) - t
double f(double x, double y, double z, double t) {
        double r256200 = x;
        double r256201 = y;
        double r256202 = log(r256201);
        double r256203 = r256200 * r256202;
        double r256204 = z;
        double r256205 = 1.0;
        double r256206 = r256205 - r256201;
        double r256207 = log(r256206);
        double r256208 = r256204 * r256207;
        double r256209 = r256203 + r256208;
        double r256210 = t;
        double r256211 = r256209 - r256210;
        return r256211;
}

double f(double x, double y, double z, double t) {
        double r256212 = x;
        double r256213 = 2.0;
        double r256214 = y;
        double r256215 = cbrt(r256214);
        double r256216 = log(r256215);
        double r256217 = r256213 * r256216;
        double r256218 = r256212 * r256217;
        double r256219 = 0.3333333333333333;
        double r256220 = log(r256214);
        double r256221 = r256212 * r256220;
        double r256222 = r256219 * r256221;
        double r256223 = r256218 + r256222;
        double r256224 = z;
        double r256225 = 1.0;
        double r256226 = log(r256225);
        double r256227 = 0.5;
        double r256228 = pow(r256214, r256213);
        double r256229 = pow(r256225, r256213);
        double r256230 = r256228 / r256229;
        double r256231 = r256227 * r256230;
        double r256232 = fma(r256225, r256214, r256231);
        double r256233 = r256226 - r256232;
        double r256234 = r256224 * r256233;
        double r256235 = r256223 + r256234;
        double r256236 = t;
        double r256237 = r256235 - r256236;
        return r256237;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original9.5
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.5

    \[\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 + z \cdot \color{blue}{\left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)}\right) - t\]
  3. Simplified0.3

    \[\leadsto \left(x \cdot \log y + z \cdot \color{blue}{\left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\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)} + z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\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)} + z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\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)} + z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right) - t\]
  8. Simplified0.4

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019325 +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.3333333333333333 (* 1 (* 1 1))) (* y (* y y))))) (- t (* x (log y))))

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