Average Error: 0.0 → 0.0
Time: 21.0s
Precision: 64
\[x + y \cdot \left(z - x\right)\]
\[x + \left(y \cdot z + \left(-x\right) \cdot y\right)\]
x + y \cdot \left(z - x\right)
x + \left(y \cdot z + \left(-x\right) \cdot y\right)
double f(double x, double y, double z) {
        double r968418 = x;
        double r968419 = y;
        double r968420 = z;
        double r968421 = r968420 - r968418;
        double r968422 = r968419 * r968421;
        double r968423 = r968418 + r968422;
        return r968423;
}

double f(double x, double y, double z) {
        double r968424 = x;
        double r968425 = y;
        double r968426 = z;
        double r968427 = r968425 * r968426;
        double r968428 = -r968424;
        double r968429 = r968428 * r968425;
        double r968430 = r968427 + r968429;
        double r968431 = r968424 + r968430;
        return r968431;
}

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 0.0

    \[x + y \cdot \left(z - x\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.0

    \[\leadsto x + y \cdot \color{blue}{\left(z + \left(-x\right)\right)}\]
  4. Applied distribute-rgt-in0.0

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

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

Reproduce

herbie shell --seed 2019171 
(FPCore (x y z)
  :name "SynthBasics:oscSampleBasedAux from YampaSynth-0.2"
  (+ x (* y (- z x))))