Average Error: 0.0 → 0.0
Time: 8.3s
Precision: 64
\[x \cdot y + z \cdot \left(1 - y\right)\]
\[1 \cdot z + \left(x - z\right) \cdot y\]
x \cdot y + z \cdot \left(1 - y\right)
1 \cdot z + \left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r31715113 = x;
        double r31715114 = y;
        double r31715115 = r31715113 * r31715114;
        double r31715116 = z;
        double r31715117 = 1.0;
        double r31715118 = r31715117 - r31715114;
        double r31715119 = r31715116 * r31715118;
        double r31715120 = r31715115 + r31715119;
        return r31715120;
}

double f(double x, double y, double z) {
        double r31715121 = 1.0;
        double r31715122 = z;
        double r31715123 = r31715121 * r31715122;
        double r31715124 = x;
        double r31715125 = r31715124 - r31715122;
        double r31715126 = y;
        double r31715127 = r31715125 * r31715126;
        double r31715128 = r31715123 + r31715127;
        return r31715128;
}

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. Taylor expanded around 0 0.0

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

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

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

Reproduce

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

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

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