Average Error: 0.0 → 0.0
Time: 12.4s
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 r724125 = x;
        double r724126 = y;
        double r724127 = z;
        double r724128 = r724127 - r724125;
        double r724129 = r724126 * r724128;
        double r724130 = r724125 + r724129;
        return r724130;
}

double f(double x, double y, double z) {
        double r724131 = x;
        double r724132 = y;
        double r724133 = z;
        double r724134 = r724132 * r724133;
        double r724135 = -r724131;
        double r724136 = r724135 * r724132;
        double r724137 = r724134 + r724136;
        double r724138 = r724131 + r724137;
        return r724138;
}

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 2019172 
(FPCore (x y z)
  :name "SynthBasics:oscSampleBasedAux from YampaSynth-0.2"
  (+ x (* y (- z x))))