Average Error: 0.0 → 0.0
Time: 8.3s
Precision: 64
\[x \cdot y + z \cdot \left(1 - y\right)\]
\[y \cdot \left(x - z\right) + 1 \cdot z\]
x \cdot y + z \cdot \left(1 - y\right)
y \cdot \left(x - z\right) + 1 \cdot z
double f(double x, double y, double z) {
        double r428749 = x;
        double r428750 = y;
        double r428751 = r428749 * r428750;
        double r428752 = z;
        double r428753 = 1.0;
        double r428754 = r428753 - r428750;
        double r428755 = r428752 * r428754;
        double r428756 = r428751 + r428755;
        return r428756;
}

double f(double x, double y, double z) {
        double r428757 = y;
        double r428758 = x;
        double r428759 = z;
        double r428760 = r428758 - r428759;
        double r428761 = r428757 * r428760;
        double r428762 = 1.0;
        double r428763 = r428762 * r428759;
        double r428764 = r428761 + r428763;
        return r428764;
}

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 flip3-+40.7

    \[\leadsto \color{blue}{\frac{{\left(x \cdot y\right)}^{3} + {\left(z \cdot \left(1 - y\right)\right)}^{3}}{\left(x \cdot y\right) \cdot \left(x \cdot y\right) + \left(\left(z \cdot \left(1 - y\right)\right) \cdot \left(z \cdot \left(1 - y\right)\right) - \left(x \cdot y\right) \cdot \left(z \cdot \left(1 - y\right)\right)\right)}}\]
  4. Simplified40.7

    \[\leadsto \frac{{\left(x \cdot y\right)}^{3} + {\left(z \cdot \left(1 - y\right)\right)}^{3}}{\color{blue}{\left(x \cdot y\right) \cdot \left(x \cdot y\right) + \left(z \cdot \left(1 - y\right)\right) \cdot \left(z \cdot \left(1 - y\right) - x \cdot y\right)}}\]
  5. Taylor expanded around inf 0.0

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

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

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

Reproduce

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