Average Error: 0.0 → 0.0
Time: 2.3s
Precision: 64
\[x \cdot y + z \cdot \left(1 - y\right)\]
\[x \cdot y + \left(z \cdot 1 + z \cdot \left(-y\right)\right)\]
x \cdot y + z \cdot \left(1 - y\right)
x \cdot y + \left(z \cdot 1 + z \cdot \left(-y\right)\right)
double f(double x, double y, double z) {
        double r747866 = x;
        double r747867 = y;
        double r747868 = r747866 * r747867;
        double r747869 = z;
        double r747870 = 1.0;
        double r747871 = r747870 - r747867;
        double r747872 = r747869 * r747871;
        double r747873 = r747868 + r747872;
        return r747873;
}

double f(double x, double y, double z) {
        double r747874 = x;
        double r747875 = y;
        double r747876 = r747874 * r747875;
        double r747877 = z;
        double r747878 = 1.0;
        double r747879 = r747877 * r747878;
        double r747880 = -r747875;
        double r747881 = r747877 * r747880;
        double r747882 = r747879 + r747881;
        double r747883 = r747876 + r747882;
        return r747883;
}

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.0
Target0.0
Herbie0.0
\[z - \left(z - x\right) \cdot y\]

Derivation

  1. Initial program 0.0

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

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

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

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

Reproduce

herbie shell --seed 2020065 
(FPCore (x y z)
  :name "Diagrams.TwoD.Segment:bezierClip from diagrams-lib-1.3.0.3"
  :precision binary64

  :herbie-target
  (- z (* (- z x) y))

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