Average Error: 0.1 → 0.1
Time: 3.6s
Precision: 64
\[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)\]
\[x \cdot 0.5 + y \cdot \left(2 \cdot \log \left(\sqrt{z}\right) + \left(1 - z\right)\right)\]
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
x \cdot 0.5 + y \cdot \left(2 \cdot \log \left(\sqrt{z}\right) + \left(1 - z\right)\right)
double f(double x, double y, double z) {
        double r260851 = x;
        double r260852 = 0.5;
        double r260853 = r260851 * r260852;
        double r260854 = y;
        double r260855 = 1.0;
        double r260856 = z;
        double r260857 = r260855 - r260856;
        double r260858 = log(r260856);
        double r260859 = r260857 + r260858;
        double r260860 = r260854 * r260859;
        double r260861 = r260853 + r260860;
        return r260861;
}

double f(double x, double y, double z) {
        double r260862 = x;
        double r260863 = 0.5;
        double r260864 = r260862 * r260863;
        double r260865 = y;
        double r260866 = 2.0;
        double r260867 = z;
        double r260868 = sqrt(r260867);
        double r260869 = log(r260868);
        double r260870 = r260866 * r260869;
        double r260871 = 1.0;
        double r260872 = r260871 - r260867;
        double r260873 = r260870 + r260872;
        double r260874 = r260865 * r260873;
        double r260875 = r260864 + r260874;
        return r260875;
}

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 distribute-lft-in0.1

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

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

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

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

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

    \[\leadsto x \cdot 0.5 + \left(\color{blue}{y \cdot \left(\left(1 - z\right) + \log \left(\sqrt{z}\right)\right)} + y \cdot \log \left(\sqrt{z}\right)\right)\]
  10. Using strategy rm
  11. Applied distribute-lft-out0.1

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

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

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

Reproduce

herbie shell --seed 2020025 
(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)))))