Average Error: 0.1 → 0.1
Time: 19.8s
Precision: 64
\[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z\]
\[x + \left(\left(y - \left(y + 0.5\right) \cdot \log y\right) - z\right)\]
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
x + \left(\left(y - \left(y + 0.5\right) \cdot \log y\right) - z\right)
double f(double x, double y, double z) {
        double r14127524 = x;
        double r14127525 = y;
        double r14127526 = 0.5;
        double r14127527 = r14127525 + r14127526;
        double r14127528 = log(r14127525);
        double r14127529 = r14127527 * r14127528;
        double r14127530 = r14127524 - r14127529;
        double r14127531 = r14127530 + r14127525;
        double r14127532 = z;
        double r14127533 = r14127531 - r14127532;
        return r14127533;
}

double f(double x, double y, double z) {
        double r14127534 = x;
        double r14127535 = y;
        double r14127536 = 0.5;
        double r14127537 = r14127535 + r14127536;
        double r14127538 = log(r14127535);
        double r14127539 = r14127537 * r14127538;
        double r14127540 = r14127535 - r14127539;
        double r14127541 = z;
        double r14127542 = r14127540 - r14127541;
        double r14127543 = r14127534 + r14127542;
        return r14127543;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.1
\[\left(\left(y + x\right) - z\right) - \left(y + 0.5\right) \cdot \log y\]

Derivation

  1. Initial program 0.1

    \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z\]
  2. Simplified0.1

    \[\leadsto \color{blue}{x + \left(y - \mathsf{fma}\left(0.5 + y, \log y, z\right)\right)}\]
  3. Taylor expanded around inf 0.1

    \[\leadsto x + \color{blue}{\left(\left(y \cdot \log \left(\frac{1}{y}\right) + \left(y + 0.5 \cdot \log \left(\frac{1}{y}\right)\right)\right) - z\right)}\]
  4. Simplified0.1

    \[\leadsto x + \color{blue}{\left(\left(y - \log y \cdot \left(0.5 + y\right)\right) - z\right)}\]
  5. Final simplification0.1

    \[\leadsto x + \left(\left(y - \left(y + 0.5\right) \cdot \log y\right) - z\right)\]

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y z)
  :name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"

  :herbie-target
  (- (- (+ y x) z) (* (+ y 0.5) (log y)))

  (- (+ (- x (* (+ y 0.5) (log y))) y) z))