Average Error: 0.0 → 0.0
Time: 13.3s
Precision: 64
\[x \cdot y + z \cdot \left(1.0 - y\right)\]
\[\left(x - z \cdot 1.0\right) \cdot y + z \cdot 1.0\]
x \cdot y + z \cdot \left(1.0 - y\right)
\left(x - z \cdot 1.0\right) \cdot y + z \cdot 1.0
double f(double x, double y, double z) {
        double r28585945 = x;
        double r28585946 = y;
        double r28585947 = r28585945 * r28585946;
        double r28585948 = z;
        double r28585949 = 1.0;
        double r28585950 = r28585949 - r28585946;
        double r28585951 = r28585948 * r28585950;
        double r28585952 = r28585947 + r28585951;
        return r28585952;
}

double f(double x, double y, double z) {
        double r28585953 = x;
        double r28585954 = z;
        double r28585955 = 1.0;
        double r28585956 = r28585954 * r28585955;
        double r28585957 = r28585953 - r28585956;
        double r28585958 = y;
        double r28585959 = r28585957 * r28585958;
        double r28585960 = r28585959 + r28585956;
        return r28585960;
}

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 flip--7.1

    \[\leadsto x \cdot y + z \cdot \color{blue}{\frac{1.0 \cdot 1.0 - y \cdot y}{1.0 + y}}\]
  4. Applied associate-*r/8.9

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

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

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

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

Reproduce

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