Average Error: 0.0 → 0.0
Time: 16.7s
Precision: 64
\[x + y \cdot \left(z - x\right)\]
\[x + \left(z \cdot y + \left(-x\right) \cdot y\right)\]
x + y \cdot \left(z - x\right)
x + \left(z \cdot y + \left(-x\right) \cdot y\right)
double f(double x, double y, double z) {
        double r23207 = x;
        double r23208 = y;
        double r23209 = z;
        double r23210 = r23209 - r23207;
        double r23211 = r23208 * r23210;
        double r23212 = r23207 + r23211;
        return r23212;
}

double f(double x, double y, double z) {
        double r23213 = x;
        double r23214 = z;
        double r23215 = y;
        double r23216 = r23214 * r23215;
        double r23217 = -r23213;
        double r23218 = r23217 * r23215;
        double r23219 = r23216 + r23218;
        double r23220 = r23213 + r23219;
        return r23220;
}

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-lft-in0.0

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

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

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

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

Reproduce

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