Average Error: 0.1 → 0.1
Time: 5.4s
Precision: 64
\[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)\]
\[x \cdot 0.5 + \left(y \cdot \left(\left(1 - z\right) + \log \left(\sqrt{z}\right)\right) + y \cdot \log \left(\sqrt{z}\right)\right)\]
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
x \cdot 0.5 + \left(y \cdot \left(\left(1 - z\right) + \log \left(\sqrt{z}\right)\right) + y \cdot \log \left(\sqrt{z}\right)\right)
double f(double x, double y, double z) {
        double r396836 = x;
        double r396837 = 0.5;
        double r396838 = r396836 * r396837;
        double r396839 = y;
        double r396840 = 1.0;
        double r396841 = z;
        double r396842 = r396840 - r396841;
        double r396843 = log(r396841);
        double r396844 = r396842 + r396843;
        double r396845 = r396839 * r396844;
        double r396846 = r396838 + r396845;
        return r396846;
}

double f(double x, double y, double z) {
        double r396847 = x;
        double r396848 = 0.5;
        double r396849 = r396847 * r396848;
        double r396850 = y;
        double r396851 = 1.0;
        double r396852 = z;
        double r396853 = r396851 - r396852;
        double r396854 = sqrt(r396852);
        double r396855 = log(r396854);
        double r396856 = r396853 + r396855;
        double r396857 = r396850 * r396856;
        double r396858 = r396850 * r396855;
        double r396859 = r396857 + r396858;
        double r396860 = r396849 + r396859;
        return r396860;
}

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. Final simplification0.1

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

Reproduce

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