Average Error: 0.1 → 0.1
Time: 7.4s
Precision: 64
\[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z\]
\[x - \left(\left(z + \left(y + 0.5\right) \cdot \log y\right) - y\right)\]
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
x - \left(\left(z + \left(y + 0.5\right) \cdot \log y\right) - y\right)
double f(double x, double y, double z) {
        double r372226 = x;
        double r372227 = y;
        double r372228 = 0.5;
        double r372229 = r372227 + r372228;
        double r372230 = log(r372227);
        double r372231 = r372229 * r372230;
        double r372232 = r372226 - r372231;
        double r372233 = r372232 + r372227;
        double r372234 = z;
        double r372235 = r372233 - r372234;
        return r372235;
}

double f(double x, double y, double z) {
        double r372236 = x;
        double r372237 = z;
        double r372238 = y;
        double r372239 = 0.5;
        double r372240 = r372238 + r372239;
        double r372241 = log(r372238);
        double r372242 = r372240 * r372241;
        double r372243 = r372237 + r372242;
        double r372244 = r372243 - r372238;
        double r372245 = r372236 - r372244;
        return r372245;
}

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. Using strategy rm
  3. Applied add-sqr-sqrt0.3

    \[\leadsto \left(\left(x - \color{blue}{\left(\sqrt{y + 0.5} \cdot \sqrt{y + 0.5}\right)} \cdot \log y\right) + y\right) - z\]
  4. Applied associate-*l*0.3

    \[\leadsto \left(\left(x - \color{blue}{\sqrt{y + 0.5} \cdot \left(\sqrt{y + 0.5} \cdot \log y\right)}\right) + y\right) - z\]
  5. Using strategy rm
  6. Applied associate-+l-0.3

    \[\leadsto \color{blue}{\left(x - \left(\sqrt{y + 0.5} \cdot \left(\sqrt{y + 0.5} \cdot \log y\right) - y\right)\right)} - z\]
  7. Applied associate--l-0.3

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

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

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

Reproduce

herbie shell --seed 2020036 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"
  :precision binary64

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

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