Average Error: 0.1 → 0.1
Time: 7.7s
Precision: 64
\[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)\]
\[x \cdot 0.5 + \left(1 \cdot y + y \cdot \left(-\left(z - \log z\right)\right)\right)\]
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
x \cdot 0.5 + \left(1 \cdot y + y \cdot \left(-\left(z - \log z\right)\right)\right)
double f(double x, double y, double z) {
        double r360539 = x;
        double r360540 = 0.5;
        double r360541 = r360539 * r360540;
        double r360542 = y;
        double r360543 = 1.0;
        double r360544 = z;
        double r360545 = r360543 - r360544;
        double r360546 = log(r360544);
        double r360547 = r360545 + r360546;
        double r360548 = r360542 * r360547;
        double r360549 = r360541 + r360548;
        return r360549;
}

double f(double x, double y, double z) {
        double r360550 = x;
        double r360551 = 0.5;
        double r360552 = r360550 * r360551;
        double r360553 = 1.0;
        double r360554 = y;
        double r360555 = r360553 * r360554;
        double r360556 = z;
        double r360557 = log(r360556);
        double r360558 = r360556 - r360557;
        double r360559 = -r360558;
        double r360560 = r360554 * r360559;
        double r360561 = r360555 + r360560;
        double r360562 = r360552 + r360561;
        return r360562;
}

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 - z\right) + \log z\right)\]
  2. Using strategy rm
  3. Applied associate-+l-0.1

    \[\leadsto x \cdot 0.5 + y \cdot \color{blue}{\left(1 - \left(z - \log z\right)\right)}\]
  4. Using strategy rm
  5. Applied sub-neg0.1

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

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

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

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

Reproduce

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

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

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