Average Error: 3.0 → 3.0
Time: 14.1s
Precision: 64
\[x \cdot \left(1 - \left(1 - y\right) \cdot z\right)\]
\[x \cdot \left(1 - \left(1 - y\right) \cdot z\right)\]
x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
double f(double x, double y, double z) {
        double r640822 = x;
        double r640823 = 1.0;
        double r640824 = y;
        double r640825 = r640823 - r640824;
        double r640826 = z;
        double r640827 = r640825 * r640826;
        double r640828 = r640823 - r640827;
        double r640829 = r640822 * r640828;
        return r640829;
}

double f(double x, double y, double z) {
        double r640830 = x;
        double r640831 = 1.0;
        double r640832 = y;
        double r640833 = r640831 - r640832;
        double r640834 = z;
        double r640835 = r640833 * r640834;
        double r640836 = r640831 - r640835;
        double r640837 = r640830 * r640836;
        return r640837;
}

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

Original3.0
Target0.2
Herbie3.0
\[\begin{array}{l} \mathbf{if}\;x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \lt -1.618195973607048970493874632750554853795 \cdot 10^{50}:\\ \;\;\;\;x + \left(1 - y\right) \cdot \left(\left(-z\right) \cdot x\right)\\ \mathbf{elif}\;x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \lt 3.892237649663902900973248011051357504727 \cdot 10^{134}:\\ \;\;\;\;\left(x \cdot y\right) \cdot z - \left(x \cdot z - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(1 - y\right) \cdot \left(\left(-z\right) \cdot x\right)\\ \end{array}\]

Derivation

  1. Initial program 3.0

    \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right)\]
  2. Final simplification3.0

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

Reproduce

herbie shell --seed 2019212 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, J"
  :precision binary64

  :herbie-target
  (if (< (* x (- 1 (* (- 1 y) z))) -1.618195973607049e50) (+ x (* (- 1 y) (* (- z) x))) (if (< (* x (- 1 (* (- 1 y) z))) 3.8922376496639029e134) (- (* (* x y) z) (- (* x z) x)) (+ x (* (- 1 y) (* (- z) x)))))

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