Average Error: 0.0 → 0.0
Time: 12.0s
Precision: 64
\[x \cdot y + z \cdot \left(1.0 - y\right)\]
\[z \cdot 1.0 + \left(x - z\right) \cdot y\]
x \cdot y + z \cdot \left(1.0 - y\right)
z \cdot 1.0 + \left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r32055941 = x;
        double r32055942 = y;
        double r32055943 = r32055941 * r32055942;
        double r32055944 = z;
        double r32055945 = 1.0;
        double r32055946 = r32055945 - r32055942;
        double r32055947 = r32055944 * r32055946;
        double r32055948 = r32055943 + r32055947;
        return r32055948;
}

double f(double x, double y, double z) {
        double r32055949 = z;
        double r32055950 = 1.0;
        double r32055951 = r32055949 * r32055950;
        double r32055952 = x;
        double r32055953 = r32055952 - r32055949;
        double r32055954 = y;
        double r32055955 = r32055953 * r32055954;
        double r32055956 = r32055951 + r32055955;
        return r32055956;
}

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.0 - y\right)\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt32.4

    \[\leadsto \color{blue}{\sqrt{x \cdot y + z \cdot \left(1.0 - y\right)} \cdot \sqrt{x \cdot y + z \cdot \left(1.0 - y\right)}}\]
  4. Taylor expanded around 0 0.0

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

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

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

Reproduce

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