Average Error: 0.1 → 0.1
Time: 22.8s
Precision: 64
\[x \cdot 0.5 + y \cdot \left(\left(1.0 - z\right) + \log z\right)\]
\[\left(y \cdot 1.0 + \left(\log z - z\right) \cdot y\right) + x \cdot 0.5\]
x \cdot 0.5 + y \cdot \left(\left(1.0 - z\right) + \log z\right)
\left(y \cdot 1.0 + \left(\log z - z\right) \cdot y\right) + x \cdot 0.5
double f(double x, double y, double z) {
        double r25561323 = x;
        double r25561324 = 0.5;
        double r25561325 = r25561323 * r25561324;
        double r25561326 = y;
        double r25561327 = 1.0;
        double r25561328 = z;
        double r25561329 = r25561327 - r25561328;
        double r25561330 = log(r25561328);
        double r25561331 = r25561329 + r25561330;
        double r25561332 = r25561326 * r25561331;
        double r25561333 = r25561325 + r25561332;
        return r25561333;
}

double f(double x, double y, double z) {
        double r25561334 = y;
        double r25561335 = 1.0;
        double r25561336 = r25561334 * r25561335;
        double r25561337 = z;
        double r25561338 = log(r25561337);
        double r25561339 = r25561338 - r25561337;
        double r25561340 = r25561339 * r25561334;
        double r25561341 = r25561336 + r25561340;
        double r25561342 = x;
        double r25561343 = 0.5;
        double r25561344 = r25561342 * r25561343;
        double r25561345 = r25561341 + r25561344;
        return r25561345;
}

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(y + 0.5 \cdot x\right) - y \cdot \left(z - \log z\right)\]

Derivation

  1. Initial program 0.1

    \[x \cdot 0.5 + y \cdot \left(\left(1.0 - z\right) + \log z\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.1

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

    \[\leadsto x \cdot 0.5 + y \cdot \color{blue}{\left(1.0 + \left(\left(-z\right) + \log z\right)\right)}\]
  5. Applied distribute-lft-in0.1

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

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

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

Reproduce

herbie shell --seed 2019158 
(FPCore (x y z)
  :name "System.Random.MWC.Distributions:gamma from mwc-random-0.13.3.2"

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

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