Average Error: 3.5 → 3.5
Time: 9.7s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[1 \cdot x + \left(-y \cdot z\right) \cdot x\]
x \cdot \left(1 - y \cdot z\right)
1 \cdot x + \left(-y \cdot z\right) \cdot x
double f(double x, double y, double z) {
        double r296085 = x;
        double r296086 = 1.0;
        double r296087 = y;
        double r296088 = z;
        double r296089 = r296087 * r296088;
        double r296090 = r296086 - r296089;
        double r296091 = r296085 * r296090;
        return r296091;
}

double f(double x, double y, double z) {
        double r296092 = 1.0;
        double r296093 = x;
        double r296094 = r296092 * r296093;
        double r296095 = y;
        double r296096 = z;
        double r296097 = r296095 * r296096;
        double r296098 = -r296097;
        double r296099 = r296098 * r296093;
        double r296100 = r296094 + r296099;
        return r296100;
}

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

Derivation

  1. Initial program 3.5

    \[x \cdot \left(1 - y \cdot z\right)\]
  2. Using strategy rm
  3. Applied sub-neg3.5

    \[\leadsto x \cdot \color{blue}{\left(1 + \left(-y \cdot z\right)\right)}\]
  4. Applied distribute-lft-in3.5

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

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

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

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

Reproduce

herbie shell --seed 2019351 +o rules:numerics
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1 (* y z))))