Average Error: 9.5 → 0.3
Time: 9.2s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\log y \cdot x + \left(z \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right) - t\right)\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\log y \cdot x + \left(z \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right) - t\right)
double f(double x, double y, double z, double t) {
        double r427280 = x;
        double r427281 = y;
        double r427282 = log(r427281);
        double r427283 = r427280 * r427282;
        double r427284 = z;
        double r427285 = 1.0;
        double r427286 = r427285 - r427281;
        double r427287 = log(r427286);
        double r427288 = r427284 * r427287;
        double r427289 = r427283 + r427288;
        double r427290 = t;
        double r427291 = r427289 - r427290;
        return r427291;
}

double f(double x, double y, double z, double t) {
        double r427292 = y;
        double r427293 = log(r427292);
        double r427294 = x;
        double r427295 = r427293 * r427294;
        double r427296 = z;
        double r427297 = 1.0;
        double r427298 = log(r427297);
        double r427299 = r427297 * r427292;
        double r427300 = 0.5;
        double r427301 = 2.0;
        double r427302 = pow(r427292, r427301);
        double r427303 = pow(r427297, r427301);
        double r427304 = r427302 / r427303;
        double r427305 = r427300 * r427304;
        double r427306 = r427299 + r427305;
        double r427307 = r427298 - r427306;
        double r427308 = r427296 * r427307;
        double r427309 = t;
        double r427310 = r427308 - r427309;
        double r427311 = r427295 + r427310;
        return r427311;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original9.5
Target0.2
Herbie0.3
\[\left(-z\right) \cdot \left(\left(0.5 \cdot \left(y \cdot y\right) + y\right) + \frac{0.333333333333333315}{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. Simplified9.5

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

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

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

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

Reproduce

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